Raycast crash on crosshair drawing
by Josef Jahn · in Torque Game Engine · 01/11/2003 (9:32 am) · 2 replies
Hiya all.
I just found a nasty crash that only happens when I have certain high-poly weapon models ingame.
In fps/guiCrossHairHud.cc:
The raycast produces an access violation, in ts/tsCollision.cc in function castRay():
It may well be caused by a model itself, since I'm using the Milkshape exporter...
I don't need the health display of other people anyway, still... Any ideas?
I just found a nasty crash that only happens when I have certain high-poly weapon models ingame.
In fps/guiCrossHairHud.cc:
...
if (gClientContainer.castRay(camPos, endPos, losMask, &info)) {
// Hit something... but we'll only display health for named
// ShapeBase objects. Could mask against the object type here
// and do a static cast if it's a ShapeBaseObjectType, but this
// isn't a performance situation, so I'll just use dynamic_cast.
if (ShapeBase* obj = dynamic_cast<ShapeBase*>(info.object))
if (obj->getShapeName()) {
offset.x = updateRect.point.x + updateRect.extent.x / 2;
offset.y = updateRect.point.y + updateRect.extent.y / 2;
drawDamage(offset + mDamageOffset, obj->getDamageValue(), 1);
}
}
...The raycast produces an access violation, in ts/tsCollision.cc in function castRay():
// run through objects and collide
for (S32 i=start; i<end; i++)
{
MeshObjectInstance * mesh = &mMeshObjects[i];
if (mesh->getTransform() != previousMat)
{
// different node from before, set up for this node
----------> previousMat = mesh->getTransform();
mat = *previousMat;
mat.inverse();
mat.mulP(a,&ta);
mat.mulP(b,&tb);
}It may well be caused by a model itself, since I'm using the Milkshape exporter...
I don't need the health display of other people anyway, still... Any ideas?
#2
Solutions?
03/25/2004 (3:45 pm)
Having this exact same problem in the same place with a MilkShape model. When a player throws an object, if the object hits the crosshair, it crashes at the exact same point. Anyone else having this problem?Solutions?
Torque Owner Paul Shotbolt