Fix old api usage for #4185
This commit is contained in:
@@ -140,7 +140,7 @@ namespace FlaxEditor.Content
|
||||
actor is SpriteRender ||
|
||||
actor is TextRender)
|
||||
{
|
||||
actorBounds = actor.EditorBox;
|
||||
actorBounds = actor.EditorBoundingBox;
|
||||
}
|
||||
if (actorBounds != BoundingBox.Empty)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ namespace FlaxEditor.Content
|
||||
// Update some actors data (some actor types update bounds/data later but its required to be done before rendering)
|
||||
var bounds = BoundingBox.Empty;
|
||||
Prepare(_preview.Instance, ref bounds);
|
||||
//bounds = _preview.Instance.EditorBoxChildren;
|
||||
//bounds = _preview.Instance.EditorBoundingBoxWithChildren;
|
||||
|
||||
// Auto fit actor to camera
|
||||
if (bounds != BoundingBox.Empty)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
{
|
||||
if (value is NavMeshBoundsVolume volume)
|
||||
{
|
||||
Navigation.BuildNavMesh(volume.Box, volume.Scene);
|
||||
Navigation.BuildNavMesh(volume.BoundingBox, volume.Scene);
|
||||
Editor.Instance.Scene.MarkSceneEdited(volume.Scene);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
||||
var patchesCount = terrain.PatchesCount;
|
||||
var chunkSize = terrain.ChunkSize;
|
||||
var resolution = terrain.Scale;
|
||||
var totalSize = terrain.Box.Size;
|
||||
var totalSize = terrain.BoundingBox.Size;
|
||||
string text = string.Format("Patches: {0}\nTotal Chunks: {1}\nChunk Size: {2}\nResolution: {3}m x {4}m\nTotal size: {5}km x {6}km",
|
||||
patchesCount,
|
||||
patchesCount * 16,
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace FlaxEditor.Gizmo
|
||||
{
|
||||
if (_selectionParents[i] is ActorNode actorNode)
|
||||
{
|
||||
var b = actorNode.Actor.EditorBoxChildren;
|
||||
var b = actorNode.Actor.EditorBoundingBoxWithChildren;
|
||||
BoundingBox.Merge(ref editorBounds, ref b, out editorBounds);
|
||||
bottomToCenter = Mathf.Min(bottomToCenter, actorNode.Actor.Position.Y - editorBounds.Minimum.Y);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ namespace FlaxEditor.Gizmo
|
||||
{
|
||||
if (_selectionParents[i] is ActorNode actorNode)
|
||||
{
|
||||
bounds = BoundingBox.Merge(bounds, actorNode.Actor.BoxWithChildren);
|
||||
bounds = BoundingBox.Merge(bounds, actorNode.Actor.BoundingBoxWithChildren);
|
||||
navigationDirty |= actorNode.AffectsNavigationWithChildren;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public sealed class ViewportRubberBandSelector
|
||||
var a = node.Actor;
|
||||
|
||||
// Skip actor if outside of view frustum
|
||||
var actorBox = a.EditorBox;
|
||||
var actorBox = a.EditorBoundingBox;
|
||||
if (projection.FrustumCull(ref actorBox) == ContainmentType.Disjoint)
|
||||
continue;
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ DEFINE_INTERNAL_CALL(void) EditorInternal_GetCollisionWires(CollisionData* colli
|
||||
DEFINE_INTERNAL_CALL(void) EditorInternal_GetEditorBoxWithChildren(Actor* obj, BoundingBox* result)
|
||||
{
|
||||
INTERNAL_CALL_CHECK(obj);
|
||||
*result = obj->GetEditorBoxChildren();
|
||||
*result = obj->GetEditorBoundingBoxWithChildren();
|
||||
}
|
||||
|
||||
DEFINE_INTERNAL_CALL(void) EditorInternal_SetOptions(ManagedEditor::InternalOptions* options)
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace FlaxEditor.Modules
|
||||
// Auto NavMesh rebuild
|
||||
if (!isPlayMode && options.General.AutoRebuildNavMesh && actor.Scene && node.AffectsNavigationWithChildren)
|
||||
{
|
||||
var bounds = actor.BoxWithChildren;
|
||||
var bounds = actor.BoundingBoxWithChildren;
|
||||
Navigation.BuildNavMesh(bounds, options.General.AutoRebuildNavMeshTimeoutMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ namespace FlaxEditor.SceneGraph
|
||||
/// <returns>The points to use if the actor can be selected.</returns>
|
||||
public virtual Vector3[] GetActorSelectionPoints()
|
||||
{
|
||||
return Actor.EditorBox.GetCorners();
|
||||
return Actor.EditorBoundingBox.GetCorners();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -555,7 +555,7 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
var options = Editor.Instance.Options.Options.General;
|
||||
if (options.AutoRebuildNavMesh)
|
||||
{
|
||||
Navigation.BuildNavMesh(collider.Box, options.AutoRebuildNavMeshTimeoutMs);
|
||||
Navigation.BuildNavMesh(collider.BoundingBox, options.AutoRebuildNavMeshTimeoutMs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -572,7 +572,7 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
var viewBounds = sceneContext.Viewport.ViewFrustum;
|
||||
foreach (var s in splines)
|
||||
{
|
||||
var contains = viewBounds.Contains(s.EditorBox);
|
||||
var contains = viewBounds.Contains(s.EditorBoundingBox);
|
||||
if (contains == ContainmentType.Contains || contains == ContainmentType.Intersects)
|
||||
result.Add(s);
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
|
||||
private void CreateSphere(StaticModel actor, Spawner spawner, bool singleNode)
|
||||
{
|
||||
var bounds = actor.Sphere;
|
||||
var bounds = actor.BoundingSphere;
|
||||
var collider = new SphereCollider
|
||||
{
|
||||
Transform = actor.Transform,
|
||||
@@ -336,10 +336,10 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
var collider = new CapsuleCollider
|
||||
{
|
||||
Transform = actor.Transform,
|
||||
Position = actor.Box.Center,
|
||||
Position = actor.BoundingBox.Center,
|
||||
|
||||
// Size the capsule to best fit the actor
|
||||
Radius = (float)actor.Sphere.Radius / Mathf.Max((float)actor.Scale.MaxValue, 0.0001f) * 0.707f,
|
||||
Radius = (float)actor.BoundingSphere.Radius / Mathf.Max((float)actor.Scale.MaxValue, 0.0001f) * 0.707f,
|
||||
Height = 100f,
|
||||
};
|
||||
spawner(collider);
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace FlaxEngine.Tools
|
||||
|
||||
public override bool IsControllingMouse => IsPainting;
|
||||
|
||||
public override BoundingSphere FocusBounds => _cloth?.Sphere ?? base.FocusBounds;
|
||||
public override BoundingSphere FocusBounds => _cloth?.BoundingSphere ?? base.FocusBounds;
|
||||
|
||||
public override void Update(float dt)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ struct GeometryLookup
|
||||
static bool Search(Actor* actor, GeometryLookup& lookup)
|
||||
{
|
||||
// Early out if object is not intersecting with the foliage brush bounds
|
||||
if (!actor->GetIsActive() || !actor->GetBox().Intersects(lookup.Brush))
|
||||
if (!actor->GetIsActive() || !actor->GetBoundingBox().Intersects(lookup.Brush))
|
||||
return true;
|
||||
|
||||
const auto brush = lookup.Brush;
|
||||
|
||||
@@ -487,7 +487,7 @@ namespace FlaxEditor.Tools
|
||||
public override bool IsControllingMouse => IsPainting;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override BoundingSphere FocusBounds => _selectedModel != null ? _selectedModel.Sphere : base.FocusBounds;
|
||||
public override BoundingSphere FocusBounds => _selectedModel != null ? _selectedModel.BoundingSphere : base.FocusBounds;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Update(float dt)
|
||||
@@ -598,7 +598,7 @@ namespace FlaxEditor.Tools
|
||||
var vertexScale = Mathf.Lerp(0.005f, 0.01f, Mathf.Saturate(distanceScale));
|
||||
var modelScaleMatrix = Matrix.Scaling(_gizmoMode.PreviewVertexSize * vertexScale);
|
||||
var brushSphere = new BoundingSphere(_hitLocation, _gizmoMode.BrushSize * 0.5f);
|
||||
var lodIndex = _gizmoMode.ModelLOD == -1 ? RenderTools.ComputeModelLOD(_selectedModel.Model, ref renderContext.View.Position, (float)_selectedModel.Sphere.Radius, ref renderContext) : _gizmoMode.ModelLOD;
|
||||
var lodIndex = _gizmoMode.ModelLOD == -1 ? RenderTools.ComputeModelLOD(_selectedModel.Model, ref renderContext.View.Position, (float)_selectedModel.BoundingSphere.Radius, ref renderContext) : _gizmoMode.ModelLOD;
|
||||
lodIndex = Mathf.Clamp(lodIndex, 0, meshDatas.Length - 1);
|
||||
var lodData = meshDatas[lodIndex];
|
||||
if (lodData != null)
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace FlaxEditor.Actions
|
||||
{
|
||||
if (_nodeParents[i] is ActorNode node && node.Actor && node.Actor.Scene && node.AffectsNavigationWithChildren)
|
||||
{
|
||||
var bounds = node.Actor.BoxWithChildren;
|
||||
var bounds = node.Actor.BoundingBoxWithChildren;
|
||||
Navigation.BuildNavMesh(bounds, options.General.AutoRebuildNavMeshTimeoutMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ namespace FlaxEditor.Utilities
|
||||
transforms[i] = nodes[i].Transform;
|
||||
if (nodes[i] is ActorNode actorNode)
|
||||
{
|
||||
bounds = BoundingBox.Merge(bounds, actorNode.Actor.BoxWithChildren);
|
||||
bounds = BoundingBox.Merge(bounds, actorNode.Actor.BoundingBoxWithChildren);
|
||||
}
|
||||
}
|
||||
return transforms;
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
if (_showNodes)
|
||||
{
|
||||
// Draw bounding box at the node locations
|
||||
var boxSize = Mathf.Min(1.0f, _previewModel.Sphere.Radius / 100.0f);
|
||||
var boxSize = Mathf.Min(1.0f, _previewModel.BoundingSphere.Radius / 100.0f);
|
||||
var localBox = new OrientedBoundingBox(new Vector3(-boxSize), new Vector3(boxSize));
|
||||
for (int nodeIndex = 0; nodeIndex < pose.Length; nodeIndex++)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Draw bounds
|
||||
if (_showBounds)
|
||||
{
|
||||
DebugDrawBounds(_previewModel.Box);
|
||||
DebugDrawBounds(_previewModel.BoundingBox);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
/// </summary>
|
||||
public void ResetCamera()
|
||||
{
|
||||
ViewportCamera.SetArcBallView(_previewModel.Box);
|
||||
ViewportCamera.SetArcBallView(_previewModel.BoundingBox);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
/// </summary>
|
||||
public void ResetCamera()
|
||||
{
|
||||
ViewportCamera.SetArcBallView(StaticModel.Model != null ? StaticModel.Box : AnimatedModel.Box);
|
||||
ViewportCamera.SetArcBallView(StaticModel.Model != null ? StaticModel.BoundingBox : AnimatedModel.BoundingBox);
|
||||
}
|
||||
|
||||
private void OnBegin(RenderTask task, GPUContext context)
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Draw bounds
|
||||
if (_showBounds)
|
||||
{
|
||||
DebugDrawBounds(_previewModel.Box);
|
||||
DebugDrawBounds(_previewModel.BoundingBox);
|
||||
}
|
||||
|
||||
// Draw normals
|
||||
@@ -395,7 +395,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Based on RenderTools::ComputeModelLOD
|
||||
CreateProjectionMatrix(out var projectionMatrix);
|
||||
float screenMultiple = 0.5f * Mathf.Max(projectionMatrix.M11, projectionMatrix.M22);
|
||||
var sphere = PreviewActor.Sphere;
|
||||
var sphere = PreviewActor.BoundingSphere;
|
||||
var viewOrigin = ViewPosition;
|
||||
var distSqr = Vector3.DistanceSquared(ref sphere.Center, ref viewOrigin);
|
||||
var screenRadiusSquared = Mathf.Square(screenMultiple * sphere.Radius) / Mathf.Max(1.0f, distSqr);
|
||||
@@ -461,11 +461,11 @@ namespace FlaxEditor.Viewport.Previews
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the camera to focus on a object.
|
||||
/// Resets the camera to focus on an object.
|
||||
/// </summary>
|
||||
public void ResetCamera()
|
||||
{
|
||||
ViewportCamera.SetArcBallView(_previewModel.Box);
|
||||
ViewportCamera.SetArcBallView(_previewModel.BoundingBox);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
|
||||
private void UpdateBoundsModel()
|
||||
{
|
||||
var bounds = _previewEffect.Box;
|
||||
var bounds = _previewEffect.BoundingBox;
|
||||
Transform t = Transform.Identity;
|
||||
t.Translation = bounds.Center;
|
||||
t.Scale = bounds.Size;
|
||||
@@ -221,7 +221,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
public void FitIntoView(float targetSize = 300.0f)
|
||||
{
|
||||
_previewEffect.Scale = Float3.One;
|
||||
float maxSize = Mathf.Max(0.001f, (float)_previewEffect.Box.Size.MaxValue);
|
||||
float maxSize = Mathf.Max(0.001f, (float)_previewEffect.BoundingBox.Size.MaxValue);
|
||||
_previewEffect.Scale = new Float3(targetSize / maxSize);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
switch (key)
|
||||
{
|
||||
case KeyboardKeys.F:
|
||||
ViewportCamera.SetArcBallView(_previewEffect.Box);
|
||||
ViewportCamera.SetArcBallView(_previewEffect.BoundingBox);
|
||||
return true;
|
||||
case KeyboardKeys.Spacebar:
|
||||
PlaySimulation = !PlaySimulation;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace FlaxEditor.Viewport.Previews
|
||||
// Based on RenderTools::ComputeModelLOD
|
||||
CreateProjectionMatrix(out var projectionMatrix);
|
||||
float screenMultiple = 0.5f * Mathf.Max(projectionMatrix.M11, projectionMatrix.M22);
|
||||
var sphere = PreviewActor.Sphere;
|
||||
var sphere = PreviewActor.BoundingSphere;
|
||||
var viewOrigin = ViewPosition;
|
||||
var distSqr = Vector3.DistanceSquared(ref sphere.Center, ref viewOrigin);
|
||||
var screenRadiusSquared = Mathf.Square(screenMultiple * sphere.Radius) / Mathf.Max(1.0f, distSqr);
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace FlaxEditor.Viewport
|
||||
|
||||
// Place the object
|
||||
//var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection;
|
||||
var editorBounds = actor.EditorBoxChildren;
|
||||
var editorBounds = actor.EditorBoundingBoxWithChildren;
|
||||
var bottomToCenter = actor.Position.Y - editorBounds.Minimum.Y;
|
||||
var location = hitLocation + new Vector3(0, bottomToCenter, 0);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace FlaxEditor
|
||||
if (model == null)
|
||||
continue;
|
||||
staticModel.Transform.GetWorld(out world);
|
||||
var bounds = BoundingSphere.FromBox(staticModel.Box);
|
||||
var bounds = BoundingSphere.FromBox(staticModel.BoundingBox);
|
||||
|
||||
// Pick a proper LOD
|
||||
Float3 center = bounds.Center - renderContext.View.Origin;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
// Focus model
|
||||
value.WaitForLoaded(500);
|
||||
Window._preview.ViewportCamera.SetArcBallView(Window._preview.PreviewActor.Sphere);
|
||||
Window._preview.ViewportCamera.SetArcBallView(Window._preview.PreviewActor.BoundingSphere);
|
||||
}
|
||||
|
||||
if (EnablePreviewModelCache)
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace FlaxEditor.Windows
|
||||
|
||||
_pilotActor = actor;
|
||||
_pilotStart = actor.Transform;
|
||||
_pilotBounds = actor.BoxWithChildren;
|
||||
_pilotBounds = actor.BoundingBoxWithChildren;
|
||||
Viewport.ViewTransform = _pilotStart;
|
||||
if (_pilotWidget == null)
|
||||
{
|
||||
|
||||
@@ -394,8 +394,8 @@ void BehaviorTreeMoveToNode::GetAgentSize(Actor* agent, float& outRadius, float&
|
||||
}
|
||||
|
||||
// Estimate actor bounds to extract capsule information
|
||||
const BoundingBox box = agent->GetBox();
|
||||
const BoundingSphere sphere = agent->GetSphere();
|
||||
const BoundingBox box = agent->GetBoundingBox();
|
||||
const BoundingSphere sphere = agent->GetBoundingSphere();
|
||||
outRadius = (float)sphere.Radius;
|
||||
outHeight = (float)box.GetSize().Y;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public:
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -318,7 +318,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -689,7 +689,7 @@ public:
|
||||
public:
|
||||
/// <summary>
|
||||
/// Gets actor bounding sphere that defines 3D space intersecting with the actor (for determination of the visibility for actor).
|
||||
/// [DEPRECATED IN 1.13]
|
||||
/// [Deprecated in 1.13]
|
||||
/// </summary>
|
||||
API_PROPERTY() DEPRECATED("Use GetBoundingSphere instead.") FORCE_INLINE const BoundingSphere& GetSphere() const
|
||||
{
|
||||
@@ -706,7 +706,7 @@ public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets actor bounding box that defines 3D space intersecting with the actor (for determination of the visibility for actor).
|
||||
/// [DEPRECATED IN 1.13]
|
||||
/// [Deprecated in 1.13]
|
||||
/// </summary>
|
||||
API_PROPERTY() DEPRECATED("Use GetBoundingBox instead.") FORCE_INLINE const BoundingBox& GetBox() const
|
||||
{
|
||||
@@ -723,7 +723,7 @@ public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets actor bounding box of the actor including all child actors (children included in recursive way)
|
||||
/// [DEPRECATED IN 1.13]
|
||||
/// [Deprecated in 1.13]
|
||||
/// </summary>
|
||||
API_PROPERTY() DEPRECATED("Use GetBoundingBoxWithChildren instead.") BoundingBox GetBoxWithChildren() const;
|
||||
|
||||
@@ -735,7 +735,7 @@ public:
|
||||
#if USE_EDITOR
|
||||
/// <summary>
|
||||
/// Gets actor bounding box (single actor, no children included) for editor tools.
|
||||
/// [DEPRECATED IN 1.13]
|
||||
/// [Deprecated in 1.13]
|
||||
/// </summary>
|
||||
API_PROPERTY() DEPRECATED("Use GetEditorBoundingBox instead.") virtual BoundingBox GetEditorBox() const;
|
||||
|
||||
@@ -746,7 +746,7 @@ public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets actor bounding box of the actor including all child actors for editor tools.
|
||||
/// [DEPRECATED IN 1.13]
|
||||
/// [Deprecated in 1.13]
|
||||
/// </summary>
|
||||
API_PROPERTY() DEPRECATED("Use GetEditorBoundingBoxWithChildren instead.") BoundingBox GetEditorBoxChildren() const;
|
||||
|
||||
|
||||
@@ -1216,7 +1216,7 @@ void AnimatedModel::OnDebugDraw()
|
||||
ModelInstanceActor::OnDebugDraw();
|
||||
}
|
||||
|
||||
BoundingBox AnimatedModel::GetEditorBox() const
|
||||
BoundingBox AnimatedModel::GetEditorBoundingBox() const
|
||||
{
|
||||
if (SkinnedModel)
|
||||
SkinnedModel->WaitForLoaded(100);
|
||||
|
||||
@@ -479,7 +479,7 @@ public:
|
||||
#if USE_EDITOR
|
||||
void OnDebugDrawSelected() override;
|
||||
void OnDebugDraw() override;
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
#endif
|
||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
|
||||
@@ -333,7 +333,7 @@ void Camera::BeginPlay(SceneBeginData* data)
|
||||
Actor::BeginPlay(data);
|
||||
}
|
||||
|
||||
BoundingBox Camera::GetEditorBox() const
|
||||
BoundingBox Camera::GetEditorBoundingBox() const
|
||||
{
|
||||
const Vector3 size(100);
|
||||
const Vector3 pos = _transform.Translation + _transform.Orientation * Vector3::Forward * 30.0f;
|
||||
|
||||
@@ -257,7 +257,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
bool HasContentLoaded() const override;
|
||||
void Draw(RenderContext& renderContext) override;
|
||||
void OnDebugDrawSelected() override;
|
||||
|
||||
@@ -53,7 +53,7 @@ void Decal::OnDebugDrawSelected()
|
||||
Actor::OnDebugDrawSelected();
|
||||
}
|
||||
|
||||
BoundingBox Decal::GetEditorBox() const
|
||||
BoundingBox Decal::GetEditorBoundingBox() const
|
||||
{
|
||||
const Vector3 size(10.0f);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
void OnDebugDrawSelected() override;
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
#endif
|
||||
void OnLayerChanged() override;
|
||||
void Draw(RenderContext& renderContext) override;
|
||||
|
||||
@@ -9,7 +9,7 @@ EmptyActor::EmptyActor(const SpawnParams& params)
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
BoundingBox EmptyActor::GetEditorBox() const
|
||||
BoundingBox EmptyActor::GetEditorBoundingBox() const
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -14,7 +14,7 @@ class FLAXENGINE_API EmptyActor : public Actor
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
@@ -152,7 +152,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -141,7 +141,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
void OnEnable() override;
|
||||
void OnDisable() override;
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -57,7 +57,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -44,9 +44,9 @@ BoundingBox SceneNavigation::GetNavigationBounds()
|
||||
if (Volumes.IsEmpty())
|
||||
return BoundingBox::Empty;
|
||||
PROFILE_CPU_NAMED("GetNavigationBounds");
|
||||
auto box = Volumes[0]->GetBox();
|
||||
auto box = Volumes[0]->GetBoundingBox();
|
||||
for (int32 i = 1; i < Volumes.Count(); i++)
|
||||
BoundingBox::Merge(box, Volumes[i]->GetBox(), box);
|
||||
BoundingBox::Merge(box, Volumes[i]->GetBoundingBox(), box);
|
||||
return box;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ NavMeshBoundsVolume* SceneNavigation::FindNavigationBoundsOverlap(const Bounding
|
||||
NavMeshBoundsVolume* result = nullptr;
|
||||
for (int32 i = 0; i < Volumes.Count(); i++)
|
||||
{
|
||||
if (Volumes[i]->GetBox().Intersects(bounds))
|
||||
if (Volumes[i]->GetBoundingBox().Intersects(bounds))
|
||||
{
|
||||
result = Volumes[i];
|
||||
break;
|
||||
|
||||
@@ -184,7 +184,7 @@ void SceneRendering::AddActor(Actor* a, int32& key)
|
||||
auto& e = list[key];
|
||||
e.Actor = a;
|
||||
e.LayerMask = a->GetLayerMask();
|
||||
e.Bounds = a->GetSphere();
|
||||
e.Bounds = a->GetBoundingSphere();
|
||||
e.NoCulling = a->_drawNoCulling;
|
||||
for (auto* listener : _listeners)
|
||||
listener->OnSceneRenderingAddActor(a);
|
||||
@@ -207,7 +207,7 @@ void SceneRendering::UpdateActor(Actor* a, int32& key, ISceneRenderingListener::
|
||||
if (flags & ISceneRenderingListener::Layer)
|
||||
e.LayerMask = a->GetLayerMask();
|
||||
if (flags & ISceneRenderingListener::Bounds)
|
||||
e.Bounds = a->GetSphere();
|
||||
e.Bounds = a->GetBoundingSphere();
|
||||
}
|
||||
}
|
||||
if (lock)
|
||||
|
||||
@@ -251,7 +251,7 @@ struct NavSceneRasterizer
|
||||
return;
|
||||
PROFILE_CPU_NAMED("SphereCollider");
|
||||
|
||||
const BoundingSphere sphere = sphereCollider->GetSphere();
|
||||
const BoundingSphere sphere = sphereCollider->GetBoundingSphere();
|
||||
TriangulateSphere(VertexBuffer, IndexBuffer, sphere);
|
||||
RasterizeTriangles();
|
||||
}
|
||||
@@ -261,7 +261,7 @@ struct NavSceneRasterizer
|
||||
return;
|
||||
PROFILE_CPU_NAMED("CapsuleCollider");
|
||||
|
||||
const BoundingBox box = capsuleCollider->GetBox();
|
||||
const BoundingBox box = capsuleCollider->GetBoundingBox();
|
||||
TriangulateBox(VertexBuffer, IndexBuffer, box);
|
||||
RasterizeTriangles();
|
||||
}
|
||||
@@ -411,7 +411,7 @@ bool GenerateTile(NavMesh* navMesh, NavMeshRuntime* runtime, int32 x, int32 y, B
|
||||
for (Actor* actor : scene->Navigation.Actors)
|
||||
{
|
||||
BoundingBox actorBoxNavMesh;
|
||||
BoundingBox::Transform(actor->GetBox(), rasterizer.WorldToNavMesh, actorBoxNavMesh);
|
||||
BoundingBox::Transform(actor->GetBoundingBox(), rasterizer.WorldToNavMesh, actorBoxNavMesh);
|
||||
if (actorBoxNavMesh.Intersects(rasterizer.TileBoundsNavMesh) &&
|
||||
actor->IsActiveInHierarchy() &&
|
||||
EnumHasAllFlags(actor->GetStaticFlags(), StaticFlags::Navigation))
|
||||
@@ -963,10 +963,10 @@ void BuildDirtyBounds(Scene* scene, NavMesh* navMesh, const BoundingBox& dirtyBo
|
||||
for (const NavMeshBoundsVolume* volume : scene->Navigation.Volumes)
|
||||
{
|
||||
if (!volume->AgentsMask.IsNavMeshSupported(navMesh->Properties) ||
|
||||
!volume->GetBox().Intersects(dirtyBoundsNavMesh))
|
||||
!volume->GetBoundingBox().Intersects(dirtyBoundsNavMesh))
|
||||
continue;
|
||||
auto& bounds = volumes.AddOne();
|
||||
BoundingBox::Transform(volume->GetBox(), worldToNavMesh, bounds);
|
||||
BoundingBox::Transform(volume->GetBoundingBox(), worldToNavMesh, bounds);
|
||||
}
|
||||
|
||||
Array<TileId> unusedTiles;
|
||||
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -1141,7 +1141,7 @@ void Particles::DrawParticles(RenderContextBatch& renderContextBatch, ParticleEf
|
||||
|
||||
// Drawing assumes that all views within a batch have the same Origin
|
||||
const Vector3& viewOrigin = renderContextBatch.GetMainContext().View.Origin;
|
||||
BoundingSphere bounds = effect->GetSphere();
|
||||
BoundingSphere bounds = effect->GetBoundingSphere();
|
||||
bounds.Center -= viewOrigin;
|
||||
|
||||
// Cull particles against all views
|
||||
|
||||
@@ -34,13 +34,13 @@ void BoxCollider::AutoResize(bool globalOrientation = true)
|
||||
// Hacky way to get unrotated bounded box of parent
|
||||
const Quaternion parentOrientation = parent->GetOrientation();
|
||||
parent->SetOrientation(Quaternion::Identity);
|
||||
BoundingBox parentBox = parent->GetBox();
|
||||
BoundingBox parentBox = parent->GetBoundingBox();
|
||||
parent->SetOrientation(parentOrientation);
|
||||
|
||||
for (const Actor* sibling : parent->Children)
|
||||
{
|
||||
if (sibling != this)
|
||||
BoundingBox::Merge(parentBox, sibling->GetBoxWithChildren(), parentBox);
|
||||
BoundingBox::Merge(parentBox, sibling->GetBoundingBoxWithChildren(), parentBox);
|
||||
}
|
||||
const Vector3 parentSize = parentBox.GetSize();
|
||||
const Vector3 parentCenter = parentBox.GetCenter() - parent->GetPosition();
|
||||
|
||||
@@ -216,8 +216,8 @@ struct ClothSettings
|
||||
clothTrans.LocalToWorld(c, c);
|
||||
|
||||
// Setup bounds
|
||||
BoundingBox::FromPoints(boundsCorners, 8, const_cast<BoundingBox&>(Actor->GetBox()));
|
||||
BoundingSphere::FromBox(Actor->GetBox(), const_cast<BoundingSphere&>(Actor->GetSphere()));
|
||||
BoundingBox::FromPoints(boundsCorners, 8, const_cast<BoundingBox&>(Actor->GetBoundingBox()));
|
||||
BoundingSphere::FromBox(Actor->GetBoundingBox(), const_cast<BoundingSphere&>(Actor->GetBoundingSphere()));
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
if (GLOBAL_SDF_ACTOR_IS_STATIC(a) && ObjectTypes.Contains(a->GetTypeHandle()))
|
||||
{
|
||||
ScopeWriteLock lock(Locker);
|
||||
OnSceneRenderingDirty(a->GetBox());
|
||||
OnSceneRenderingDirty(a->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
ScopeWriteLock lock(Locker);
|
||||
if (flags != DrawModes && flags != Layer && flags != StaticFlags)
|
||||
OnSceneRenderingDirty(BoundingBox::FromSphere(prevBounds));
|
||||
OnSceneRenderingDirty(a->GetBox());
|
||||
OnSceneRenderingDirty(a->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ public:
|
||||
if (GLOBAL_SDF_ACTOR_IS_STATIC(a) && ObjectTypes.Contains(a->GetTypeHandle()))
|
||||
{
|
||||
ScopeWriteLock lock(Locker);
|
||||
OnSceneRenderingDirty(a->GetBox());
|
||||
OnSceneRenderingDirty(a->GetBoundingBox());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ void ProbesRendererService::OnRender(RenderTask* task, GPUContext* context)
|
||||
{
|
||||
auto envProbe = (EnvironmentProbe*)_current.Actor.Get();
|
||||
Vector3 position = envProbe->GetTransform().LocalToWorld(envProbe->CaptureOffset);
|
||||
float radius = (float)envProbe->GetSphere().Radius;
|
||||
float radius = (float)envProbe->GetBoundingSphere().Radius;
|
||||
float nearPlane = Math::Max(METERS_TO_UNITS(0.001f), envProbe->CaptureNearPlane);
|
||||
|
||||
// Adjust far plane distance
|
||||
|
||||
@@ -396,7 +396,7 @@ public:
|
||||
void OnSceneRenderingAddActor(Actor* a) override
|
||||
{
|
||||
if (a->HasStaticFlag(StaticFlags::Shadow))
|
||||
DirtyStaticBounds(a->GetSphere());
|
||||
DirtyStaticBounds(a->GetBoundingSphere());
|
||||
}
|
||||
|
||||
void OnSceneRenderingUpdateActor(Actor* a, const BoundingSphere& prevBounds, UpdateFlags flags) override
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
if (a->HasStaticFlag(StaticFlags::Shadow))
|
||||
{
|
||||
// TODO: skip actors that don't cast shadows (eg. particles)
|
||||
BoundingSphere bounds = a->GetSphere();
|
||||
BoundingSphere bounds = a->GetBoundingSphere();
|
||||
if (bounds != prevBounds)
|
||||
{
|
||||
// Avoid dirtying twice when bounds are close to each other
|
||||
@@ -418,14 +418,14 @@ public:
|
||||
}
|
||||
else if (flags & StaticFlags)
|
||||
{
|
||||
DirtyStaticBounds(a->GetSphere());
|
||||
DirtyStaticBounds(a->GetBoundingSphere());
|
||||
}
|
||||
}
|
||||
|
||||
void OnSceneRenderingRemoveActor(Actor* a) override
|
||||
{
|
||||
if (a->HasStaticFlag(StaticFlags::Shadow))
|
||||
DirtyStaticBounds(a->GetSphere());
|
||||
DirtyStaticBounds(a->GetBoundingSphere());
|
||||
}
|
||||
|
||||
void OnSceneRenderingClear(SceneRendering* scene) override
|
||||
|
||||
@@ -63,7 +63,7 @@ UICanvas::UICanvas(const SpawnParams& params)
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
BoundingBox UICanvas::GetEditorBox() const
|
||||
BoundingBox UICanvas::GetEditorBoundingBox() const
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -14,7 +14,7 @@ class FLAXENGINE_API UICanvas : public Actor
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
#endif
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
@@ -60,7 +60,7 @@ UIControl::UIControl(const SpawnParams& params)
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
BoundingBox UIControl::GetEditorBox() const
|
||||
BoundingBox UIControl::GetEditorBoundingBox() const
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override;
|
||||
BoundingBox GetEditorBoundingBox() const override;
|
||||
#endif
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
@@ -241,12 +241,11 @@ private:
|
||||
public:
|
||||
// [Actor]
|
||||
#if USE_EDITOR
|
||||
BoundingBox GetEditorBox() const override
|
||||
BoundingBox GetEditorBoundingBox() const override
|
||||
{
|
||||
const Vector3 size(50);
|
||||
return BoundingBox(_transform.Translation - size, _transform.Translation + size);
|
||||
}
|
||||
|
||||
void OnDebugDrawSelected() override;
|
||||
#endif
|
||||
bool IntersectsItself(const Ray& ray, Real& distance, Vector3& normal) override;
|
||||
|
||||
Reference in New Issue
Block a user