Remove the legacy ViewSystem and some other tangentially related legacy code. (#5558)
Signed-off-by: bosnichd <bosnichd@amazon.com>
This commit is contained in:
@@ -953,14 +953,8 @@ void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3& pos)
|
||||
void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&)
|
||||
{
|
||||
// Don't draw warning icons if they are beyond draw distance
|
||||
if ((dc.camera->GetPosition() - pos).GetLength() > gSettings.viewports.fWarningIconsDrawDistance)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
|
||||
{
|
||||
const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2;
|
||||
@@ -1010,11 +1004,8 @@ void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& l
|
||||
labelColor = QColor(0, 0, 0);
|
||||
}
|
||||
|
||||
float camDist = dc.camera->GetPosition().GetDistance(pos);
|
||||
float maxDist = dc.settings->GetLabelsDistance();
|
||||
if (camDist < dc.settings->GetLabelsDistance() || (dc.flags & DISPLAY_SELECTION_HELPERS))
|
||||
if (dc.flags & DISPLAY_SELECTION_HELPERS)
|
||||
{
|
||||
float range = maxDist / 2.0f;
|
||||
Vec3 c(static_cast<f32>(labelColor.redF()), static_cast<f32>(labelColor.greenF()), static_cast<f32>(labelColor.redF()));
|
||||
if (IsSelected())
|
||||
{
|
||||
@@ -1032,10 +1023,6 @@ void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& l
|
||||
col[1] = c.y;
|
||||
col[2] = c.z;
|
||||
}
|
||||
else if (camDist > range)
|
||||
{
|
||||
col[3] = col[3] * (1.0f - (camDist - range) / range);
|
||||
}
|
||||
|
||||
dc.SetColor(col[0], col[1], col[2], col[3] * alpha);
|
||||
dc.DrawTextLabel(pos, size, GetName().toUtf8().data());
|
||||
@@ -1196,33 +1183,6 @@ bool CBaseObject::CanBeDrawn(const DisplayContext& dc, bool& outDisplaySelection
|
||||
return bResult;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBaseObject::IsInCameraView(const CCamera& camera)
|
||||
{
|
||||
AABB bbox;
|
||||
GetBoundBox(bbox);
|
||||
return (camera.IsAABBVisible_F(AABB(bbox.min, bbox.max)));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
float CBaseObject::GetCameraVisRatio(const CCamera& camera)
|
||||
{
|
||||
AABB bbox;
|
||||
GetBoundBox(bbox);
|
||||
|
||||
static const float defaultVisRatio = 1000.0f;
|
||||
|
||||
const float objectHeightSq = max(1.0f, (bbox.max - bbox.min).GetLengthSquared());
|
||||
const float camdistSq = (bbox.min - camera.GetPosition()).GetLengthSquared();
|
||||
float visRatio = defaultVisRatio;
|
||||
if (camdistSq > FLT_EPSILON)
|
||||
{
|
||||
visRatio = objectHeightSq / camdistSq;
|
||||
}
|
||||
|
||||
return visRatio;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int CBaseObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
|
||||
{
|
||||
|
||||
@@ -674,11 +674,6 @@ protected:
|
||||
//! Returns if the object can be drawn, and if its selection helper should also be drawn.
|
||||
bool CanBeDrawn(const DisplayContext& dc, bool& outDisplaySelectionHelper) const;
|
||||
|
||||
//! Returns if object is in the camera view.
|
||||
virtual bool IsInCameraView(const CCamera& camera);
|
||||
//! Returns vis ratio of object in camera
|
||||
virtual float GetCameraVisRatio(const CCamera& camera);
|
||||
|
||||
// Do basic intersection tests
|
||||
virtual bool IntersectRectBounds(const AABB& bbox);
|
||||
virtual bool IntersectRayBounds(const Ray& ray);
|
||||
|
||||
@@ -31,7 +31,6 @@ struct IRenderer;
|
||||
struct IRenderAuxGeom;
|
||||
struct IIconManager;
|
||||
class CDisplaySettings;
|
||||
class CCamera;
|
||||
class QPoint;
|
||||
|
||||
enum DisplayFlags
|
||||
@@ -66,7 +65,6 @@ struct SANDBOX_API DisplayContext
|
||||
IDisplayViewport* view;
|
||||
IRenderAuxGeom* pRenderAuxGeom;
|
||||
IIconManager* pIconManager;
|
||||
CCamera* camera;
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
AABB box; // Bounding box of volume that need to be repainted.
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
@@ -1138,10 +1138,6 @@ bool DisplayContext::IsVisible(const AABB& bounds)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return camera->IsAABBVisible_F(AABB(bounds.min, bounds.max));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,16 +98,8 @@ void CLineGizmo::Display(DisplayContext& dc)
|
||||
Vec3 pos = 0.5f * (m_point[0] + m_point[1]);
|
||||
//dc.renderer->DrawLabelEx( p3+Vec3(0,0,0.3f),1.2f,col,true,true,m_name );
|
||||
|
||||
float camDist = dc.camera->GetPosition().GetDistance(pos);
|
||||
float maxDist = dc.settings->GetLabelsDistance();
|
||||
if (camDist < dc.settings->GetLabelsDistance())
|
||||
{
|
||||
float range = maxDist / 2.0f;
|
||||
float col[4] = { m_color[0].r, m_color[0].g, m_color[0].b, m_color[0].a };
|
||||
if (camDist > range)
|
||||
{
|
||||
col[3] = col[3] * (1.0f - (camDist - range) / range);
|
||||
}
|
||||
dc.SetColor(col[0], col[1], col[2], col[3]);
|
||||
dc.DrawTextLabel(pos + Vec3(0, 0, 0.2f), 1.2f, m_name.toUtf8().data());
|
||||
}
|
||||
|
||||
@@ -1488,11 +1488,7 @@ bool CObjectManager::HitTestObject(CBaseObject* obj, HitContext& hc)
|
||||
if (!bSelectionHelperHit)
|
||||
{
|
||||
// Fast checking.
|
||||
if (hc.camera && !obj->IsInCameraView(*hc.camera))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (hc.bounds && !obj->IntersectRectBounds(*hc.bounds))
|
||||
if (hc.bounds && !obj->IntersectRectBounds(*hc.bounds))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user