-
After doing a step, I am trying to send the vertices of a polygon body to a client and render them there. Its a simple convex polygon falling on a plane. The body is rendered and I can see it falling after a few steps, but it's not rotating. Even if I set an angle of 0.8 when creating the body, it is still rendered as if angle=0. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I should have examined the examples. The box example shows how it's done with ie Pixi:
So I have to send the angle to the client-side renderer as well, the polygon vertices appear to have an initial position with angle=0 and never change. The client renders this initial polygon and rotates it afterwards. |
Beta Was this translation helpful? Give feedback.
I should have examined the examples. The box example shows how it's done with ie Pixi:
So I have to send the angle to the client-side renderer as well, the polygon vertices appear to have an initial position with angle=0 and never change. The client renders this initial polygon and rotates it afterwards.
That makes me wonder: In order to calculate collisions and impacts, p2 needs to do a new rotation calculation for each body on each step, no? Then it seems to calculate a new angle and writes this new angle in the bo…