GuiObjectView and vehicles
by Howard Dortch · in Torque Game Engine · 10/29/2007 (11:09 am) · 4 replies
I used the bonus resource bundle to get the guiObjectView in game.
When I load a vehicle and mount wheels on the buggy they are rotated 90 deg from normal. Anyone know of fix for this other then making a new set of wheels?
When I load a vehicle and mount wheels on the buggy they are rotated 90 deg from normal. Anyone know of fix for this other then making a new set of wheels?
#2
11/09/2007 (10:13 am)
Bump.. one last time no one has ever used this to show a vehicle?
#3
void GuiObjectView::getObjectTransform( MatrixF *mat , S32 index)
{
MatrixF subTrans = mMeshObjects.mMesh[index].mesh->mNodeTransforms[mMeshObjects.mMesh[index].node];
Point3F subOffset = -subTrans.getPosition();
S32 pIndex = mMeshObjects.mMesh[index].parentIndex;
MatrixF parentTrans = mMeshObjects.mMesh[pIndex].mesh->mNodeTransforms[mMeshObjects.mMesh[index].parentNode];
Point3F rot,pos;
if ((index==2)||(index==3))
rot.set(0,0,90*M_PI_F/180); //she no likey recognising hub# as mount# ors rotation just not stored?
else rot.set(0,0,-90*M_PI_F/180); //will have to look into that one later...
pos = parentTrans.getPosition();
parentTrans.set(rot);
parentTrans.setPosition(pos);
parentTrans.mulP( subOffset );
*mat = parentTrans;
}
11/09/2007 (11:02 am)
Game specific hack:void GuiObjectView::getObjectTransform( MatrixF *mat , S32 index)
{
MatrixF subTrans = mMeshObjects.mMesh[index].mesh->mNodeTransforms[mMeshObjects.mMesh[index].node];
Point3F subOffset = -subTrans.getPosition();
S32 pIndex = mMeshObjects.mMesh[index].parentIndex;
MatrixF parentTrans = mMeshObjects.mMesh[pIndex].mesh->mNodeTransforms[mMeshObjects.mMesh[index].parentNode];
Point3F rot,pos;
if ((index==2)||(index==3))
rot.set(0,0,90*M_PI_F/180); //she no likey recognising hub# as mount# ors rotation just not stored?
else rot.set(0,0,-90*M_PI_F/180); //will have to look into that one later...
pos = parentTrans.getPosition();
parentTrans.set(rot);
parentTrans.setPosition(pos);
parentTrans.mulP( subOffset );
*mat = parentTrans;
}
#4
11/09/2007 (11:45 am)
Thanks Kirk that worked great...
Torque 3D Owner Howard Dortch
Default Studio Name