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>2006-12-04 07:13:42 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-04 07:13:42 +0300
commit2ec5d00da91848ce8c56d383a23a35b76243b956 (patch)
tree293000afd2bfeb82b9633aa285407dcbb58f6fd7 /source/gameengine/Ketsji
parentfc691cdb5e0c23bf36e68a14903d6bc4d0cc5242 (diff)
fixed some motionstate synchronization issues
nearsensor was not synchronized at the start wheels not synchronized properly (one frame delay)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_MotionState.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_NearSensor.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_RadarSensor.cpp1
-rw-r--r--source/gameengine/Ketsji/KX_TouchSensor.cpp6
4 files changed, 9 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_MotionState.cpp b/source/gameengine/Ketsji/KX_MotionState.cpp
index 14849ef704c..cd01c0466cd 100644
--- a/source/gameengine/Ketsji/KX_MotionState.cpp
+++ b/source/gameengine/Ketsji/KX_MotionState.cpp
@@ -73,7 +73,7 @@ void KX_MotionState::getWorldOrientation(float& quatIma0,float& quatIma1,float&
void KX_MotionState::setWorldPosition(float posX,float posY,float posZ)
{
m_node->SetLocalPosition(MT_Point3(posX,posY,posZ));
- //m_node->SetWorldPosition(MT_Point3(posX,posY,posZ));
+ m_node->SetWorldPosition(MT_Point3(posX,posY,posZ));
}
void KX_MotionState::setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal)
@@ -85,7 +85,7 @@ void KX_MotionState::setWorldOrientation(float quatIma0,float quatIma1,float qua
orn[3] = quatReal;
m_node->SetLocalOrientation(orn);
- //m_node->SetWorldOrientation(orn);
+ m_node->SetWorldOrientation(orn);
}
diff --git a/source/gameengine/Ketsji/KX_NearSensor.cpp b/source/gameengine/Ketsji/KX_NearSensor.cpp
index fac2302b85e..34561045cab 100644
--- a/source/gameengine/Ketsji/KX_NearSensor.cpp
+++ b/source/gameengine/Ketsji/KX_NearSensor.cpp
@@ -116,6 +116,7 @@ CValue* KX_NearSensor::GetReplica()
//replica->m_sumoObj->setMargin(m_Margin);
//replica->m_sumoObj->setClientObject(replica->m_client_info);
+ ((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL);
replica->SynchronizeTransform();
return replica;
@@ -139,7 +140,7 @@ void KX_NearSensor::ReParent(SCA_IObject* parent)
client_info->m_sensors.push_back(this);
SCA_ISensor::ReParent(parent);
*/
-
+ ((KX_GameObject*)GetParent())->GetSGNode()->ComputeWorldTransforms(NULL);
SynchronizeTransform();
}
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp
index eae9784935c..5d56eaabb5a 100644
--- a/source/gameengine/Ketsji/KX_RadarSensor.cpp
+++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp
@@ -103,6 +103,7 @@ CValue* KX_RadarSensor::GetReplica()
//replica->m_sumoObj->setMargin(m_Margin);
//replica->m_sumoObj->setClientObject(replica->m_client_info);
+ ((KX_GameObject*)replica->GetParent())->GetSGNode()->ComputeWorldTransforms(NULL);
replica->SynchronizeTransform();
return replica;
diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp
index 3cd5097ebb7..5b013e75e4e 100644
--- a/source/gameengine/Ketsji/KX_TouchSensor.cpp
+++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp
@@ -54,8 +54,10 @@ void KX_TouchSensor::SynchronizeTransform()
if (m_physCtrl)
{
- MT_Vector3 pos = ((KX_GameObject*)GetParent())->NodeGetWorldPosition();
- MT_Quaternion orn = ((KX_GameObject*)GetParent())->NodeGetWorldOrientation().getRotation();
+
+ KX_GameObject* parent = ((KX_GameObject*)GetParent());
+ MT_Vector3 pos = parent->NodeGetWorldPosition();
+ MT_Quaternion orn = parent->NodeGetWorldOrientation().getRotation();
m_physCtrl->setPosition(pos.x(),pos.y(),pos.z());
m_physCtrl->setOrientation(orn.x(),orn.y(),orn.z(),orn.w());
m_physCtrl->calcXform();