Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
10d2fa42
Unverified
Commit
10d2fa42
authored
Jun 22, 2020
by
Rémi Verschelde
Committed by
GitHub
Jun 22, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39747 from nekomatata/fix-crash-space-query
Fix crashes with invalid shapes in BulletPhysicsDirectSpaceState queries
parents
492625db
8b0232bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
space_bullet.cpp
modules/bullet/space_bullet.cpp
+4
-0
No files found.
modules/bullet/space_bullet.cpp
View file @
10d2fa42
...
@@ -123,6 +123,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra
...
@@ -123,6 +123,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra
}
}
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ERR_FAIL_COND_V
(
!
shape
,
0
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_xform
.
basis
.
get_scale_abs
(),
p_margin
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_xform
.
basis
.
get_scale_abs
(),
p_margin
);
if
(
!
btShape
->
isConvex
())
{
if
(
!
btShape
->
isConvex
())
{
...
@@ -162,6 +163,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf
...
@@ -162,6 +163,7 @@ bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transf
}
}
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ERR_FAIL_COND_V
(
!
shape
,
false
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_xform
.
basis
.
get_scale
(),
p_margin
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_xform
.
basis
.
get_scale
(),
p_margin
);
if
(
!
btShape
->
isConvex
())
{
if
(
!
btShape
->
isConvex
())
{
...
@@ -215,6 +217,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
...
@@ -215,6 +217,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
}
}
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ERR_FAIL_COND_V
(
!
shape
,
false
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_shape_xform
.
basis
.
get_scale_abs
(),
p_margin
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_shape_xform
.
basis
.
get_scale_abs
(),
p_margin
);
if
(
!
btShape
->
isConvex
())
{
if
(
!
btShape
->
isConvex
())
{
...
@@ -246,6 +249,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
...
@@ -246,6 +249,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
bool
BulletPhysicsDirectSpaceState
::
rest_info
(
RID
p_shape
,
const
Transform
&
p_shape_xform
,
float
p_margin
,
ShapeRestInfo
*
r_info
,
const
Set
<
RID
>
&
p_exclude
,
uint32_t
p_collision_mask
,
bool
p_collide_with_bodies
,
bool
p_collide_with_areas
)
{
bool
BulletPhysicsDirectSpaceState
::
rest_info
(
RID
p_shape
,
const
Transform
&
p_shape_xform
,
float
p_margin
,
ShapeRestInfo
*
r_info
,
const
Set
<
RID
>
&
p_exclude
,
uint32_t
p_collision_mask
,
bool
p_collide_with_bodies
,
bool
p_collide_with_areas
)
{
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ShapeBullet
*
shape
=
space
->
get_physics_server
()
->
get_shape_owner
()
->
getornull
(
p_shape
);
ERR_FAIL_COND_V
(
!
shape
,
false
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_shape_xform
.
basis
.
get_scale_abs
(),
p_margin
);
btCollisionShape
*
btShape
=
shape
->
create_bt_shape
(
p_shape_xform
.
basis
.
get_scale_abs
(),
p_margin
);
if
(
!
btShape
->
isConvex
())
{
if
(
!
btShape
->
isConvex
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment