Game Development Community

Beta4 bug: (fixed) Level Builder creates Collision Poly convex

by Alex Rice · in Torque Game Builder · 05/31/2006 (9:03 am) · 5 replies

Use the Level Builder to add a collision polygon to a sprite. The editor won't save the polygon unless there are at least 4 nodes. I discovered this because I have a triangular sprite (3 nodes would be sufficient for the collision poly).

[Edit - this is Bug #1 of 2 ]

#1
05/31/2006 (9:11 am)
Level Builder also seems to be having trouble saving & re-loading collision polygons in general. Sorry I don't have time to post a recipe for this bug now.
#2
05/31/2006 (9:23 am)
[Edit - this is Bug #2 of 2]

The Level Builder is allowing creation of non-convex polygons. Here is a polygon string created with the level builder.
Quote:CollisionPolyList = "0.00 -0.86 0.56 0.05 0.97 0.79 0.02 0.79 -0.96 0.79 -0.47 -0.04";
Here is the console output next time the level is loaded:
Quote:Compiling MLEggs/data/levels/L1.t2d...
Loading compiled script MLEggs/data/levels/L1.t2d.
t2dPhysics::setCollisionPolyCustom() - Polygon is not convex! Defaulting to Quad! ()
t2dPhysics::setCollisionPolyCustom() - Polygon is not convex! Defaulting to Quad! ()
t2dPhysics::setCollisionPolyCustom() - Polygon is not convex! Defaulting to Quad! ()
t2dPhysics::setCollisionPolyCustom() - Polygon is not convex! Defaulting to Quad! ()
t2dPhysics::setCollisionPolyCustom() - Polygon is not convex! Defaulting to Quad! ()

I am changing the title of this thread to reflect this.
#3
05/31/2006 (9:25 am)
I am simply trying to circumscribe a triangular sprite. I think this must be a rounding problem in the engine where the LevelBuilder isn't saving with enough accuracy.
#4
05/31/2006 (9:38 am)
Also I added some nodes around the triangle so it appeared obviously convex, and re-saved the problem went away.
#5
06/01/2006 (6:40 am)
Seems to be fixed in RC1