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
batcher
BoundingBoxBatcherBatcher to accumulate children in.
pose
RigidPosePose of the compound.
velocity
BodyVelocityVelocity of the compound used to expand child bounds.
bodyIndex
intIndex 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
QuaternionOrientation of the compound.
shapeBatches
ShapesShape batches to look up child shape information in.
min
Vector3Minimum of the compound's bounding box.
max
Vector3Maximum of the compound's bounding box.
GetChild(int)
Gets a child from the compound by index.
ref CompoundChild GetChild(int compoundChildIndex)
Parameters
compoundChildIndex
intIndex 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
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.
shapeBatches
ShapesShape batches to look up child shapes in if necessary.
hitHandler
TRayHitHandlerCallbacks 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
RigidPosePose of the shape during the ray test.
rays
RaySourceRays to test against the shape.
shapeBatches
ShapesShape batches to look up child shapes in if necessary.
hitHandler
TRayHitHandlerCallbacks called when the ray interacts with a test candidate.
Type Parameters
TRayHitHandler