Table of Contents

Interface IHomogeneousCompoundShape<TChildShape, TChildShapeWide>

Namespace
BepuPhysics.Collidables
Assembly
BepuPhysics.dll

Defines a compound shape type that has children of only one type.

public interface IHomogeneousCompoundShape<TChildShape, TChildShapeWide> : IDisposableShape, IShape, IBoundsQueryableCompound where TChildShape : unmanaged, IConvexShape where TChildShapeWide : unmanaged, IShapeWide<TChildShape>

Type Parameters

TChildShape

Type of the child shapes.

TChildShapeWide

Type of the child shapes, formatted in AOSOA layout.

Inherited Members

Properties

ChildCount

Gets the number of children in the compound shape.

int ChildCount { get; }

Property Value

int

Methods

ComputeBounds(Quaternion, out Vector3, out Vector3)

Computes the bounding box of a compound shape.

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

Parameters

orientation Quaternion

Orientation of the compound.

min Vector3

Minimum of the compound's bounding box.

max Vector3

Maximum of the compound's bounding box.

GetLocalChild(int, out TChildShape)

Gets a child shape as it appears in the compound's local space.

void GetLocalChild(int childIndex, out TChildShape childData)

Parameters

childIndex int

Index of the child in the compound parent.

childData TChildShape

Data representing the child.

GetLocalChild(int, ref TChildShapeWide)

Gets a child shape as it appears in the compound's local space.

void GetLocalChild(int childIndex, ref TChildShapeWide childData)

Parameters

childIndex int

Index of the child in the compound parent.

childData TChildShapeWide

Reference to an AOSOA slot.

GetPosedLocalChild(int, out TChildShape, out RigidPose)

Gets a child shape from the compound and compounds a pose for it in the local space of the compound parent. Useful for processes which require a child shape (like a triangle in a mesh) to have their center of mass at zero in the child's own local space.

void GetPosedLocalChild(int childIndex, out TChildShape childData, out RigidPose childPose)

Parameters

childIndex int

Index of the child.

childData TChildShape

Shape of the child.

childPose RigidPose

Pose in the compound's local space that brings the child shape as described to the proper location in the parent compound's local space.

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

Tests a ray against the shape.

void RayTest<TRayHitHandler>(in RigidPose pose, in RayData ray, ref float maximumT, 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.

hitHandler TRayHitHandler

Callbacks called when the ray interacts with a test candidate.

Type Parameters

TRayHitHandler

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

Tests multiple rays against the shape.

void RayTest<TRayHitHandler>(in RigidPose pose, ref RaySource rays, 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.

hitHandler TRayHitHandler

Callbacks called when the ray interacts with a test candidate.

Type Parameters

TRayHitHandler