SetMoveDestination inaccuracy help requested
by Ronald V Rieger · in Torque Game Engine · 08/28/2007 (1:11 pm) · 2 replies
I am currently trying to use setMoveDestination to move a bot relatively small distance to rather precise locations. I use either getPosition or getTransform to determine where I want to send the bot, and then use this in setMoveDestination. I am getting considerable drift, and it seems to be coming from the use of getEyeTransform in the AIPlayer::getAIMove(Move *movePtr) function that is used by the setMoveDestitation function. This seems to vary enough from where I originally sent the bot (i.e, getTransform and getEyeTransform return noticeably different values) that it causes considerably drift on the next move.
I would like to substitute, at least for this case, either getPosition or getTransform values for those that currently come from getEyeTransform but, being really new to the SDK, I am not sure what engine calls to make or the proper syntax to get this information.
I have included the first part of the function below, and, once I know what engine function calls to use it is easy enough to substitute the data for what is being produced for the setMoveDestination function (only).
bool AIPlayer::getAIMove(Move *movePtr)
{
*movePtr = NullMove;
// Use the eye as the current position.
MatrixF eye;
getEyeTransform(&eye);
Point3F location = eye.getPosition();
Point3F rotation = getRotation();
I want to change Point3F location = eye.getPosition() to use data from getTransform instead of getEyeTransform.
Any help on this would really be appreciated. I am doing pro bono work for college class room demonstrations of Torque but cannot get this to work correctly after spending an immense amount of time on it. Perhaps I am doing something else stupid, and am definitely open to alternative ideas.
I would like to substitute, at least for this case, either getPosition or getTransform values for those that currently come from getEyeTransform but, being really new to the SDK, I am not sure what engine calls to make or the proper syntax to get this information.
I have included the first part of the function below, and, once I know what engine function calls to use it is easy enough to substitute the data for what is being produced for the setMoveDestination function (only).
bool AIPlayer::getAIMove(Move *movePtr)
{
*movePtr = NullMove;
// Use the eye as the current position.
MatrixF eye;
getEyeTransform(&eye);
Point3F location = eye.getPosition();
Point3F rotation = getRotation();
I want to change Point3F location = eye.getPosition() to use data from getTransform instead of getEyeTransform.
Any help on this would really be appreciated. I am doing pro bono work for college class room demonstrations of Torque but cannot get this to work correctly after spending an immense amount of time on it. Perhaps I am doing something else stupid, and am definitely open to alternative ideas.
#2
Thank you very much, Peter.
08/28/2007 (2:55 pm)
How embarrassingly simple. It also seems to have helped the drift, though it needs more testing.Thank you very much, Peter.
Torque 3D Owner Peter Simard
Default Studio Name