diff --git a/crates/bevy_transform/src/components/transform.rs b/crates/bevy_transform/src/components/transform.rs index 451579f6f3..95a5881858 100644 --- a/crates/bevy_transform/src/components/transform.rs +++ b/crates/bevy_transform/src/components/transform.rs @@ -396,6 +396,15 @@ impl Transform { point += self.translation; point } + + /// Returns `true` if, and only if, translation, rotation and scale all are + /// finite. If any of them contains a `NaN`, positive or negative infinity, + /// this will return `false`. + #[inline] + #[must_use] + pub fn is_finite(&self) -> bool { + self.translation.is_finite() && self.rotation.is_finite() && self.scale.is_finite() + } } impl Default for Transform {