Table of Contents

Class LSMeshCollider

Namespace
Gravitas.Colliders
Assembly
Gravitas.dll

Represents a runtime 3D collider backed by deterministic triangle-mesh geometry.

public sealed class LSMeshCollider : LSCollider, IRecordable
Inheritance
LSMeshCollider
Implements
IRecordable
Inherited Members

Constructors

LSMeshCollider(Vector3d[], int[])

Creates a convex mesh collider from authored vertices and triangle indices.

public LSMeshCollider(Vector3d[] vertices, int[] triangles)

Parameters

vertices Vector3d[]
triangles int[]

LSMeshCollider(Vector3d[], int[], MeshColliderMode)

Creates a mesh collider with an explicit collision mode.

public LSMeshCollider(Vector3d[] vertices, int[] triangles, MeshColliderMode mode)

Parameters

vertices Vector3d[]
triangles int[]
mode MeshColliderMode

LSMeshCollider(Vector3d[], int[], MeshColliderMode, MeshInertiaPolicy)

Creates a mesh collider with explicit collision and inertia policies.

public LSMeshCollider(Vector3d[] vertices, int[] triangles, MeshColliderMode mode, MeshInertiaPolicy inertiaPolicy)

Parameters

vertices Vector3d[]
triangles int[]
mode MeshColliderMode
inertiaPolicy MeshInertiaPolicy

LSMeshCollider(ColliderShapeDefinition)

Creates a runtime convex mesh from an authored shape definition.

public LSMeshCollider(ColliderShapeDefinition definition)

Parameters

definition ColliderShapeDefinition

Properties

Area

Gets the committed shape-specific measure used as the frontal-area fallback.

public override Fixed64 Area { get; }

Property Value

Fixed64

InertiaPolicy

Determines how inertia is derived when this mesh collider is attached to a body with angular dynamics.

public MeshInertiaPolicy InertiaPolicy { get; }

Property Value

MeshInertiaPolicy

IsClosedSurface

Gets whether the mesh's exact-position-welded triangle topology is one connected, consistently wound, closed two-manifold surface.

public bool IsClosedSurface { get; }

Property Value

bool

Mesh

Gets the deterministic runtime mesh geometry.

public PhysicsMesh Mesh { get; }

Property Value

PhysicsMesh

Mode

Gets the mesh collision mode.

public MeshColliderMode Mode { get; }

Property Value

MeshColliderMode

Priority

Gets the deterministic narrow-phase ordering priority.

public override int Priority { get; }

Property Value

int

ScaledRadius

Gets the bounding circle radius. For boxes, this is half of the diagonal length of the cube

public override Fixed64 ScaledRadius { get; }

Property Value

Fixed64

The radius.

Shape

Gets the runtime 3D shape family.

public override ColliderType Shape { get; }

Property Value

ColliderType

Methods

ClosestPointOnSurface(Vector3d)

Gets the point on this collider's surface nearest to a world-space point.

public override Vector3d ClosestPointOnSurface(Vector3d queryPoint)

Parameters

queryPoint Vector3d

Returns

Vector3d

ColliderOverlapsRay(RaycastSegmentWorker, ref SwiftList<Vector3d>)

Checks if this object overlaps the line formed by p1 and p2

public override bool ColliderOverlapsRay(RaycastSegmentWorker worker, ref SwiftList<Vector3d> outputIntersectionPoints)

Parameters

worker RaycastSegmentWorker

The prepared ray-axis worker for the owning query service.

outputIntersectionPoints SwiftList<Vector3d>

Returns

bool

GetFrontalArea(Vector3d)

Gets the frontal-area estimate for a world-space direction; the base implementation returns Area.

public override Fixed64 GetFrontalArea(Vector3d direction)

Parameters

direction Vector3d

Returns

Fixed64

GetNearbyTriangles(Vector3d, SwiftList<int>)

Writes triangle indices near a world-space point into a caller-owned buffer.

public void GetNearbyTriangles(Vector3d queryPoint, SwiftList<int> result)

Parameters

queryPoint Vector3d
result SwiftList<int>

GetNormalAtPoint(Vector3d)

The direction pointing outward from the surface of the collider at the point

public override Vector3d GetNormalAtPoint(Vector3d point)

Parameters

point Vector3d

Returns

Vector3d

GetTrianglesInBounds(FixedBoundVolume, SwiftList<int>)

Writes triangle indices overlapping world-space bounds into a caller-owned buffer.

public void GetTrianglesInBounds(FixedBoundVolume queryBounds, SwiftList<int> result)

Parameters

queryBounds FixedBoundVolume
result SwiftList<int>