Collisions and Convexes
by Ryan Mounts · in Torque 3D Professional · 09/09/2009 (2:20 pm) · 2 replies
I'm wondering if someone can shed some light on the collision system for me. I've extended the MeshRoad tool to create some extra procedural geometry in addition to the basic road. I can render the geometry just fine, but I can't seem to get the collisions to work. In MeshRoad::buildConvex, I am creating a MeshRoadConvex for each of my new triangles in the same fashion as the original code (same winding order, etc.). In MeshRoad::buildSegmentPolyList, I am adding my new verts and planes in the same fashion as the original code. When Player Collision visibility is turned on ingame, I can see my MeshRoadConvexes displayed where they should be when I'm near the MeshRoad. While debugging, I can see that my new MeshRoadConvexes are in the player's WorkingList of nearby convexes as I approach the MeshRoad ingame. But in the end, the player only collides with the original MeshRoad geometry and totally ignores my new geometry. So apparently I'm missing soming here, and maybe someone can quickly spot where I'm going wrong. Thanks in advance!
#2
09/10/2009 (3:55 pm)
Got it all working now... projectiles and the camera use raycasts instead of convexes to do collision tests (duh), so I just needed to update MeshRoad::castRay().
Torque Owner Ryan Mounts
CornerstoneViz