Open GoogleCodeExporter opened 8 years ago
[deleted comment]
gameObject is gkGameObject in file gkGameObject.cpp
Original comment by kizan...@gmail.com
on 1 Jun 2012 at 6:38
if I call the activate() method of gkPhysicsController in
gkPhysicsController::updateTransform(void) after
m_collisionObject->setWorldTransform(worldTrans); the problem above will not
occur.
void gkPhysicsController::updateTransform(void)
{
if (m_suspend || !m_collisionObject)
return;
btTransform worldTrans;
worldTrans.setIdentity();
gkQuaternion rot;
gkVector3 loc;
if (!m_object->getParent())
{
rot = m_object->getOrientation();
loc = m_object->getPosition();
}
else
{
rot = m_object->getWorldOrientation();
loc = m_object->getWorldPosition();
}
worldTrans.setRotation(btQuaternion(rot.x, rot.y, rot.z, rot.w));
worldTrans.setOrigin(btVector3(loc.x, loc.y, loc.z));
m_collisionObject->setWorldTransform(worldTrans);
+++++m_collisionObject->activate();
}
is this the solution? any other suggestion?
Original comment by kizan...@gmail.com
on 1 Jun 2012 at 8:18
The problem is that you should not use translate for moving rigidbodies. You
will get problems with collision-control and such. Use the "Dynamic Object
Settings" with force, torque and linear velocity to move your object.
Original comment by thomas.t...@googlemail.com
on 6 Jun 2012 at 1:17
[deleted comment]
thanks for you reply, thomas. :)
I really get some collision problem, but I find in blender It work very well
when I use the MotionActuator with location or rotate properties.
what can I do if I want to get the same effect like blender ?And I doubt
whether it is the user's responsibility to the collision problem.
the collision problem is just like to set two rigid body at the same position,
this action is not right for user, but user can do it and the dynamic world
should notify the user what he have done ,is this right?
in my game I want my player to move the game object to a exactly position to
set some thing, if I use "Dynamic Object Settings" it is too difficult to
control the destination of the game object, with translate methods it become
easy. It is looks strange that the game object will lose physic effect.
now I fixed the collision problem with a ghost rigid body translate first and
then after a dynamicsWorld step update, I will translate my game object to the
right place by query the collision test result of the ghost rigid body .
is this right ? so confused am I.
Original comment by kizan...@gmail.com
on 6 Jun 2012 at 5:09
Original issue reported on code.google.com by
kizan...@gmail.com
on 1 Jun 2012 at 6:34Attachments: