CollectGarbage crashes when object can collide with its own type
by Demolishun · in Torque Game Engine · 10/04/2006 (8:33 pm) · 4 replies
I have my collision working on my object and I have simple gravity plus rebound physics working. What I need help with is when I allow the object to collide with its own type I get crash at this line of the collectGarbage function in convex.cc:
Any insights would be great.
Also, right now I can plop 50 objects into the sim and let them bounce. Just getting started, but my 100 object goal is starting to look like it might be doable with some rethinking of how to represent the physics.
for (Convex* itr = mNext; itr != this; itr = itr->mNext) {All I can think is that the object is colliding with itself somehow.Any insights would be great.
Also, right now I can plop 50 objects into the sim and let them bounce. Just getting started, but my 100 object goal is starting to look like it might be doable with some rethinking of how to represent the physics.
About the author
I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67
#2
It is the simple crap that kills you everytime!
10/06/2006 (12:31 pm)
Here is the cause. This code was missing from my object initialization call:mConvexList = new Convex;
It is the simple crap that kills you everytime!
#3
10/14/2006 (2:58 am)
You are talking to yourself you know :P
#4
10/14/2006 (10:14 am)
Yes, that way if someone else has the same problem they can search the forums and fix it quickly.
Torque Owner Demolishun
DemolishunConsulting Rocks!
#0 0x080653d5 in Convex::collectGarbage (this=0xcfcfcfcf) at collision/convex.cc:342 #1 0x08215adb in ObjectBase::buildConvex (this=0xb2860668, box=@0xbfeb4a60, convex=0xb74f2d7c) at game/objectBase.cc:628 #2 0x080657fe in Convex::updateWorkingList (this=0xb74f2d7c, box=@0xbfeb4a60, colMask=285433868) at collision/convex.cc:462 #3 0x082163d0 in ObjectBase::updateWorkingCollisionSet (this=0xb74f2a28, mask=285433868) at game/objectBase.cc:774 #4 0x08215d99 in ObjectBase::updateCollision (this=0xb74f2a28) at game/objectBase.cc:683 #5 0x0821f6d0 in TestObject::processTick (this=0xb74f2a28, move=0x0) at game/testObject.cc:130The "this" pointer in collectGarbage is now messed up somehow. This collision was from the same object type moved manually to touch the other object with no other influences such as forces. It also looks like the first object: this=0xb74f2a28 is talking to the convex object: this=0xb74f2d7c which asks the other object: this=0xb2860668 what its convex looks like.