Add constructor to BoundingBox for single point empty box construction
This commit is contained in:
@@ -1132,6 +1132,6 @@ void SceneAnimationPlayer::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void AudioListener::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
|
|
||||||
if (IsActiveInHierarchy())
|
if (IsActiveInHierarchy())
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ void AudioSource::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
|
|
||||||
if (IsActiveInHierarchy() && SourceIDs.HasItems())
|
if (IsActiveInHierarchy() && SourceIDs.HasItems())
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "../Types/String.h"
|
#include "../Types/String.h"
|
||||||
|
|
||||||
const BoundingBox BoundingBox::Empty(Vector3(MAX_float), Vector3(MIN_float));
|
const BoundingBox BoundingBox::Empty(Vector3(MAX_float), Vector3(MIN_float));
|
||||||
const BoundingBox BoundingBox::Zero(Vector3(0.0f), Vector3(0.0f));
|
const BoundingBox BoundingBox::Zero(Vector3(0.0f));
|
||||||
|
|
||||||
String BoundingBox::ToString() const
|
String BoundingBox::ToString() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,16 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="BoundingBox"/> struct.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="point">The location of the empty bounding box.</param>
|
||||||
|
BoundingBox(const Vector3& point)
|
||||||
|
: Minimum(point)
|
||||||
|
, Maximum(point)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BoundingBox"/> struct.
|
/// Initializes a new instance of the <see cref="BoundingBox"/> struct.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ void AnimatedModel::UpdateLocalBounds()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
box = BoundingBox(Vector3::Zero, Vector3::Zero);
|
box = BoundingBox(Vector3::Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scale bounds
|
// Scale bounds
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void BoneSocket::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,6 @@ void DirectionalLight::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
LightWithShadow::OnTransformChanged();
|
LightWithShadow::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ void EmptyActor::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,6 +228,6 @@ void ExponentialHeightFog::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,6 +259,6 @@ void Sky::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,6 @@ void Skybox::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ void SplineModel::OnSplineUpdated()
|
|||||||
// Skip updates when actor is disabled or something is missing
|
// Skip updates when actor is disabled or something is missing
|
||||||
if (!_spline || !Model || !Model->IsLoaded() || !IsActiveInHierarchy() || _spline->GetSplinePointsCount() < 2)
|
if (!_spline || !Model || !Model->IsLoaded() || !IsActiveInHierarchy() || _spline->GetSplinePointsCount() < 2)
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ void StaticModel::UpdateBounds()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
}
|
}
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -362,6 +362,6 @@ void Scene::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ void ParticleEffect::UpdateBounds()
|
|||||||
// Empty bounds if there is no particle system to play or it has been never played
|
// Empty bounds if there is no particle system to play or it has been never played
|
||||||
if (bounds == BoundingBox::Empty)
|
if (bounds == BoundingBox::Empty)
|
||||||
{
|
{
|
||||||
bounds = BoundingBox(_transform.Translation, _transform.Translation);
|
bounds = BoundingBox(_transform.Translation);
|
||||||
}
|
}
|
||||||
|
|
||||||
_box = bounds;
|
_box = bounds;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void PhysicsActor::UpdateBounds()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -71,7 +71,7 @@ void PhysicsActor::UpdateBounds()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
}
|
}
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,6 @@ void SplineRopeBody::OnTransformChanged()
|
|||||||
{
|
{
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void CharacterController::UpdateBounds()
|
|||||||
if (actor)
|
if (actor)
|
||||||
_box = P2C(actor->getWorldBounds(boundsScale));
|
_box = P2C(actor->getWorldBounds(boundsScale));
|
||||||
else
|
else
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ void CharacterController::OnTransformChanged()
|
|||||||
}
|
}
|
||||||
else if (!_controller)
|
else if (!_controller)
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void SplineCollider::OnSplineUpdated()
|
|||||||
{
|
{
|
||||||
if (!_spline || !IsActiveInHierarchy() || _spline->GetSplinePointsCount() < 2 || !CollisionData || !CollisionData->IsLoaded())
|
if (!_spline || !IsActiveInHierarchy() || _spline->GetSplinePointsCount() < 2 || !CollisionData || !CollisionData->IsLoaded())
|
||||||
{
|
{
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ void SplineCollider::UpdateBounds()
|
|||||||
void SplineCollider::GetGeometry(PxGeometryHolder& geometry)
|
void SplineCollider::GetGeometry(PxGeometryHolder& geometry)
|
||||||
{
|
{
|
||||||
// Reset bounds
|
// Reset bounds
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
|
|
||||||
// Skip if sth is missing
|
// Skip if sth is missing
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ void Joint::OnTransformChanged()
|
|||||||
|
|
||||||
// TODO: this could track only local transform changed
|
// TODO: this could track only local transform changed
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
|
|
||||||
if (_joint)
|
if (_joint)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Terrain::~Terrain()
|
|||||||
void Terrain::UpdateBounds()
|
void Terrain::UpdateBounds()
|
||||||
{
|
{
|
||||||
PROFILE_CPU();
|
PROFILE_CPU();
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
for (int32 i = 0; i < _patches.Count(); i++)
|
for (int32 i = 0; i < _patches.Count(); i++)
|
||||||
{
|
{
|
||||||
auto patch = _patches[i];
|
auto patch = _patches[i];
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ TextRender::TextRender(const SpawnParams& params)
|
|||||||
{
|
{
|
||||||
_world = Matrix::Identity;
|
_world = Matrix::Identity;
|
||||||
_color = Color::White;
|
_color = Color::White;
|
||||||
_localBox = BoundingBox(Vector3::Zero, Vector3::Zero);
|
_localBox = BoundingBox(Vector3::Zero);
|
||||||
_layoutOptions.Bounds = Rectangle(-100, -100, 200, 200);
|
_layoutOptions.Bounds = Rectangle(-100, -100, 200, 200);
|
||||||
_layoutOptions.HorizontalAlignment = TextAlignment::Center;
|
_layoutOptions.HorizontalAlignment = TextAlignment::Center;
|
||||||
_layoutOptions.VerticalAlignment = TextAlignment::Center;
|
_layoutOptions.VerticalAlignment = TextAlignment::Center;
|
||||||
@@ -92,7 +92,7 @@ void TextRender::UpdateLayout()
|
|||||||
_vb0.Clear();
|
_vb0.Clear();
|
||||||
_vb1.Clear();
|
_vb1.Clear();
|
||||||
_vb2.Clear();
|
_vb2.Clear();
|
||||||
_localBox = BoundingBox(Vector3::Zero, Vector3::Zero);
|
_localBox = BoundingBox(Vector3::Zero);
|
||||||
BoundingBox::Transform(_localBox, _world, _box);
|
BoundingBox::Transform(_localBox, _world, _box);
|
||||||
BoundingSphere::FromBox(_box, _sphere);
|
BoundingSphere::FromBox(_box, _sphere);
|
||||||
#if USE_PRECISE_MESH_INTERSECTS
|
#if USE_PRECISE_MESH_INTERSECTS
|
||||||
@@ -291,7 +291,7 @@ void TextRender::UpdateLayout()
|
|||||||
if (_ib.Data.IsEmpty())
|
if (_ib.Data.IsEmpty())
|
||||||
{
|
{
|
||||||
// Empty
|
// Empty
|
||||||
box = BoundingBox(_transform.Translation, _transform.Translation);
|
box = BoundingBox(_transform.Translation);
|
||||||
}
|
}
|
||||||
_localBox = box;
|
_localBox = box;
|
||||||
BoundingBox::Transform(_localBox, _world, _box);
|
BoundingBox::Transform(_localBox, _world, _box);
|
||||||
|
|||||||
@@ -164,6 +164,6 @@ void UICanvas::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ void UIControl::OnTransformChanged()
|
|||||||
// Base
|
// Base
|
||||||
Actor::OnTransformChanged();
|
Actor::OnTransformChanged();
|
||||||
|
|
||||||
_box = BoundingBox(_transform.Translation, _transform.Translation);
|
_box = BoundingBox(_transform.Translation);
|
||||||
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
_sphere = BoundingSphere(_transform.Translation, 0.0f);
|
||||||
|
|
||||||
UICONTROL_INVOKE(TransformChanged);
|
UICONTROL_INVOKE(TransformChanged);
|
||||||
|
|||||||
Reference in New Issue
Block a user