2

You still handle it in the usual way. Make 3 perpendicular unit vectors (an orthonormal basis), expressing the directions your object's local axes should point after rotation: // Forward Y = forwardHeading; // Right X = Normalize(Cross(Y, (0, 0, 1)); // Up Z = Cross(X,Y); And then use these three vectors as the columns of a matrix: $$\vec {\text{rotated}} ...


1

When I gave a gizmo to my parent object, I saw that the gizmo wasn't in the center of my parent object. So the character is turning, but instead of rotating on its own axis, it rotates around the gizmo. I simply moved all the children to the center of my parent object (right in the middle of the gizmo) and the problem was solved.


1

Your update method accelerates the rocket along the direction of its velocity vector (as returned by body_->GetLinearVelocity) but it should accelerate it along the direction it's facing. Currently, there's nothing in the update method that can change the rocket's velocity vector orientation. Box2D allows you to get the current world angle of your body ...


Only top voted, non community-wiki answers of a minimum length are eligible