Add constructor to BoundingBox for single point empty box construction

This commit is contained in:
Wojtek Figat
2021-03-18 21:50:05 +01:00
parent 544a11562c
commit 8ef8b89fd5
25 changed files with 39 additions and 29 deletions

View File

@@ -31,7 +31,7 @@ TextRender::TextRender(const SpawnParams& params)
{
_world = Matrix::Identity;
_color = Color::White;
_localBox = BoundingBox(Vector3::Zero, Vector3::Zero);
_localBox = BoundingBox(Vector3::Zero);
_layoutOptions.Bounds = Rectangle(-100, -100, 200, 200);
_layoutOptions.HorizontalAlignment = TextAlignment::Center;
_layoutOptions.VerticalAlignment = TextAlignment::Center;
@@ -92,7 +92,7 @@ void TextRender::UpdateLayout()
_vb0.Clear();
_vb1.Clear();
_vb2.Clear();
_localBox = BoundingBox(Vector3::Zero, Vector3::Zero);
_localBox = BoundingBox(Vector3::Zero);
BoundingBox::Transform(_localBox, _world, _box);
BoundingSphere::FromBox(_box, _sphere);
#if USE_PRECISE_MESH_INTERSECTS
@@ -291,7 +291,7 @@ void TextRender::UpdateLayout()
if (_ib.Data.IsEmpty())
{
// Empty
box = BoundingBox(_transform.Translation, _transform.Translation);
box = BoundingBox(_transform.Translation);
}
_localBox = box;
BoundingBox::Transform(_localBox, _world, _box);