fixed error message when physical box dimension is set to 0
fixed crash when an entity with script component without valid path to script collides
This commit is contained in:
parent
60cb32b833
commit
adbff40a45
2 changed files with 5 additions and 3 deletions
|
@ -149,6 +149,8 @@ public:
|
|||
{
|
||||
ASSERT(m_global_state);
|
||||
auto& script = *cmp;
|
||||
if (!script.m_state) return;
|
||||
|
||||
lua_rawgeti(script.m_state, LUA_REGISTRYINDEX, script.m_environment);
|
||||
if (lua_getfield(script.m_state, -1, "onContact") != LUA_TFUNCTION)
|
||||
{
|
||||
|
|
|
@ -841,9 +841,9 @@ struct PhysicsSceneImpl : public PhysicsScene
|
|||
bool is_box = shapes->getBoxGeometry(box);
|
||||
ASSERT(is_box);
|
||||
physx::PxVec3& half = box.halfExtents;
|
||||
half.x = size.x;
|
||||
half.y = size.y;
|
||||
half.z = size.z;
|
||||
half.x = Math::maxValue(0.01f, size.x);
|
||||
half.y = Math::maxValue(0.01f, size.y);
|
||||
half.z = Math::maxValue(0.01f, size.z);
|
||||
shapes->setGeometry(box);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue