aligning a entity ot the normal of a collision

Blitz3D Forums/Blitz3D Programming/aligning a entity ot the normal of a collision

Craig H. Nisbet(Posted 2006) [#1]
I need to make an entity align with the polygon of the walls in my game for a bullet ricochet effect. I'm guessing I have to use the collision normal and align the mesh to that normal. Am I close? Any examples of how to do this?


t3K|Mac(Posted 2006) [#2]

------------------------------
This should do the job. at least it does for me ;)


DJWoodgate(Posted 2006) [#3]
A ricochet implies you might want the bullet to bounce off the wall at an angle incident to the angle of impact; a reflection. If so search for bouncing on these forums. Lots of applicable code.


Ross C(Posted 2006) [#4]
It shouldn't be too difficult to get the angle of the face it bounced of off, get the normal of the collision, then work out the resultant angle. As DJ says, there should be face normal code in the archives somewhere :o)