Skip to content
Permalink
Browse files

[Physics] Renamed NewShapeFromDesc to CreateShape

  • Loading branch information
xen2 committed Jun 22, 2019
1 parent 05421ae commit d65a7f20d60555a05d42be418f9fbea10e2ce63d
@@ -42,7 +42,7 @@ public bool Match(object obj)
return other?.Is2D == Is2D && other.Size == Size && other.LocalOffset == LocalOffset && other.LocalRotation == LocalRotation;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new BoxColliderShape(Is2D, Size) { LocalOffset = LocalOffset, LocalRotation = LocalRotation };
}
@@ -65,7 +65,7 @@ public bool Match(object obj)
other.LocalRotation == LocalRotation;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new CapsuleColliderShape(Is2D, Radius, Length, Orientation) { LocalOffset = LocalOffset, LocalRotation = LocalRotation };
}
@@ -40,7 +40,7 @@ public bool Match(object obj)
return other.Shape == Shape;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
if (Shape == null)
{
@@ -59,7 +59,7 @@ public bool Match(object obj)
other.LocalRotation == LocalRotation;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new ConeColliderShape(Height, Radius, Orientation) { LocalOffset = LocalOffset, LocalRotation = LocalRotation };
}
@@ -70,7 +70,7 @@ public bool Match(object obj)
other.Decomposition.Match(Decomposition);
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
if (ConvexHulls == null) return null;
ColliderShape shape;
@@ -60,7 +60,7 @@ public bool Match(object obj)
other.LocalRotation == LocalRotation;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new CylinderColliderShape(Height, Radius, Orientation) { LocalOffset = LocalOffset, LocalRotation = LocalRotation };
}
@@ -8,7 +8,7 @@ namespace Xenko.Physics
public interface IColliderShapeDesc
{
bool Match(object obj);
ColliderShape NewShapeFromDesc();
ColliderShape CreateShape();
}

public interface IAssetColliderShapeDesc : IColliderShapeDesc
@@ -39,7 +39,7 @@ public bool Match(object obj)
return other?.Is2D == Is2D && Math.Abs(other.Radius - Radius) < float.Epsilon && other.LocalOffset == LocalOffset;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new SphereColliderShape(Is2D, Radius) { LocalOffset = LocalOffset };
}
@@ -32,7 +32,7 @@ public bool Match(object obj)
return other.Normal == Normal && Math.Abs(other.Offset - Offset) < float.Epsilon;
}

public ColliderShape NewShapeFromDesc()
public ColliderShape CreateShape()
{
return new StaticPlaneColliderShape(Normal, Offset);
}
@@ -83,7 +83,7 @@ internal static ColliderShape CreateShape(IColliderShapeDesc desc)
if (desc == null)
return null;

ColliderShape shape = desc.NewShapeFromDesc();
ColliderShape shape = desc.CreateShape();

if (shape == null) return null;

0 comments on commit d65a7f2

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