Fix Model apply timeline (rot before pos)

This commit is contained in:
Tim
2025-07-20 14:29:30 +02:00
parent 9e0d5a7b12
commit 684f466c94
3 changed files with 4 additions and 4 deletions

View File

@@ -103,8 +103,8 @@ public class ModelBehaviour : MonoBehaviour, IResettable
if (Model != null)
{
Debug.Log($"UpdateModel: Model {name} reset old {Model} offsets.");
transform.localPosition -= Model.Offset;
transform.localRotation *= Quaternion.Inverse(Model.Rotation);
transform.localPosition -= Model.Offset;
transform.localScale -= Model.Scale;
}

View File

@@ -22,8 +22,8 @@ public class Port
public void Apply(Transform target)
{
//Debug.Log($"Applying port {target.gameObject.name} pos {target.localPosition} {target.localRotation} {target.localScale}");
target.localPosition += _position;
target.localRotation *= _rotation;
target.localPosition += _position;
target.localScale *= _scale;
//Debug.Log($"applied port {target.gameObject.name} pos {target.localPosition} {target.localRotation} {target.localScale}");
}
@@ -31,8 +31,8 @@ public class Port
public void Unapply(Transform target)
{
Debug.Log($"Unapplying port {target.gameObject.name} pos {target.localPosition} {target.localRotation} {target.localScale}");
target.localPosition -= _position;
target.localRotation *= Quaternion.Inverse(_rotation);
target.localPosition -= _position;
target.localScale /= _scale;
Debug.Log($"unapplied port {target.gameObject.name} pos {target.localPosition} {target.localRotation} {target.localScale}");
}

View File

@@ -112,7 +112,7 @@ public class PortDef
public const string ERL_LP_TC = "erlLPpickableu";
public const string ERL_LP_TEXT = "erlLPText89";
public const string ERL_LP_COUNTRY = "erlLPCountry90";
public const string ERL_GRILL = "portErlbach91";
public const string ERL_GRILL = "erlGrill";
public const string ERL_DRL_OUTLINE = "erlDRLoutline"; //Daytime running lights
public const string ERL_DRL_PLATE = "erlDRLplate";
public const string ERL_WINDOW = "erlWindow";