102 template <
class BoxType>
103 struct GetIntersectingSubShapesVisitorMC :
public GetIntersectingSubShapesVisitor<BoxType>
111 return GetIntersectingSubShapesVisitor<BoxType>::TestBounds(inBoundsMinX, inBoundsMinY, inBoundsMinZ, inBoundsMaxX, inBoundsMaxY, inBoundsMaxZ);
114 JPH_INLINE
bool ShouldVisitBlock(
UVec4Arg inResult)
const
119 JPH_INLINE
bool ShouldVisitSubShape(
UVec4Arg inResult,
uint inIndexInBlock)
const
121 return inResult[inIndexInBlock] != 0;
129 void EnsureSubShapeBoundsCapacity();
134 void CalculateSubShapeBounds(
uint inStartIdx,
uint inNumber);
137 void CalculateLocalBounds();
139 template <
class Visitor>
140 JPH_INLINE
void WalkSubShapes(Visitor &ioVisitor)
const;
143 static void sCollideCompoundVsShape(
const Shape *inShape1,
const Shape *inShape2,
Vec3Arg inScale1,
Vec3Arg inScale2,
Mat44Arg inCenterOfMassTransform1,
Mat44Arg inCenterOfMassTransform2,
const SubShapeIDCreator &inSubShapeIDCreator1,
const SubShapeIDCreator &inSubShapeIDCreator2,
const CollideShapeSettings &inCollideShapeSettings,
CollideShapeCollector &ioCollector,
const ShapeFilter &inShapeFilter);
144 static void sCollideShapeVsCompound(
const Shape *inShape1,
const Shape *inShape2,
Vec3Arg inScale1,
Vec3Arg inScale2,
Mat44Arg inCenterOfMassTransform1,
Mat44Arg inCenterOfMassTransform2,
const SubShapeIDCreator &inSubShapeIDCreator1,
const SubShapeIDCreator &inSubShapeIDCreator2,
const CollideShapeSettings &inCollideShapeSettings,
CollideShapeCollector &ioCollector,
const ShapeFilter &inShapeFilter);
uint32_t uint32
Definition Core.h:312
unsigned int uint
Definition Core.h:309
#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(class_name)
Definition SerializableObject.h:100
EShapeSubType
This enumerates all shape types, each shape can return its type through Shape::GetSubType.
Definition Shape.h:71
Axis aligned box.
Definition AABox.h:16
Settings to be passed with a collision query.
Definition CollideShape.h:94
Virtual interface that allows collecting multiple collision results.
Definition CollisionCollector.h:45
Base class for a compound shape.
Definition CompoundShape.h:49
SubShapes mSubShapes
Definition CompoundShape.h:333
Base class settings to construct a compound shape.
Definition CompoundShape.h:18
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Definition MutableCompoundShape.h:31
virtual void SaveBinaryState(StreamOut &inStream) const override
Saves the contents of the shape in binary form to inStream.
Definition MutableCompoundShape.cpp:525
static void sRegister()
Definition MutableCompoundShape.cpp:546
virtual void CollectTransformedShapes(const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, const SubShapeIDCreator &inSubShapeIDCreator, TransformedShapeCollector &ioCollector, const ShapeFilter &inShapeFilter) const override
Definition MutableCompoundShape.cpp:407
virtual int GetIntersectingSubShapes(const AABox &inBox, uint *outSubShapeIndices, int inMaxSubShapeIndices) const override
Definition MutableCompoundShape.cpp:441
void ModifyShape(uint inIndex, Vec3Arg inPosition, QuatArg inRotation)
Modify the position / orientation of a shape.
Definition MutableCompoundShape.cpp:205
void ModifyShapes(uint inStartIndex, uint inNumber, const Vec3 *inPositions, const Quat *inRotations, uint inPositionStride=sizeof(Vec3), uint inRotationStride=sizeof(Quat))
Batch set positions / orientations, this avoids duplicate work due to bounding box calculation.
Definition MutableCompoundShape.cpp:222
JPH_OVERRIDE_NEW_DELETE MutableCompoundShape()
Constructor.
Definition MutableCompoundShape.h:36
uint AddShape(Vec3Arg inPosition, QuatArg inRotation, const Shape *inShape, uint32 inUserData=0)
Definition MutableCompoundShape.cpp:180
virtual void CollidePoint(Vec3Arg inPoint, const SubShapeIDCreator &inSubShapeIDCreator, CollidePointCollector &ioCollector, const ShapeFilter &inShapeFilter={ }) const override
Definition MutableCompoundShape.cpp:339
virtual Stats GetStats() const override
Get stats of this shape. Use for logging / data collection purposes only. Does not add values from ch...
Definition MutableCompoundShape.h:59
void AdjustCenterOfMass()
Definition MutableCompoundShape.cpp:58
void RemoveShape(uint inIndex)
Remove a shape by index.
Definition MutableCompoundShape.cpp:194
virtual void RestoreBinaryState(StreamIn &inStream) override
This function should not be called directly, it is used by sRestoreFromBinaryState.
Definition MutableCompoundShape.cpp:534
virtual bool CastRay(const RayCast &inRay, const SubShapeIDCreator &inSubShapeIDCreator, RayCastResult &ioHit) const override
Definition MutableCompoundShape.cpp:272
Class that constructs a MutableCompoundShape.
Definition MutableCompoundShape.h:15
virtual ShapeResult Create() const override
Create a shape according to the settings specified by this object.
Definition MutableCompoundShape.cpp:21
Oriented box.
Definition OrientedBox.h:18
Specialization of cast result against a shape.
Definition CastResult.h:27
Settings to be passed with a ray cast.
Definition RayCast.h:64
Settings to be passed with a shape cast.
Definition ShapeCast.h:92
Filter class.
Definition ShapeFilter.h:17
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:170
ShapeSettings::ShapeResult ShapeResult
Definition Shape.h:174
Simple binary input stream.
Definition StreamIn.h:11
Simple binary output stream.
Definition StreamOut.h:11
Definition SubShapeID.h:108
JPH_INLINE bool TestAnyTrue() const
Test if any of the components are true (true is when highest bit of component is set)
Definition UVec4.inl:390
JPH_INLINE GetIntersectingSubShapesVisitor(const BoxType &inBox, uint *outSubShapeIndices, int inMaxSubShapeIndices)
Definition CompoundShapeVisitors.h:419
Definition CompoundShape.h:132
Class that holds information about the shape that can be used for logging / data collection purposes.
Definition Shape.h:377
Definition ShapeCast.h:69