Game Development Community

T2dTriggers can't detect more than one object at the same time

by Michael Woerister · in Torque Game Builder · 08/23/2006 (8:12 am) · 4 replies

Hi,

I just found out that my t2dTriggers don't work anymore when more then one object overlaps with them.

It must be the same problem as in this thread:
www.garagegames.com/mg/forums/result.thread.php?qt=46138

But for t2dTriggers it could be easily solved by just overriding the checkCollisionSend() method and let it do a castCollisionList().
What do you think?

-Michael

#1
08/23/2006 (8:42 am)
bool t2dTrigger::checkCollisionSend( const F32 elapsedTime, t2dPhysics::cCollisionStatus& sendCollisionStatus, CDebugStats* pDebugStats )
{
    sendCollisionStatus.mValidCollision = false;
    sendCollisionStatus.mHandled = false;

   if( !castCollisionList( elapsedTime ) )
      return false;

   for( Vector<t2dPhysics::cCollisionStatus>::iterator it = mPotentialCollisionStatusList.begin();
        it != mPotentialCollisionStatusList.end(); it++ )
   {
      it->mHandled = false;
      it->mValidCollision = false;
      processCollisionStatus( it, pDebugStats );
   }

   mPotentialCollisionObjectList.clear();
   mPotentialCollisionStatusList.clear();

   return true;
}

Seems to work.
#2
09/05/2006 (3:08 pm)
Thank you for reporting your issue, it has been logged :)
#3
09/06/2006 (9:03 am)
Thanks Matt :)
#4
12/27/2006 (7:31 pm)
Thanks Michael!

I spent a long time trying to figure out how to work around this is script, but eventually I decided I couldn't. Then I found your thread. A few minutes after reading your thread I'd added your change to my build and magically everything works.

I've only had TGB for about 2 weeks and was planning to make my first game entirely in script. Now my plan for this first game is to make it entirely in script plus your fix.

After this first game I do intend to start looking into the engine code some, but first I wanted to get something done.

Anyways I just wanted to say I appreciate your fix, and it just made making my game a lot easier.