physics.box2d.object: Fix bug in 'b2d_Object_Spin_is()'.

This commit is contained in:
Rod Kay
2023-11-07 19:41:01 +11:00
parent cad7a9f3bc
commit 7630a775b5

View File

@@ -219,17 +219,17 @@ void
b2d_Object_Spin_is (Object* Self, b2d_Object_Spin_is (Object* Self,
Matrix_3x3* Now) Matrix_3x3* Now)
{ {
b2Vec2 Pos = b2Vec2 (Now->m20, Now->m21); float Angle = atan2 (Now->m10, Now->m00);
float Angle = atan2 (Now->m10, Now->m00);
if (Self->body) if (Self->body)
{ {
b2Vec2 Pos = Self->body->GetPosition();
Self->body->SetTransform (Pos, Angle); Self->body->SetTransform (Pos, Angle);
} }
else else
{ {
Self->bodyDef.position = Pos; Self->bodyDef.angle = Angle;
Self->bodyDef.angle = Angle;
} }
} }