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
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
QuaternionOrientation of the compound.
min
Vector3Minimum of the compound's bounding box.
max
Vector3Maximum 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
intIndex of the child in the compound parent.
childData
TChildShapeData 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
intIndex of the child in the compound parent.
childData
TChildShapeWideReference 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
intIndex of the child.
childData
TChildShapeShape of the child.
childPose
RigidPosePose 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
RigidPosePose of the shape during the ray test.
ray
RayDataRay to test against the shape.
maximumT
floatMaximum distance along the ray, in units of the ray direction's length, that the ray will test.
hitHandler
TRayHitHandlerCallbacks 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
RigidPosePose of the shape during the ray test.
rays
RaySourceRays to test against the shape.
hitHandler
TRayHitHandlerCallbacks called when the ray interacts with a test candidate.
Type Parameters
TRayHitHandler