Vehicle problem
by Ero "Super Newbie" Sennin · in Torque Game Engine · 02/23/2004 (5:29 pm) · 2 replies
Ok so I was able to get this my plane flying but I have a snag...well 2.
1. everytime is touches the ground the whole app crashes
2. it flys backwards i.e. front faces camera back faces out
any ideas?
here his a peice of the crash log
Date/Time: 2004-02-23 22:29:11 -0800
OS Version: 10.3.2 (Build 7D24)
Report Version: 2
Command: Torque Demo Debug OSX
Path: /trq_tutorial_base/Torque Demo Debug OSX.app/Contents/MacOS/Torque Demo Debug OSX
Version:
1. everytime is touches the ground the whole app crashes
2. it flys backwards i.e. front faces camera back faces out
any ideas?
here his a peice of the crash log
Date/Time: 2004-02-23 22:29:11 -0800
OS Version: 10.3.2 (Build 7D24)
Report Version: 2
Command: Torque Demo Debug OSX
Path: /trq_tutorial_base/Torque Demo Debug OSX.app/Contents/MacOS/Torque Demo Debug OSX
Version:
#2
Bold lines added.
Changed ShapeBaseConvex::support()
Added this if check in function ShapeBaseConvex::getFeatures()
12/19/2004 (2:14 pm)
In case someone runs into this. I ran into this same problem. I think it has to do with a shapes having an invalid collsion hull. I got around this with the below changes. But the real way to fix this is probably to fix the collsion hull. For me since collision was not necessary for these objects this worked fine.Bold lines added.
Changed ShapeBaseConvex::support()
Point3F ShapeBaseConvex::support(const VectorF& v) const
{
TSShape::ConvexHullAccelerator* pAccel =
pShapeBase->mShapeInstance->getShape()->getAccelerator(pShapeBase->mDataBlock->collisionDetails[hullId]);
AssertFatal(pAccel != NULL, "Error, no accel!");
[b]if (pAccel->numVerts > 0)
{[/b]
F32 currMaxDP = mDot(pAccel->vertexList[0], v);
U32 index = 0;
for (U32 i = 1; i < pAccel->numVerts; i++) {
F32 dp = mDot(pAccel->vertexList[i], v);
if (dp > currMaxDP) {
currMaxDP = dp;
index = i;
}
}
return pAccel->vertexList[index];
[b] }
return Point3F(0,0,0);[/b]
}Added this if check in function ShapeBaseConvex::getFeatures()
void ShapeBaseConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf)
{
cf->material = 0;
cf->object = mObject;
TSShape::ConvexHullAccelerator* pAccel =
pShapeBase->mShapeInstance->getShape()->getAccelerator(pShapeBase->mDataBlock->collisionDetails[hullId]);
AssertFatal(pAccel != NULL, "Error, no accel!");
[b]if (pAccel->numVerts < 1)
return;[/b]
...
}
Torque Owner Alex Swanson