Browse Source

Add missing getters for convex radius (#285)

Nikita Leonidov 2 years ago
parent
commit
08ddcd92bb

+ 3 - 0
Jolt/Physics/Collision/Shape/BoxShape.h

@@ -90,6 +90,9 @@ public:
 	// See Shape::GetVolume
 	virtual float			GetVolume() const override									{ return GetLocalBounds().GetVolume(); }
 
+	/// Get the convex radius of this box
+	float					GetConvexRadius() const										{ return mConvexRadius; }
+
 	// Register shape functions with the registry
 	static void				sRegister();
 

+ 3 - 0
Jolt/Physics/Collision/Shape/CylinderShape.h

@@ -97,6 +97,9 @@ public:
 	// See Shape::GetVolume
 	virtual float			GetVolume() const override												{ return 2.0f * JPH_PI * mHalfHeight * Square(mRadius); }
 
+	/// Get the convex radius of this cylinder
+	float					GetConvexRadius() const													{ return mConvexRadius; }
+
 	// See Shape::IsValidScale
 	virtual bool			IsValidScale(Vec3Arg inScale) const override;