Table of Contents

Struct CompoundColliderPart2D

Namespace
Gravitas.Colliders
Assembly
Gravitas.dll

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

shape ColliderShapeDefinition2D

CompoundColliderPart2D(ColliderShapeDefinition2D, Vector2d)

Creates a part with a compound-local offset.

public CompoundColliderPart2D(ColliderShapeDefinition2D shape, Vector2d localOffset)

Parameters

shape ColliderShapeDefinition2D
localOffset Vector2d

CompoundColliderPart2D(ColliderShapeDefinition2D, Vector2d, Fixed64)

Creates a part with a compound-local pose.

public CompoundColliderPart2D(ColliderShapeDefinition2D shape, Vector2d localOffset, Fixed64 localRotation)

Parameters

shape ColliderShapeDefinition2D
localOffset Vector2d
localRotation Fixed64

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

shape ColliderShapeDefinition2D
localOffset Vector2d
localRotation Fixed64
localScale Vector2d
material PhysicsMaterial?

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

PhysicsMaterial

Shape

Gets the authored data-only shape definition for this part.

public ColliderShapeDefinition2D Shape { get; }

Property Value

ColliderShapeDefinition2D

Methods

AABBox(Vector2d, Vector2d)

Creates an axis-aligned box part.

public static CompoundColliderPart2D AABBox(Vector2d size, Vector2d localOffset)

Parameters

size Vector2d
localOffset Vector2d

Returns

CompoundColliderPart2D

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

size Vector2d
localOffset Vector2d
localRotation Fixed64
localScale Vector2d

Returns

CompoundColliderPart2D

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

size Vector2d
localOffset Vector2d
material PhysicsMaterial

Returns

CompoundColliderPart2D

Capsule(Fixed64, Fixed64, Vector2d)

Creates a capsule part.

public static CompoundColliderPart2D Capsule(Fixed64 radius, Fixed64 height, Vector2d localOffset)

Parameters

radius Fixed64
height Fixed64
localOffset Vector2d

Returns

CompoundColliderPart2D

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

radius Fixed64
height Fixed64
localOffset Vector2d
localRotation Fixed64
localScale Vector2d

Returns

CompoundColliderPart2D

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

radius Fixed64
height Fixed64
localOffset Vector2d
material PhysicsMaterial

Returns

CompoundColliderPart2D

Circle(Fixed64, Vector2d)

Creates a circle part.

public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset)

Parameters

radius Fixed64
localOffset Vector2d

Returns

CompoundColliderPart2D

Circle(Fixed64, Vector2d, Fixed64, Vector2d)

Creates a transformed circle part.

public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)

Parameters

radius Fixed64
localOffset Vector2d
localRotation Fixed64
localScale Vector2d

Returns

CompoundColliderPart2D

Circle(Fixed64, Vector2d, PhysicsMaterial)

Creates a circle part with a material override.

public static CompoundColliderPart2D Circle(Fixed64 radius, Vector2d localOffset, PhysicsMaterial material)

Parameters

radius Fixed64
localOffset Vector2d
material PhysicsMaterial

Returns

CompoundColliderPart2D

ConvexPolygon(Vector2d[], Vector2d)

Creates a convex-polygon part.

public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset)

Parameters

vertices Vector2d[]
localOffset Vector2d

Returns

CompoundColliderPart2D

ConvexPolygon(Vector2d[], Vector2d, Fixed64, Vector2d)

Creates a transformed convex-polygon part.

public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset, Fixed64 localRotation, Vector2d localScale)

Parameters

vertices Vector2d[]
localOffset Vector2d
localRotation Fixed64
localScale Vector2d

Returns

CompoundColliderPart2D

ConvexPolygon(Vector2d[], Vector2d, PhysicsMaterial)

Creates a convex-polygon part with a material override.

public static CompoundColliderPart2D ConvexPolygon(Vector2d[] vertices, Vector2d localOffset, PhysicsMaterial material)

Parameters

vertices Vector2d[]
localOffset Vector2d
material PhysicsMaterial

Returns

CompoundColliderPart2D