8#ifdef JPH_DEBUG_RENDERER
26 bool IsValid()
const {
return mTopRadius > 0.0f && mBottomRadius > 0.0f && mHalfHeightOfTaperedCylinder >= 0.0f; }
29 bool IsSphere()
const;
34 float mHalfHeightOfTaperedCylinder = 0.0f;
35 float mTopRadius = 0.0f;
36 float mBottomRadius = 0.0f;
53 virtual AABox GetLocalBounds()
const override;
56 virtual AABox GetWorldSpaceBounds(
Mat44Arg inCenterOfMassTransform,
Vec3Arg inScale)
const override;
60 virtual float GetInnerRadius()
const override {
return min(mTopRadius, mBottomRadius); }
66 virtual Vec3 GetSurfaceNormal(
const SubShapeID &inSubShapeID,
Vec3Arg inLocalSurfacePosition)
const override;
69 virtual void GetSupportingFace(
const SubShapeID &inSubShapeID,
Vec3Arg inDirection,
Vec3Arg inScale,
Mat44Arg inCenterOfMassTransform, SupportingFace &outVertices)
const override;
72 virtual const Support * GetSupportFunction(ESupportMode inMode, SupportBuffer &inBuffer,
Vec3Arg inScale)
const override;
75 virtual void CollideSoftBodyVertices(
Mat44Arg inCenterOfMassTransform,
Vec3Arg inScale,
SoftBodyVertex *ioVertices,
uint inNumVertices,
float inDeltaTime,
Vec3Arg inDisplacementDueToGravity,
int inCollidingShapeIndex)
const override;
77#ifdef JPH_DEBUG_RENDERER
86 virtual void SaveBinaryState(
StreamOut &inStream)
const override;
92 virtual float GetVolume()
const override {
return GetLocalBounds().GetVolume(); }
95 virtual bool IsValidScale(
Vec3Arg inScale)
const override;
98 static void sRegister();
102 virtual void RestoreBinaryState(
StreamIn &inStream)
override;
109 AABox GetInertiaApproximation()
const;
112 float mTopRadius = 0.0f;
113 float mBottomRadius = 0.0f;
114 float mTopCenter = 0.0f;
115 float mBottomCenter = 0.0f;
116 float mConvexRadius = 0.0f;
117 float mSinAlpha = 0.0f;
118 float mTanAlpha = 0.0f;
120#ifdef JPH_DEBUG_RENDERER
#define JPH_EXPORT
Definition: Core.h:227
unsigned int uint
Definition: Core.h:439
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition: Memory.h:29
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition: SerializableObject.h:100
EShapeSubType
This enumerates all shape types, each shape can return its type through Shape::GetSubType.
Definition: Shape.h:74
Axis aligned box.
Definition: AABox.h:16
Virtual interface that allows collecting multiple collision results.
Definition: CollisionCollector.h:45
Class that holds an RGBA color with 8-bits per component.
Definition: Color.h:16
Base class for all convex shapes. Defines a virtual interface.
Definition: ConvexShape.h:36
Class that constructs a ConvexShape (abstract)
Definition: ConvexShape.h:18
Definition: DebugRenderer.h:47
Describes the mass and inertia properties of a body. Used during body construction only.
Definition: MassProperties.h:16
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition: Mat44.h:13
Definition: PhysicsMaterial.h:23
virtual AABox GetWorldSpaceBounds(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale) const
Definition: Shape.h:214
virtual ShapeResult Create() const =0
Create a shape according to the settings specified by this object.
Definition: SoftBodyVertex.h:16
Simple binary input stream.
Definition: StreamIn.h:13
Simple binary output stream.
Definition: StreamOut.h:13
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition: SubShapeID.h:23
Definition: TaperedCapsuleShape.cpp:137
A capsule with different top and bottom radii.
Definition: TaperedCapsuleShape.h:41
JPH_OVERRIDE_NEW_DELETE TaperedCapsuleShape()
Constructor.
Definition: TaperedCapsuleShape.h:46
virtual Stats GetStats() const override
Get stats of this shape. Use for logging / data collection purposes only. Does not add values from ch...
Definition: TaperedCapsuleShape.h:89
virtual Vec3 GetCenterOfMass() const override
All shapes are centered around their center of mass. This function returns the center of mass positio...
Definition: TaperedCapsuleShape.h:50
virtual float GetVolume() const override
Definition: TaperedCapsuleShape.h:92
virtual float GetInnerRadius() const override
Definition: TaperedCapsuleShape.h:60
Class that constructs a TaperedCapsuleShape.
Definition: TaperedCapsuleShape.h:16
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition: Vec3.inl:107
Class that holds information about the shape that can be used for logging / data collection purposes.
Definition: Shape.h:396