Game Development Community

Mount node position problem?

by Nabarro · in Torque Game Engine Advanced · 05/29/2009 (9:17 pm) · 0 replies

Hello, Everybody,
I have one StaticShape object which has spinning animation, and it has several mount points. I mount player to the StaticShape object by one of the objects' mount point and it works fine. But when the StaticShape object is doing spin animation, the layer is lagged behind seriously.

Because when player is mounted to the StaticShape object, player's position is decided by the object mount node's position, which can be seen at:

void Player::setPosition(const Point3F& pos,const Point3F& rot)
{
MatrixF mat;
if (isMounted())
{
// Use transform from mounted object
MatrixF nmat,zrot;
mMount.object->getMountTransform(mMount.node,&nmat);
zrot.set(EulerF(0.0f, 0.0f, rot.z));
mat.mul(nmat,zrot);
}
...
}

It seems that function "mMount.object->getMountTransform(mMount.node,&nmat);
" can NOT get the proper position of the animated object's node(mount point).


Does anybody have such problem? Very appreciated for your help.

Thanks,