- Joined
- Jan 11, 2009
- Messages
- 3,414
I have a small problem regarding calculating a "bounce".
In order to calculate a reflection, you need to have a normal.
In order to get a normal, you need to know where the wall is. Like this: -|
Now, when i check for colission, i pick a point in front of the projectiles path, and checks if it's pathable. This gives me two points, the origin, and the destination. But in the event that i do collide, i dont know how the projectile should bounce, since all i have is a line between two points in space!
How do i know in wich direction the projectile should bounce?
And also, what is the best method for checking pathability?
In order to calculate a reflection, you need to have a normal.
In order to get a normal, you need to know where the wall is. Like this: -|
Now, when i check for colission, i pick a point in front of the projectiles path, and checks if it's pathable. This gives me two points, the origin, and the destination. But in the event that i do collide, i dont know how the projectile should bounce, since all i have is a line between two points in space!
How do i know in wich direction the projectile should bounce?
And also, what is the best method for checking pathability?