#46297 - LOst? - Wed Jun 22, 2005 8:39 pm
I'm doing a pinball bumper. You know those things that shoot the pinball ball away (accelerating it of course to make it harder to control) and give you some score.
I have everything set for it. It detects the ball when it is inside the bumper's radius area.
My GBA game uses a Sine LUT with 256 as the maximum angle.
It's really simple. I just thake the angle of the ball and the bumper and and run it through the Sine LUT, multiply it for a speed effect.
But the main problem is getting the angle between the ball and the bumper.
I need help understanding how to make up a LUT angle table. Maybe an example formula to puch me into the right direction would be great.
The only thing I can think of is using ArcTan2. But I think this can be done with only ArcTan, or maybe just Tan?
What's the difference between ActTan2 and ArcTan?
Can you make a macro that converts ArcTan2 into ArcTan?
My main goal is to send in bumper_x - ball_x, and bumper_y - ball_y as arguments, and the return value will be the angle between 0 and 255.
How do I make a formula that can make up a LUT table with these angles? What will I use when I make up the LUT? ArcTan2, ArcTan, or Tan? And how do I convert the LUT so it uses the angles 0 to 255 instead of 0 to 360 or 0 to 2pi?
Thank you if you can help me, I would appreciate it :)
I have everything set for it. It detects the ball when it is inside the bumper's radius area.
My GBA game uses a Sine LUT with 256 as the maximum angle.
It's really simple. I just thake the angle of the ball and the bumper and and run it through the Sine LUT, multiply it for a speed effect.
But the main problem is getting the angle between the ball and the bumper.
I need help understanding how to make up a LUT angle table. Maybe an example formula to puch me into the right direction would be great.
The only thing I can think of is using ArcTan2. But I think this can be done with only ArcTan, or maybe just Tan?
What's the difference between ActTan2 and ArcTan?
Can you make a macro that converts ArcTan2 into ArcTan?
My main goal is to send in bumper_x - ball_x, and bumper_y - ball_y as arguments, and the return value will be the angle between 0 and 255.
How do I make a formula that can make up a LUT table with these angles? What will I use when I make up the LUT? ArcTan2, ArcTan, or Tan? And how do I convert the LUT so it uses the angles 0 to 255 instead of 0 to 360 or 0 to 2pi?
Thank you if you can help me, I would appreciate it :)