From d84f64c2c3b0d8b7e799fbcc0d64777fbba343d5 Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Fri, 19 Dec 2025 16:34:11 +0000 Subject: [PATCH] Fix wheel joint steering axis --- engine/Sandbox.Engine/Scene/Components/Joint/WheelJoint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/Sandbox.Engine/Scene/Components/Joint/WheelJoint.cs b/engine/Sandbox.Engine/Scene/Components/Joint/WheelJoint.cs index ed07067e..7abb26a8 100644 --- a/engine/Sandbox.Engine/Scene/Components/Joint/WheelJoint.cs +++ b/engine/Sandbox.Engine/Scene/Components/Joint/WheelJoint.cs @@ -347,11 +347,11 @@ public sealed class WheelJoint : Joint { localFrame1 = global::Transform.Zero; localFrame1.Position = point1.LocalPosition; - localFrame1.Rotation = point1.LocalRotation * new Angles( 90, 0, 0 ); + localFrame1.Rotation = point1.LocalRotation * new Angles( 90, 0, 0 ) * new Angles( 0, 90, 0 ); // face the right way, steer the right way localFrame2 = global::Transform.Zero; localFrame2.Position = point2.Body.Transform.PointToLocal( point1.Transform.Position ); - localFrame2.Rotation = point2.Body.Transform.RotationToLocal( point1.Transform.Rotation * new Angles( 90, 0, 0 ) ); + localFrame2.Rotation = point2.Body.Transform.RotationToLocal( point1.Transform.Rotation * new Angles( 90, 0, 0 ) * new Angles( 0, 90, 0 ) ); // face the right way, steer the right way } if ( !Scene.IsEditor )