8#ifdef JPH_DEBUG_RENDERER
30 bool IsSphere()
const;
34 virtual ShapeResult
Create()
const override;
58 inline float GetHalfHeight()
const {
return 0.5f * (mTopCenter - mBottomCenter); }
64 virtual AABox GetLocalBounds()
const override;
67 virtual AABox GetWorldSpaceBounds(
Mat44Arg inCenterOfMassTransform,
Vec3Arg inScale)
const override;
71 virtual float GetInnerRadius()
const override {
return min(mTopRadius, mBottomRadius); }
77 virtual Vec3 GetSurfaceNormal(
const SubShapeID &inSubShapeID,
Vec3Arg inLocalSurfacePosition)
const override;
80 virtual void GetSupportingFace(
const SubShapeID &inSubShapeID,
Vec3Arg inDirection,
Vec3Arg inScale,
Mat44Arg inCenterOfMassTransform, SupportingFace &outVertices)
const override;
83 virtual const Support * GetSupportFunction(ESupportMode inMode, SupportBuffer &inBuffer,
Vec3Arg inScale)
const override;
88#ifdef JPH_DEBUG_RENDERER
94 virtual void SaveBinaryState(
StreamOut &inStream)
const override;
103 virtual bool IsValidScale(
Vec3Arg inScale)
const override;
106 virtual Vec3 MakeScaleValid(
Vec3Arg inScale)
const override;
109 static void sRegister();
113 virtual void RestoreBinaryState(
StreamIn &inStream)
override;
120 AABox GetInertiaApproximation()
const;
123 float mTopRadius = 0.0f;
124 float mBottomRadius = 0.0f;
125 float mTopCenter = 0.0f;
126 float mBottomCenter = 0.0f;
127 float mConvexRadius = 0.0f;
128 float mSinAlpha = 0.0f;
129 float mTanAlpha = 0.0f;
131#ifdef JPH_DEBUG_RENDERER
Color ColorArg
Type to use for passing arguments to a function.
Definition Color.h:12
#define JPH_EXPORT
Definition Core.h:286
unsigned int uint
Definition Core.h:546
#define JPH_NAMESPACE_END
Definition Core.h:469
#define JPH_NAMESPACE_BEGIN
Definition Core.h:463
const Vec3 Vec3Arg
Definition MathTypes.h:19
const Mat44 & Mat44Arg
Definition MathTypes.h:29
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
Mat44Arg RMat44Arg
Definition Real.h:32
#define JPH_DECLARE_SERIALIZABLE_VIRTUAL(linkage, class_name)
Definition SerializableObject.h:109
EShapeSubType
This enumerates all shape types, each shape can return its type through Shape::GetSubType.
Definition Shape.h:76
@ TaperedCapsule
Definition Shape.h:82
Axis aligned box.
Definition AABox.h:16
Definition CollideSoftBodyVertexIterator.h:15
JPH_OVERRIDE_NEW_DELETE ConvexShape(EShapeSubType inSubType)
Constructor.
Definition ConvexShape.h:41
ConvexShapeSettings()=default
Constructor.
Definition DebugRenderer.h:47
Ref< Geometry > GeometryRef
Handle for a lodded triangle batch.
Definition DebugRenderer.h:246
Describes the mass and inertia properties of a body. Used during body construction only.
Definition MassProperties.h:16
Definition PhysicsMaterial.h:23
virtual AABox GetWorldSpaceBounds(Mat44Arg inCenterOfMassTransform, Vec3Arg inScale) const
Definition Shape.h:221
virtual ShapeResult Create() const =0
Create a shape according to the settings specified by this object.
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:43
float GetHalfHeight() const
Get half height between the top and bottom sphere center.
Definition TaperedCapsuleShape.h:58
float GetBottomRadius() const
Get bottom radius of the tapered capsule.
Definition TaperedCapsuleShape.h:55
JPH_OVERRIDE_NEW_DELETE TaperedCapsuleShape()
Constructor.
Definition TaperedCapsuleShape.h:48
float GetTopRadius() const
Get top radius of the tapered capsule.
Definition TaperedCapsuleShape.h:52
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:97
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:61
virtual float GetVolume() const override
Definition TaperedCapsuleShape.h:100
virtual float GetInnerRadius() const override
Definition TaperedCapsuleShape.h:71
virtual AABox GetLocalBounds() const override
Get local bounding box including convex radius, this box is centered around the center of mass rather...
Definition TaperedCapsuleShape.cpp:282
Class that constructs a TaperedCapsuleShape.
Definition TaperedCapsuleShape.h:16
TaperedCapsuleShapeSettings()=default
Default constructor for deserialization.
float mTopRadius
Definition TaperedCapsuleShape.h:37
float mBottomRadius
Definition TaperedCapsuleShape.h:38
bool IsValid() const
Check if the settings are valid.
Definition TaperedCapsuleShape.h:27
float mHalfHeightOfTaperedCylinder
Definition TaperedCapsuleShape.h:36
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:125
Class that holds information about the shape that can be used for logging / data collection purposes.
Definition Shape.h:407