@@ -136,7 +136,11 @@ void BoundingSphere::FromPoints(const Double3* points, int32 pointsCount, Boundi
|
|||||||
|
|
||||||
void BoundingSphere::FromBox(const BoundingBox& box, BoundingSphere& result)
|
void BoundingSphere::FromBox(const BoundingBox& box, BoundingSphere& result)
|
||||||
{
|
{
|
||||||
ASSERT(!box.Minimum.IsNanOrInfinity() && !box.Maximum.IsNanOrInfinity());
|
if (box.Minimum.IsNanOrInfinity() || box.Maximum.IsNanOrInfinity())
|
||||||
|
{
|
||||||
|
result = Empty;
|
||||||
|
return;
|
||||||
|
}
|
||||||
const Real x = box.Maximum.X - box.Minimum.X;
|
const Real x = box.Maximum.X - box.Minimum.X;
|
||||||
const Real y = box.Maximum.Y - box.Minimum.Y;
|
const Real y = box.Maximum.Y - box.Minimum.Y;
|
||||||
const Real z = box.Maximum.Z - box.Minimum.Z;
|
const Real z = box.Maximum.Z - box.Minimum.Z;
|
||||||
|
|||||||
@@ -447,9 +447,13 @@ void RigidBody::OnActiveTransformChanged()
|
|||||||
// Change actor transform (but with locking)
|
// Change actor transform (but with locking)
|
||||||
ASSERT(!_isUpdatingTransform);
|
ASSERT(!_isUpdatingTransform);
|
||||||
_isUpdatingTransform = true;
|
_isUpdatingTransform = true;
|
||||||
Transform transform;
|
Transform transform = _transform;
|
||||||
PhysicsBackend::GetRigidActorPose(_actor, transform.Translation, transform.Orientation);
|
PhysicsBackend::GetRigidActorPose(_actor, transform.Translation, transform.Orientation);
|
||||||
transform.Scale = _transform.Scale;
|
if (transform.Translation.IsNanOrInfinity() || transform.Orientation.IsNanOrInfinity())
|
||||||
|
{
|
||||||
|
LOG(Error, "GetRigidActorPose retuned NaN/Inf transformation");
|
||||||
|
transform = _transform;
|
||||||
|
}
|
||||||
if (_parent)
|
if (_parent)
|
||||||
{
|
{
|
||||||
_parent->GetTransform().WorldToLocal(transform, _localTransform);
|
_parent->GetTransform().WorldToLocal(transform, _localTransform);
|
||||||
|
|||||||
Reference in New Issue
Block a user