Struct CompoundColliderPart2D
Declares one data-only geometry part owned by an LSCompoundCollider2D.
public readonly struct CompoundColliderPart2D
- Inherited Members
Constructors
CompoundColliderPart2D(ColliderShapeDefinition2D)
Creates a part from an authored pure 2D shape.
public CompoundColliderPart2D(ColliderShapeDefinition2D shape)
Parameters
CompoundColliderPart2D(ColliderShapeDefinition2D, Vector2d)
Creates a part with a compound-local offset.
public CompoundColliderPart2D(ColliderShapeDefinition2D shape, Vector2d localOffset)
Parameters
shapeColliderShapeDefinition2DlocalOffsetVector2d
CompoundColliderPart2D(ColliderShapeDefinition2D, Vector2d, Fixed64)
Creates a part with a compound-local pose.
public CompoundColliderPart2D(ColliderShapeDefinition2D shape, Vector2d localOffset, Fixed64 localRotation)
Parameters
shapeColliderShapeDefinition2DlocalOffsetVector2dlocalRotationFixed64
CompoundColliderPart2D(ColliderShapeDefinition2D, Vector2d, Fixed64, Vector2d, PhysicsMaterial?)
Creates a part with a compound-local transform and optional material override.
public CompoundColliderPart2D(ColliderShapeDefinition2D shape, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale, PhysicsMaterial? material = null)
Parameters
shapeColliderShapeDefinition2DlocalOffsetVector2dlocalRotationFixed64localScaleVector2dmaterialPhysicsMaterial?
Properties
LocalOffset
Gets the deterministic local center offset applied relative to the owning compound collider.
public Vector2d LocalOffset { get; }
Property Value
- Vector2d
LocalRotation
Gets the deterministic local rotation applied relative to the owning compound collider.
public Fixed64 LocalRotation { get; }
Property Value
- Fixed64
LocalScale
Gets the deterministic local scale applied relative to the owning compound collider.
public Vector2d LocalScale { get; }
Property Value
- Vector2d
Material
Gets the authored material for this 2D part, or the shape/default material when no part-level material was supplied.
public PhysicsMaterial Material { get; }
Property Value
Shape
Gets the authored data-only shape definition for this part.
public ColliderShapeDefinition2D Shape { get; }
Property Value
Methods
AABBox(Vector2d, Vector2d)
Creates an axis-aligned box part.
public static CompoundColliderPart2D AABBox(Vector2d size, Vector2d localOffset)
Parameters
sizeVector2dlocalOffsetVector2d
Returns
AABBox(Vector2d, Vector2d, Fixed64, Vector2d)
Creates a transformed axis-aligned box part.
public static CompoundColliderPart2D AABBox(Vector2d size, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)
Parameters
sizeVector2dlocalOffsetVector2dlocalRotationFixed64localScaleVector2d
Returns
AABBox(Vector2d, Vector2d, PhysicsMaterial)
Creates an axis-aligned box part with a material override.
public static CompoundColliderPart2D AABBox(Vector2d size, Vector2d localOffset, PhysicsMaterial material)
Parameters
sizeVector2dlocalOffsetVector2dmaterialPhysicsMaterial
Returns
Capsule(Fixed64, Fixed64, Vector2d)
Creates a capsule part.
public static CompoundColliderPart2D Capsule(Fixed64 radius, Fixed64 height, Vector2d localOffset)
Parameters
radiusFixed64heightFixed64localOffsetVector2d
Returns
Capsule(Fixed64, Fixed64, Vector2d, Fixed64, Vector2d)
Creates a transformed capsule part.
public static CompoundColliderPart2D Capsule(Fixed64 radius, Fixed64 height, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)
Parameters
radiusFixed64heightFixed64localOffsetVector2dlocalRotationFixed64localScaleVector2d
Returns
Capsule(Fixed64, Fixed64, Vector2d, PhysicsMaterial)
Creates a capsule part with a material override.
public static CompoundColliderPart2D Capsule(Fixed64 radius, Fixed64 height, Vector2d localOffset, PhysicsMaterial material)
Parameters
radiusFixed64heightFixed64localOffsetVector2dmaterialPhysicsMaterial
Returns
Circle(Fixed64, Vector2d)
Creates a circle part.
public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset)
Parameters
radiusFixed64localOffsetVector2d
Returns
Circle(Fixed64, Vector2d, Fixed64, Vector2d)
Creates a transformed circle part.
public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)
Parameters
radiusFixed64localOffsetVector2dlocalRotationFixed64localScaleVector2d
Returns
Circle(Fixed64, Vector2d, PhysicsMaterial)
Creates a circle part with a material override.
public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset, PhysicsMaterial material)
Parameters
radiusFixed64localOffsetVector2dmaterialPhysicsMaterial
Returns
ConvexPolygon(Vector2d[], Vector2d)
Creates a convex-polygon part.
public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset)
Parameters
verticesVector2d[]localOffsetVector2d
Returns
ConvexPolygon(Vector2d[], Vector2d, Fixed64, Vector2d)
Creates a transformed convex-polygon part.
public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)
Parameters
verticesVector2d[]localOffsetVector2dlocalRotationFixed64localScaleVector2d
Returns
ConvexPolygon(Vector2d[], Vector2d, PhysicsMaterial)
Creates a convex-polygon part with a material override.
public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset, PhysicsMaterial material)
Parameters
verticesVector2d[]localOffsetVector2dmaterialPhysicsMaterial