Table of Contents

Interface ICompoundShape

Namespace
BepuPhysics.Collidables
Assembly
BepuPhysics.dll

Defines a compound shape type that has children of potentially different types.

public interface ICompoundShape : IDisposableShape, IShape, IBoundsQueryableCompound
Inherited Members

Properties

ChildCount

Gets the number of children in the compound shape.

int ChildCount { get; }

Property Value

int

Methods

AddChildBoundsToBatcher(ref BoundingBoxBatcher, in RigidPose, in BodyVelocity, int)

Submits child shapes to a bounding box batcher for vectorized bounds calculation.

void AddChildBoundsToBatcher(ref BoundingBoxBatcher batcher, in RigidPose pose, in BodyVelocity velocity, int bodyIndex)

Parameters

batcher BoundingBoxBatcher

Batcher to accumulate children in.

pose RigidPose

Pose of the compound.

velocity BodyVelocity

Velocity of the compound used to expand child bounds.

bodyIndex int

Index of the body in the active body set; used to accumulate child bounds results.

Remarks

This is used internally for bounding box calculation, but it is unlikely to be useful externally.

ComputeBounds(Quaternion, Shapes, out Vector3, out Vector3)

Computes the bounding box of a compound shape.

void ComputeBounds(Quaternion orientation, Shapes shapeBatches, out Vector3 min, out Vector3 max)

Parameters

orientation Quaternion

Orientation of the compound.

shapeBatches Shapes

Shape batches to look up child shape information in.

min Vector3

Minimum of the compound's bounding box.

max Vector3

Maximum of the compound's bounding box.

GetChild(int)

Gets a child from the compound by index.

ref CompoundChild GetChild(int compoundChildIndex)

Parameters

compoundChildIndex int

Index of the child to look up.

Returns

CompoundChild

Reference to the requested compound child.

RayTest<TRayHitHandler>(in RigidPose, in RayData, ref float, Shapes, ref TRayHitHandler)

Tests a ray against the shape.

void RayTest<TRayHitHandler>(in RigidPose pose, in RayData ray, ref float maximumT, Shapes shapeBatches, ref TRayHitHandler hitHandler) where TRayHitHandler : struct, IShapeRayHitHandler

Parameters

pose RigidPose

Pose of the shape during the ray test.

ray RayData

Ray to test against the shape.

maximumT float

Maximum distance along the ray, in units of the ray direction's length, that the ray will test.

shapeBatches Shapes

Shape batches to look up child shapes in if necessary.

hitHandler TRayHitHandler

Callbacks called when the ray interacts with a test candidate.

Type Parameters

TRayHitHandler

RayTest<TRayHitHandler>(in RigidPose, ref RaySource, Shapes, ref TRayHitHandler)

Tests multiple rays against the shape.

void RayTest<TRayHitHandler>(in RigidPose pose, ref RaySource rays, Shapes shapeBatches, ref TRayHitHandler hitHandler) where TRayHitHandler : struct, IShapeRayHitHandler

Parameters

pose RigidPose

Pose of the shape during the ray test.

rays RaySource

Rays to test against the shape.

shapeBatches Shapes

Shape batches to look up child shapes in if necessary.

hitHandler TRayHitHandler

Callbacks called when the ray interacts with a test candidate.

Type Parameters

TRayHitHandler