diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2008-09-29 12:00:38 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2008-09-29 12:00:38 +0400 |
commit | 638c51ba7d54b7a815c745d5f383bcbed6d4d1d1 (patch) | |
tree | 66a4abd709a8358c653b45463b18fe116f3a9738 /source/gameengine | |
parent | 2c289a02b6907204ba322071938578554d5409f7 (diff) |
don't crash when trying to make a soft body 'fh' object
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 483f829c2bd..fc19789196d 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -626,13 +626,15 @@ void CcdPhysicsEnvironment::processFhSprings(double curTime,float timeStep) for (it=m_controllers.begin(); it!=m_controllers.end(); it++) { CcdPhysicsController* ctrl = (*it); - if (ctrl->GetRigidBody() && ctrl->getConstructionInfo().m_do_fh || ctrl->getConstructionInfo().m_do_rot_fh) + btRigidBody* body = ctrl->GetRigidBody(); + + if (body && (ctrl->getConstructionInfo().m_do_fh || ctrl->getConstructionInfo().m_do_rot_fh)) { //printf("has Fh or RotFh\n"); //re-implement SM_FhObject.cpp using btCollisionWorld::rayTest and info from ctrl->getConstructionInfo() //send a ray from {0.0, 0.0, 0.0} towards {0.0, 0.0, -10.0}, in local coordinates - btRigidBody* body = ctrl->GetRigidBody(); + CcdPhysicsController* parentCtrl = ctrl->getParentCtrl(); btRigidBody* parentBody = parentCtrl?parentCtrl->GetRigidBody() : 0; btRigidBody* cl_object = parentBody ? parentBody : body; |