Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2005-08-23 17:16:02 +0400
committerErwin Coumans <blender@erwincoumans.com>2005-08-23 17:16:02 +0400
commit056a33ac699f0393b87503536b5492f03fd6b55a (patch)
tree1f23c3d9ef4d44ed9a48097b914481f5822830de /source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
parent0192536102a0d0179f2cb09e62c7035c13ce3723 (diff)
new game-menu option 'Record Game Physics to Ipo'
including implementation. hope it works, and doesn't break to much. it bakes physics objects transform into ipo, every frame of the running gameengine. When you disable and run the game again, it clears the ipo's again. just for physics objects at the moment. (perhaps some better UI in the future?)
Diffstat (limited to 'source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
index b5aea65cfe4..e9a6c2442b0 100644
--- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
+++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
@@ -866,7 +866,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
assert(env);
- bool dyna = false;
+ bool isbulletdyna = false;
CcdConstructionInfo ci;
class PHY_IMotionState* motionstate = new KX_MotionState(gameobj->GetSGNode());
@@ -874,7 +874,8 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
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;
@@ -1008,11 +1009,11 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj,
//need a bit of damping, else system doesn't behave well
- KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,dyna);
+ KX_BulletPhysicsController* physicscontroller = new KX_BulletPhysicsController(ci,isbulletdyna);
env->addCcdPhysicsController( physicscontroller);
- gameobj->SetPhysicsController(physicscontroller,dyna);
+ gameobj->SetPhysicsController(physicscontroller,isbulletdyna);
physicscontroller->setNewClientInfo(gameobj->getClientInfo());
bool isActor = objprop->m_isactor;
gameobj->getClientInfo()->m_type = (isActor ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC);