Add relative-to-camera rendering for large worlds

This commit is contained in:
Wojtek Figat
2022-06-21 20:03:13 +02:00
parent f3bd0e469c
commit 134c8b99aa
35 changed files with 331 additions and 195 deletions

View File

@@ -17,7 +17,7 @@ void BoxVolume::SetSize(const Vector3& value)
const auto prevBounds = _box;
_size = value;
OrientedBoundingBox::CreateCentered(Vector3::Zero, _size, _bounds);
_bounds.Transform(_transform.GetWorld());
_bounds.Transform(_transform);
_bounds.GetBoundingBox(_box);
BoundingSphere::FromBox(_box, _sphere);
OnBoundsChanged(prevBounds);
@@ -142,7 +142,7 @@ void BoxVolume::OnTransformChanged()
const auto prevBounds = _box;
OrientedBoundingBox::CreateCentered(Vector3::Zero, _size, _bounds);
_bounds.Transform(_transform.GetWorld());
_bounds.Transform(_transform);
_bounds.GetBoundingBox(_box);
BoundingSphere::FromBox(_box, _sphere);
OnBoundsChanged(prevBounds);