Tiles other than square?
by Matt Van Gorkom · in Torque Game Builder · 02/28/2005 (7:04 pm) · 3 replies
Just got T2D tonight :D
Can T2D handle tiles that are curved? For example if I wanted to make ramps and have a ball roll down them. I assume so, but just wondering if it's built in or if coding's needed.
Can T2D handle tiles that are curved? For example if I wanted to make ramps and have a ball roll down them. I assume so, but just wondering if it's built in or if coding's needed.
#2
So yes, you can do this now with no additional C++ coding. It's not the tiles that define the curvature, it's the collision polygon and the "limitation" here is that all collision polygons have to be convex but this goes for lots of engines anyway. Decomposing concave polygons can be slow although we'll be looking at schemes to do this in the later milestones.
As an example, setup a tile-layer, put in some tiles and select each tile to have something like the lower-left triangle collision polygon. When an object hits this, the rigid-physics will make the object roll down the ramp (or up depending on the forces on the object).
Don't forget as well that you can add your own collision-polygon definitions into the tile-editor pretty easily. Just look for the descriptions for the prefab collision-polys in the tile-editor and add your own.
- Melv.
03/01/2005 (12:47 am)
Drew, maybe that was an older plan but I did add the ability to define primitive and custom collision polygons to tiles, per-tile now, exactly as you can all the other objects. :)So yes, you can do this now with no additional C++ coding. It's not the tiles that define the curvature, it's the collision polygon and the "limitation" here is that all collision polygons have to be convex but this goes for lots of engines anyway. Decomposing concave polygons can be slow although we'll be looking at schemes to do this in the later milestones.
As an example, setup a tile-layer, put in some tiles and select each tile to have something like the lower-left triangle collision polygon. When an object hits this, the rigid-physics will make the object roll down the ramp (or up depending on the forces on the object).
Don't forget as well that you can add your own collision-polygon definitions into the tile-editor pretty easily. Just look for the descriptions for the prefab collision-polys in the tile-editor and add your own.
- Melv.
#3
03/01/2005 (5:06 am)
Cool. Thanks Melv. That's something like what I was hoping for.
Torque Owner Drew -Gaiiden- Sikora