start of rotation
Hi there,
I was just wondering if any of you mathematicians could help me. In my game when the gal collides with an actor, it rotates around the actor. The problem is is that it doesn't start rotating from the point of collision. This is the rotating equation I am using: constrain x to 58*cos( self.Time *-200%360)+ game.p1 x.
Can anyone help me have it rotate around the actor from the collision point?
Thanks
Best Answers
-
Socks London, UK.Posts: 12,822
@GamesforGood said:
Hi there,
I was just wondering if any of you mathematicians could help me. In my game when the gal collides with an actor, it rotates around the actor. The problem is is that it doesn't start rotating from the point of collision. This is the rotating equation I am using: constrain x to 58*cos( self.Time *-200%360)+ game.p1 x.
Can anyone help me have it rotate around the actor from the collision point?
ThanksFirstly, there is no need for the %360 bit . . . . as for starting the collision at the point of impact just add in the angle of collision (AOC) here . . .
Constrain x to 58*cos((self.Time *-200)+AOC)+ game.p1 x Constrain y to 58*sin((self.Time *-200)+AOC)+ game.p1 y
The angle of collision can be calculated with vector to angle.
P.S. instead of using -200 to make the rotation clockwise, you can also just swap sin and cos . . . .
Constrain x to 58*sin((self.Time *200)+AOC)+ game.p1 x Constrain y to 58*cos((self.Time *200)+AOC)+ game.p1 y
-
Socks London, UK.Posts: 12,822
Demo:
https://www.mediafire.com/?tue5m94ub886791
Click on the screen to generate a 'gal' (I don't know what a gal is !!).
Answers
Once again my mind is blown by your mathematics. Just wait until I release my mad geometry skills though...
It's pretty basic stuff you could learn in an hour.