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:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-26 16:06:41 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-26 16:06:41 +0400
commit3dd18c5c34390316ac95b972aaa989455cf8ead6 (patch)
treecb5e8fa1804e30838e19d8518ed3e0f0765eb3c8 /source/gameengine/Physics/Sumo
parente5cc9abceb5047b934b3ae8c4aac521d7e82fc00 (diff)
Added an UpdateTransform callback from SceneGraph -> Physics.
Profiling revealed that the SceneGraph updated every physics object, whether it moved or not, even though the physics object was at the right place. This would cause SOLID to go and update its bounding boxes, overlap tests etc. This callback handles the special case (parented objects) where the physics scene needs to be informed of changes to the scenegraph. Added Python attributes (mass, parent, visible, position, orientation, scaling) to the KX_GameObject module. Make KX_GameObject use the KX_PyMath Python <-> Moto conversion.
Diffstat (limited to 'source/gameengine/Physics/Sumo')
-rw-r--r--source/gameengine/Physics/Sumo/SumoPhysicsController.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp
index 3407f2120e8..8638c0a610a 100644
--- a/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp
+++ b/source/gameengine/Physics/Sumo/SumoPhysicsController.cpp
@@ -85,38 +85,12 @@ float SumoPhysicsController::getMass()
bool SumoPhysicsController::SynchronizeMotionStates(float time)
{
-
if (m_bFirstTime)
{
- setSumoTransform(false);
+ setSumoTransform(!m_bFirstTime);
m_bFirstTime = false;
}
-
- if (!m_bDyna)
- {
- if (m_sumoObj)
- {
- MT_Point3 pos;
- GetWorldPosition(pos);
-
- m_sumoObj->setPosition(pos);
- if (m_bDyna)
- {
- m_sumoObj->setScaling(MT_Vector3(1,1,1));
- } else
- {
- MT_Vector3 scaling;
- GetWorldScaling(scaling);
- m_sumoObj->setScaling(scaling);
- }
- MT_Matrix3x3 orn;
- GetWorldOrientation(orn);
- m_sumoObj->setOrientation(orn.getRotation());
- m_sumoObj->calcXform();
- }
- }
- return false; // physics object are not part of
- // hierarchy, or ignore it ??
+ return false;
}