Collision RunAway
by Demolishun · in Torque Game Engine · 10/07/2006 (9:40 pm) · 2 replies
Okay, I have built up an object that uses collision from the vehicle code and shapebase. What I do not understand is why the collision goes nuts when I put two of my objects together, but remains calm and realistic when mixed with the wheeledvehicle. If I put my object next to another of my object this is what the profiler shows:
GCI is getCollisionInfo and FCS is findClosestState. I just ripped these functions right out of the vehicle and shapebase code.
44.570 0.100 179 ClientProcess 44.469 0.100 179 AdvanceClientTime 44.261 2.047 334 AdvanceObjects 29.171 7.384 668 GCI 8.865 8.865 185881 GETFEATURES 5.285 5.285 1115286 MemoryAlloc 4.753 4.753 1115286 MemoryFree 2.885 2.885 185881 COLLIDE 12.749 12.740 668 FCS 0.008 0.008 1221 MemoryAlloc 0.000 0.000 1 MemoryFree 0.246 0.246 3648 ContainerCastRay 0.025 0.025 1002 SceneGraph_rezoneObject 0.019 0.019 2139 MemoryAlloc 0.005 0.005 914 MemoryFree 0.108 0.108 1611 ContainerCastRay 0.000 0.000 1 MemoryRealloc 0.000 0.000 1 MemoryFree 0.000 0.000 1 MemoryAlloc 0.001 0.001 39 ContainerCastRay 0.000 0.000 7 MemoryAlloc 0.000 0.000 7 MemoryFree 44.490 0.004 179 ServerProcess 44.486 0.022 179 AdvanceServerTime 44.464 2.356 334 AdvanceObjects 29.088 7.342 668 GCI 8.912 8.912 184601 GETFEATURES 5.274 5.274 1107606 MemoryAlloc 4.788 4.788 1107606 MemoryFree 2.773 2.773 184601 COLLIDE 12.614 12.605 668 FCS 0.009 0.009 1219 MemoryAlloc 0.000 0.000 1 MemoryFree 0.355 0.355 5344 ContainerCastRay 0.027 0.027 1002 SceneGraph_rezoneObject 0.018 0.018 2226 MemoryAlloc 0.006 0.006 1005 MemoryFree
GCI is getCollisionInfo and FCS is findClosestState. I just ripped these functions right out of the vehicle and shapebase code.
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
10/08/2006 (8:18 pm)
Okay, this one is really strange. If you do not put your new convex type into the mType of your new object all hell breaks loose when you start colliding with an object of that type if you are that type. Really strange and bizzare, but if you find yourself in that position then this was the fix. Yet another example of forgetting to intialize one of hundreds of variables. : ) Collision is actually pretty quick when you implement it right.
Torque Owner Demolishun
DemolishunConsulting Rocks!
Here is how it goes with my object inside a wheeledvehicle object:
What I don't get is why it would just go nuts. I am guessing the CollisionStateList is just getting huge and never clears any collision states off the list. I just don't understand why it would get so huge with nearly identical code inside the wheeled vehicle code. My object just won't play nice with itself. Maybe it has a self loathing issue. : )