Triangle Collision Problem
by Wil Klentzeris · in Torque Game Builder · 11/10/2005 (8:23 pm) · 6 replies
I have a couple of collision areas on my tilemap that are triangular (3 polygon counts).
My problem is that my avatar goes right through the hypotenuse side of the triangle. Other tiles that have 4 and 5 polygon counts work fine.
Your suggestions please.
some support info:
- $player.setCollisionActive( true, true );
- $player.setCollisionPhysics(true, false);
- %layer.setCollisionActive(false, true);
My problem is that my avatar goes right through the hypotenuse side of the triangle. Other tiles that have 4 and 5 polygon counts work fine.
Your suggestions please.
some support info:
- $player.setCollisionActive( true, true );
- $player.setCollisionPhysics(true, false);
- %layer.setCollisionActive(false, true);
About the author
#2
Also, the 'enemy' avatar whose collision polygon is set to "%enemy.setCollisionPolyPrimitive(8);" seems to pop out even more than the player avatar.
Some additional information:
- gameplay is top-down
- the collision areas are setup to keep the avatar confined in the middle of a path
- the straight-aways work fine
- the path curves at a point and this is where the avatar pop's out
I am trying to use the collision active in the tile-map editor and the paramters listed above.
Other examples I have seen, side scrollers, use the oncollision function to identify when the avatar has collided with a tile.
I was hoping to use the tile-map settings and the above parameters to confine the avatar's.
11/21/2005 (8:48 pm)
I added a fourth vertex and the problem still remains.Also, the 'enemy' avatar whose collision polygon is set to "%enemy.setCollisionPolyPrimitive(8);" seems to pop out even more than the player avatar.
Some additional information:
- gameplay is top-down
- the collision areas are setup to keep the avatar confined in the middle of a path
- the straight-aways work fine
- the path curves at a point and this is where the avatar pop's out
I am trying to use the collision active in the tile-map editor and the paramters listed above.
Other examples I have seen, side scrollers, use the oncollision function to identify when the avatar has collided with a tile.
I was hoping to use the tile-map settings and the above parameters to confine the avatar's.
#3
So it appears that the tile / avatar size ratio impacts the effectiveness of the collision engine.
12/14/2005 (6:49 pm)
I figured out my problem. My tiles were 2 times larger than my avatar. When I made the avatar larger and the tiles smaller the collision worked.So it appears that the tile / avatar size ratio impacts the effectiveness of the collision engine.
#4
- Melv.
12/17/2005 (10:17 am)
Hmm, interesting. I've not come across that problem but if you have any code you could supply that's not too big, I'd be interested in having a look to try to fix the problem.- Melv.
#5
I played with the Platform Game in the T2D TDN.
I made a modification to the player size from "20 20" to "1 1" in the player.cs file, in the resetPlayer function.
If you mave the player to the left and go down the slope, he falls into the sloped region and becomes trapped.
Thanks for taking a look into this.
12/20/2005 (6:59 pm)
Melv:I played with the Platform Game in the T2D TDN.
I made a modification to the player size from "20 20" to "1 1" in the player.cs file, in the resetPlayer function.
If you mave the player to the left and go down the slope, he falls into the sloped region and becomes trapped.
Thanks for taking a look into this.
#6
Thanks again,
- Melv.
12/21/2005 (3:15 am)
Okay, I've posted an issue on our database (#994) for this. I'll investigate it as soon as I get to it.Thanks again,
- Melv.
Torque Owner Jake Vinson