theotherguy
Newbie
- Joined
- Jul 5, 2003
- Messages
- 5,107
- Reaction score
- 1
Yep, in the Vector class. I'm using another library right now which has other vector operations, and I'm using a class called Vector2f which has these operations on a vector with floats as its subunits.
EDIT: Question, how do I find L and Lhat without knowing I? Should I derive Lhat by normalizing the current laser, before I make it shorter?
Trying out teta_bonita's solution with the assumption that L is actually the length of the laser before the collision, and that Lhat is this vector normalized, I got pretty much exactly the same results as I did with Dan's solution.
Depending on the angle I'm at, the laser will either fire to a point in space which is visible but nowhere near the edge of the circle, will fire to the opposite edge of the circle, or will fire at a random point in distant space.