diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_RadarSensor.cpp | 15 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index ea656877e92..eae9784935c 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -93,7 +93,11 @@ CValue* KX_RadarSensor::GetReplica() replica->m_client_info = new KX_ClientObjectInfo(m_client_info->m_gameobject, KX_ClientObjectInfo::RADAR); - replica->m_physCtrl = replica->m_physCtrl->GetReplica(); + if (replica->m_physCtrl) + { + replica->m_physCtrl = replica->m_physCtrl->GetReplica(); + } + //todo: make sure replication works fine! //>m_sumoObj = new SM_Object(DT_NewCone(m_coneradius, m_coneheight),NULL,NULL,NULL); //replica->m_sumoObj->setMargin(m_Margin); @@ -151,9 +155,12 @@ void KX_RadarSensor::SynchronizeTransform() m_cone_target = trans(MT_Point3(0, -m_coneheight/2.0 ,0)); - 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()); - m_physCtrl->calcXform(); + 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()); + m_physCtrl->calcXform(); + } } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 7051b8f7e13..0db5ce4e668 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -272,7 +272,7 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque void CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bool local) { - SimdVector3 force(forceX,forceX,forceX); + SimdVector3 force(forceX,forceY,forceZ); SimdTransform xform = m_body->getCenterOfMassTransform(); if (local) { |