Game Development Community

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?

#1
11/01/2007 (3:50 pm)
Bump... no one ever use this for vehicles?
#2
11/09/2007 (10:13 am)
Bump.. one last time no one has ever used this to show a vehicle?
#3
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...