Game Development Community

Bug fix for New Demo Branch

by David Dougher · in Torque Game Engine · 06/02/2003 (6:13 pm) · 0 replies

In the hovervehicle.cc file the code for the routine hoverVehicle::UpdateForces contains the code...

StabPoint stabPoints[2];
stabPoints[0].osPoint = Point3F((mObjBox.min.x + mObjBox.min.x) * 0.5,
mObjBox.max.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
stabPoints[1].osPoint = Point3F((mObjBox.min.x + mObjBox.min.x) * 0.5,
mObjBox.min.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
U32 j, i;

I think it should probably be...

StabPoint stabPoints[2];
stabPoints[0].osPoint = Point3F((mObjBox.min.x + mObjBox.max.x) * 0.5,
mObjBox.max.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
stabPoints[1].osPoint = Point3F((mObjBox.min.x + mObjBox.max.x) * 0.5,
mObjBox.min.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
U32 j, i;

If not then the lines could be simplified to...

StabPoint stabPoints[2];
stabPoints[0].osPoint = Point3F(mObjBox.min.x,
mObjBox.max.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
stabPoints[1].osPoint = Point3F(mObjBox.min.x,
mObjBox.min.y,
(mObjBox.min.z + mObjBox.max.z) * 0.5);
U32 j, i;

since mObjBox.min.x is being doubled by addition and the result halved by multiplication.

About the author

Owner - Pariah Games, Adjunct Professor - Bristol Community College, Mentor - Game Design - Met School Newport, Mentor - Game Design - Met School Providence