Struct ColliderShapeDefinition
Describes authoritative collider shape input without runtime collider lifecycle state such as IDs, bodies, partitions, pairs, or events.
public readonly struct ColliderShapeDefinition : IEquatable<ColliderShapeDefinition>
- Implements
- Inherited Members
Properties
Height
Gets the unscaled height used by capsule and finite-cylinder shapes.
public Fixed64 Height { get; }
Property Value
- Fixed64
Kind
Gets the shape family represented by this definition.
public ColliderShapeDefinitionKind Kind { get; }
Property Value
Material
Gets the authored surface material used when this definition creates a runtime collider directly.
public PhysicsMaterial Material { get; }
Property Value
MeshInertiaPolicy
Gets the inertia policy used when this definition represents a convex mesh.
public MeshInertiaPolicy MeshInertiaPolicy { get; }
Property Value
MeshTriangleIndexCount
Gets the number of triangle indices held by a convex mesh definition.
public int MeshTriangleIndexCount { get; }
Property Value
MeshVertexCount
Gets the number of local mesh vertices held by a convex mesh definition.
public int MeshVertexCount { get; }
Property Value
Radius
Gets the unscaled radius used by radius-based shapes.
public Fixed64 Radius { get; }
Property Value
- Fixed64
Size
Gets the unscaled size used by sized shapes. Radius-based definitions store their normalized runtime size here as well.
public Vector3d Size { get; }
Property Value
- Vector3d
Methods
Capsule(Fixed64, Fixed64, PhysicsMaterial?)
Creates a capsule shape definition.
public static ColliderShapeDefinition Capsule(Fixed64 radius, Fixed64 height, PhysicsMaterial? material = null)
Parameters
radiusFixed64heightFixed64materialPhysicsMaterial?
Returns
Cone(Fixed64, Fixed64, PhysicsMaterial?)
Creates a finite circular cone shape definition whose local origin is the bounding center between its base plane and apex.
public static ColliderShapeDefinition Cone(Fixed64 radius, Fixed64 height, PhysicsMaterial? material = null)
Parameters
radiusFixed64heightFixed64materialPhysicsMaterial?
Returns
ConvexMesh(Vector3d[], int[], MeshInertiaPolicy, PhysicsMaterial?)
Creates a convex mesh shape definition.
public static ColliderShapeDefinition ConvexMesh(Vector3d[] vertices, int[] triangles, MeshInertiaPolicy inertiaPolicy = MeshInertiaPolicy.RequireClosedVolume, PhysicsMaterial? material = null)
Parameters
verticesVector3d[]trianglesint[]inertiaPolicyMeshInertiaPolicymaterialPhysicsMaterial?
Returns
CreateCollider()
Creates a new unbound runtime collider from this shape definition.
public LSCollider CreateCollider()
Returns
Cuboid(Vector3d, PhysicsMaterial?)
Creates a cuboid shape definition.
public static ColliderShapeDefinition Cuboid(Vector3d size, PhysicsMaterial? material = null)
Parameters
sizeVector3dmaterialPhysicsMaterial?
Returns
Cylinder(Fixed64, Fixed64, PhysicsMaterial?)
Creates a finite-cylinder shape definition.
public static ColliderShapeDefinition Cylinder(Fixed64 radius, Fixed64 height, PhysicsMaterial? material = null)
Parameters
radiusFixed64heightFixed64materialPhysicsMaterial?
Returns
Equals(ColliderShapeDefinition)
public bool Equals(ColliderShapeDefinition other)
Parameters
otherColliderShapeDefinition
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
GetMeshTriangleIndex(int)
Gets a mesh triangle index by stable source order.
public int GetMeshTriangleIndex(int index)
Parameters
indexint
Returns
GetMeshVertex(int)
Gets a local mesh vertex by stable source order.
public Vector3d GetMeshVertex(int index)
Parameters
indexint
Returns
- Vector3d
Sphere(Fixed64, PhysicsMaterial?)
Creates a sphere shape definition.
public static ColliderShapeDefinition Sphere(Fixed64 radius, PhysicsMaterial? material = null)
Parameters
radiusFixed64materialPhysicsMaterial?
Returns
Operators
operator ==(ColliderShapeDefinition, ColliderShapeDefinition)
Determines whether two authored 3D shape definitions are equal.
public static bool operator ==(ColliderShapeDefinition left, ColliderShapeDefinition right)
Parameters
leftColliderShapeDefinitionrightColliderShapeDefinition
Returns
operator !=(ColliderShapeDefinition, ColliderShapeDefinition)
Determines whether two authored 3D shape definitions are not equal.
public static bool operator !=(ColliderShapeDefinition left, ColliderShapeDefinition right)
Parameters
leftColliderShapeDefinitionrightColliderShapeDefinition