jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6.45k stars 416 forks source link

Added overrides for IsValidScale/MakeScaleValid to DecoratedShape #1181

Closed mihe closed 1 month ago

mihe commented 1 month ago

This might be by-design perhaps, but I found it a bit odd to have the default implementations of DecoratedShape::IsValidScale and DecoratedShape::MakeScaleValid not go through its mInnerShape, so this adds exactly that.

I removed the now redundant overrides in OffsetCenterOfMassShape as well, and changed RotatedTranslatedShape::IsValidScale to check with Shape::IsValidScale first instead.

jrouwe commented 1 month ago

I did this on purpose indeed to make sure I didn't miss any shape, but you're right that it is inconsistent. Thanks