A tricky rotation question
Posted: Fri Feb 03, 2012 7:02 am
First of all Hi,
I am new in the community but have been using Chipmunk Physics for quite some time and I really like it.
I have kind of a math problem I guess (or a Trigonometry one) so here is the problem:
I got 2 bodies: a pineapple and a shuriken, upon collision of the two bodies they are merged into one the shuriken's body gets deleted and its shapes are built on the pineapples body.
So as you can see in the image below I store the last angle of the shuriken before it got deleted, and i have the angle of the pineapple which is constantly changes due to the simulation.
I want to know how can I rotate the shuriken by the amount that the pineapple is being rotated, to make it simpler think of it as if the shuriken is flying at the pineapple and when it hits it penetrates it and then rotates with the pineapple in sync.
Hope you guys can help me because I've looked at the documentation tried the rotation functions but couldn't get what I wanted.
so thanks in advance,
Anton.
I am new in the community but have been using Chipmunk Physics for quite some time and I really like it.
I have kind of a math problem I guess (or a Trigonometry one) so here is the problem:
I got 2 bodies: a pineapple and a shuriken, upon collision of the two bodies they are merged into one the shuriken's body gets deleted and its shapes are built on the pineapples body.
So as you can see in the image below I store the last angle of the shuriken before it got deleted, and i have the angle of the pineapple which is constantly changes due to the simulation.
I want to know how can I rotate the shuriken by the amount that the pineapple is being rotated, to make it simpler think of it as if the shuriken is flying at the pineapple and when it hits it penetrates it and then rotates with the pineapple in sync.
Hope you guys can help me because I've looked at the documentation tried the rotation functions but couldn't get what I wanted.
so thanks in advance,
Anton.