Browse Source

Added overrides for IsValidScale/MakeScaleValid to DecoratedShape (#1181)

Mikael Hermansson 1 year ago
parent
commit
a8fbf89a93

+ 6 - 0
Jolt/Physics/Collision/Shape/DecoratedShape.h

@@ -63,6 +63,12 @@ public:
 	// See Shape::GetStatsRecursive
 	virtual Stats					GetStatsRecursive(VisitedShapes &ioVisitedShapes) const override;
 
+	// See Shape::IsValidScale
+	virtual bool					IsValidScale(Vec3Arg inScale) const override			{ return mInnerShape->IsValidScale(inScale); }
+
+	// See Shape::MakeScaleValid
+	virtual Vec3					MakeScaleValid(Vec3Arg inScale) const override			{ return mInnerShape->MakeScaleValid(inScale); }
+
 protected:
 	RefConst<Shape>					mInnerShape;
 };

+ 0 - 6
Jolt/Physics/Collision/Shape/OffsetCenterOfMassShape.h

@@ -120,12 +120,6 @@ public:
 	// See Shape::GetVolume
 	virtual float					GetVolume() const override								{ return mInnerShape->GetVolume(); }
 
-	// See Shape::IsValidScale
-	virtual bool					IsValidScale(Vec3Arg inScale) const override			{ return mInnerShape->IsValidScale(inScale); }
-
-	// See Shape::MakeScaleValid
-	virtual Vec3					MakeScaleValid(Vec3Arg inScale) const override			{ return mInnerShape->MakeScaleValid(inScale); }
-
 	// Register shape functions with the registry
 	static void						sRegister();
 

+ 1 - 1
Jolt/Physics/Collision/Shape/RotatedTranslatedShape.cpp

@@ -282,7 +282,7 @@ void RotatedTranslatedShape::RestoreBinaryState(StreamIn &inStream)
 
 bool RotatedTranslatedShape::IsValidScale(Vec3Arg inScale) const
 {
-	if (!DecoratedShape::IsValidScale(inScale))
+	if (!Shape::IsValidScale(inScale))
 		return false;
 
 	if (mIsRotationIdentity || ScaleHelpers::IsUniformScale(inScale))