Differentiating between Horizontal and Vertical Surfaces...
by Clark Kromenaker · in Torque Game Engine · 04/02/2006 (11:54 am) · 2 replies
Hi,
I'm using some code that lets the user click and the character moves to said position. However, when the user clicks on a wall or other vertical surface, the character will run straight into the wall. So, I was wondering if it's possible to check whether a clicked surface is horizontal or vertical so I can weed out the clicks on walls.
I'm using some code that lets the user click and the character moves to said position. However, when the user clicks on a wall or other vertical surface, the character will run straight into the wall. So, I was wondering if it's possible to check whether a clicked surface is horizontal or vertical so I can weed out the clicks on walls.
Associate Orion Elenzil
Real Life Plus
just look at the Z component of the normal.
if it's one, the surface is horizontal.
if it's zero, the surface is vertical.
somewhere in between will be some threshhold you can use.
eg