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
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
batcherBoundingBoxBatcherBatcher to accumulate children in.
poseRigidPosePose of the compound.
velocityBodyVelocityVelocity of the compound used to expand child bounds.
bodyIndexintIndex 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
orientationQuaternionOrientation of the compound.
shapeBatchesShapesShape batches to look up child shape information in.
minVector3Minimum of the compound's bounding box.
maxVector3Maximum of the compound's bounding box.
GetChild(int)
Gets a child from the compound by index.
ref CompoundChild GetChild(int compoundChildIndex)
Parameters
compoundChildIndexintIndex 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
poseRigidPosePose of the shape during the ray test.
rayRayDataRay to test against the shape.
maximumTfloatMaximum distance along the ray, in units of the ray direction's length, that the ray will test.
shapeBatchesShapesShape batches to look up child shapes in if necessary.
hitHandlerTRayHitHandlerCallbacks 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
poseRigidPosePose of the shape during the ray test.
raysRaySourceRays to test against the shape.
shapeBatchesShapesShape batches to look up child shapes in if necessary.
hitHandlerTRayHitHandlerCallbacks called when the ray interacts with a test candidate.
Type Parameters
TRayHitHandler