soc-2008-mxcurioni: merged changes to revision 15705
[blender.git] / source / gameengine / Ketsji / KX_RadarSensor.cpp
index 987e0b946b20e9774880e18847a0a70247e2503d..de4979ac4c951ef1565be9d4bb56721eecf0d004 100644 (file)
@@ -80,10 +80,7 @@ CValue* KX_RadarSensor::GetReplica()
 {
        KX_RadarSensor* replica = new KX_RadarSensor(*this);
        replica->m_colliders = new CListValue();
-       replica->m_bCollision = false;
-       replica->m_bTriggered= false;
-       replica->m_hitObject = NULL;
-       replica->m_bLastTriggered = false;
+       replica->Init();
        // this will copy properties and so on...
        CValue::AddDataToReplica(replica);
        
@@ -92,6 +89,10 @@ CValue* KX_RadarSensor::GetReplica()
        if (replica->m_physCtrl)
        {
                replica->m_physCtrl = replica->m_physCtrl->GetReplica();
+               if (replica->m_physCtrl)
+               {
+                       replica->m_physCtrl->setNewClientInfo(replica->m_client_info);
+               }
        }
 
        //todo: make sure replication works fine!
@@ -175,8 +176,10 @@ void KX_RadarSensor::SynchronizeTransform()
 
        if (m_physCtrl)
        {
-               m_physCtrl->setPosition(trans.getOrigin().x(),trans.getOrigin().y(),trans.getOrigin().z());
-               m_physCtrl->setOrientation(trans.getRotation().x(),trans.getRotation().y(),trans.getRotation().z(),trans.getRotation().w());
+               MT_Quaternion orn = trans.getRotation();
+               MT_Point3 pos = trans.getOrigin();
+               m_physCtrl->setPosition(pos[0],pos[1],pos[2]);
+               m_physCtrl->setOrientation(orn[0],orn[1],orn[2],orn[3]);
                m_physCtrl->calcXform();
        }