diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-04-17 05:33:10 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-04-17 05:33:10 +0400 |
commit | 971ee74c845e31cec49e428877fbdc6315dda0ed (patch) | |
tree | 56f4d2bc2ce2cde3f8a0b7d1c4a733a41d78306c /source/gameengine/Ketsji | |
parent | 176641b2730084ae279e1567af92d5e493c60f03 (diff) |
added support for 'Ghost' object and collision sensor (preliminary)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 3e5f71c63d8..f35ba115e2c 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -896,12 +896,22 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, CcdConstructionInfo ci; class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode()); + if (objprop->m_ghost) + { + ci.m_collisionFlags |= CollisionObject::noContactResponse; + } + + if (!objprop->m_dyna) + { + ci.m_collisionFlags |= CollisionObject::isStatic; + } + ci.m_MotionState = motionstate; ci.m_gravity = SimdVector3(0,0,0); ci.m_localInertiaTensor =SimdVector3(0,0,0); ci.m_mass = objprop->m_dyna ? shapeprops->m_mass : 0.f; isbulletdyna = objprop->m_dyna; - + ci.m_localInertiaTensor = SimdVector3(ci.m_mass/3.f,ci.m_mass/3.f,ci.m_mass/3.f); SimdTransform trans; @@ -1079,8 +1089,9 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, bool isActor = objprop->m_isactor; gameobj->getClientInfo()->m_type = (isActor ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC); // store materialname in auxinfo, needed for touchsensors - //gameobj->getClientInfo()->m_auxilary_info = 0;//(matname.Length() ? (void*)(matname.ReadPtr()+2) : NULL); - //gameobj->getClientInfo()->m_auxilary_info = (matname.Length() ? (void*)(matname.ReadPtr()+2) : NULL); + const STR_String& matname=meshobj->GetMaterialName(0); + gameobj->getClientInfo()->m_auxilary_info = (matname.Length() ? (void*)(matname.ReadPtr()+2) : NULL); + gameobj->GetSGNode()->AddSGController(physicscontroller); |