Triggers don't obey collision groups and layers
by Tom Spilman · in Torque Game Builder · 08/13/2006 (1:14 am) · 0 replies
Unless i'm messing something up over here it seems that Triggers don't obey collision groups and layers. I've added the following to t2dTrigger::onCollision() to fix this:
UPDATE: Fixed because it was wrong. ;)
Still i wonder if this is really a bug further up the call stack... shouldn't the caller of this function have already used the collision groups and layers to cull potential collision shapes first?
UPDATE: Fixed because it was wrong. ;)
void t2dTrigger::onCollision(t2dPhysics::cCollisionStatus* collisionStatus)
{
t2dSceneObject* collider = collisionStatus->mDstObject;
if (collider == this)
collider = collisionStatus->mSrcObject;
// Skip this collision if it's not in the right groups
if ( collider->getGraphGroupMask() & getCollisionGroupMask() &&
collider->getLayerMask() & getCollisionLayerMask() )
{
// Add the collider to the current collider list... if it's not already colliding.
if (!isColliding(collider, mCurrentColliders))
mColliders[mCurrentColliders].push_back(collider);
}
}Still i wonder if this is really a bug further up the call stack... shouldn't the caller of this function have already used the collision groups and layers to cull potential collision shapes first?
About the author
Tom is a programmer and co-owner of Sickhead Games, LLC.