-
Hello,
I am trying to find out how to get opposite trajectory angle to a randomly flying object (ball?).
Bascially when an object hits the wall of a movie, then I want to get the opposite angle to fire the ball back in the opposite direction.
Thanks,
PC
-
You could do this:
keep track of the object's last known position. From this, use the built-in math functions to get your angle. The math functions return either degrees or radians, so read the documentation to find out which functions to use.
ex:
to calculate incident angle, use
if hitting top wall: Math.arctan(change_in_y / change_in_x)
-
Gross Pecululatarian
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|