Skip to content
Permalink
Browse files

[Physics] Fix initial collider scaling

  • Loading branch information
Eideren committed May 11, 2019
1 parent b6c9191 commit 83c971ce17f037311f51c667f9764d7418b065a2
@@ -68,7 +68,7 @@ public virtual void UpdateLocalTransformations()
/// </value>
public Matrix NegativeCenterMatrix;

protected Vector3 cachedScaling;
protected Vector3 cachedScaling = Vector3.One;

/// <summary>
/// Gets or sets the scaling.
@@ -646,13 +646,6 @@ public void ComposeShape()
}

ColliderShape = PhysicsColliderShape.CreateShape(ColliderShapes[0]);

if (ColliderShape != null)
{
ColliderShape.Scaling = Vector3.One;
}

//ColliderShape?.UpdateLocalTransformations();
}
else if (ColliderShapes.Count > 1) //need a compound shape in this case
{
@@ -673,10 +666,12 @@ public void ComposeShape()
}

ColliderShape = compound;
}

ColliderShape.Scaling = Vector3.One;

//ColliderShape.UpdateLocalTransformations();
if (ColliderShape != null)
{
// Force update internal shape and gizmo scaling
ColliderShape.Scaling = ColliderShape.Scaling;
}
}

0 comments on commit 83c971c

Please sign in to comment.
You can’t perform that action at this time.