mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Some code cleanup
This commit is contained in:
parent
31a98c5b40
commit
233d92c315
7 changed files with 15 additions and 51 deletions
|
@ -11,10 +11,6 @@
|
|||
#ifndef hifi_Base3DOverlay_h
|
||||
#define hifi_Base3DOverlay_h
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
|
||||
#include <BoxBase.h>
|
||||
#include <Transform.h>
|
||||
|
||||
#include "Overlay.h"
|
||||
|
|
|
@ -8,12 +8,13 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
// include this before QGLWidget, which includes an earlier version of OpenGL
|
||||
#include "InterfaceConfig.h"
|
||||
|
||||
#include "Overlay.h"
|
||||
|
||||
#include <NumericalConstants.h>
|
||||
#include <RegisteredMetaTypes.h>
|
||||
|
||||
static const xColor DEFAULT_OVERLAY_COLOR = { 255, 255, 255 };
|
||||
static const float DEFAULT_ALPHA = 0.7f;
|
||||
|
||||
Overlay::Overlay() :
|
||||
_renderItemID(render::Item::INVALID_ITEM_ID),
|
||||
|
|
|
@ -11,21 +11,11 @@
|
|||
#ifndef hifi_Overlay_h
|
||||
#define hifi_Overlay_h
|
||||
|
||||
// include this before QGLWidget, which includes an earlier version of OpenGL
|
||||
#include "InterfaceConfig.h"
|
||||
|
||||
#include <QRect>
|
||||
#include <QScriptValue>
|
||||
#include <QString>
|
||||
|
||||
#include <RegisteredMetaTypes.h>
|
||||
#include <SharedUtil.h> // for xColor
|
||||
#include <RenderArgs.h>
|
||||
#include <AABox.h>
|
||||
#include <render/Scene.h>
|
||||
|
||||
const xColor DEFAULT_OVERLAY_COLOR = { 255, 255, 255 };
|
||||
const float DEFAULT_ALPHA = 0.7f;
|
||||
class QScriptEngine;
|
||||
class QScriptValue;
|
||||
|
||||
class Overlay : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -37,7 +27,6 @@ public:
|
|||
};
|
||||
|
||||
typedef std::shared_ptr<Overlay> Pointer;
|
||||
|
||||
typedef render::Payload<Overlay> Payload;
|
||||
typedef std::shared_ptr<render::Item::PayloadInterface> PayloadPointer;
|
||||
|
||||
|
|
|
@ -8,16 +8,9 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
// include this before QGLWidget, which includes an earlier version of OpenGL
|
||||
#include "InterfaceConfig.h"
|
||||
|
||||
#include <SharedUtil.h>
|
||||
|
||||
#include "Overlay2D.h"
|
||||
|
||||
|
||||
Overlay2D::Overlay2D() {
|
||||
}
|
||||
#include <RegisteredMetaTypes.h>
|
||||
|
||||
Overlay2D::Overlay2D(const Overlay2D* overlay2D) :
|
||||
Overlay(overlay2D),
|
||||
|
@ -25,9 +18,6 @@ Overlay2D::Overlay2D(const Overlay2D* overlay2D) :
|
|||
{
|
||||
}
|
||||
|
||||
Overlay2D::~Overlay2D() {
|
||||
}
|
||||
|
||||
AABox Overlay2D::getBounds() const {
|
||||
return AABox(glm::vec3(_bounds.x(), _bounds.y(), 0.0f),
|
||||
glm::vec3(_bounds.width(), _bounds.height(), 0.01f));
|
||||
|
|
|
@ -11,14 +11,7 @@
|
|||
#ifndef hifi_Overlay2D_h
|
||||
#define hifi_Overlay2D_h
|
||||
|
||||
// include this before QGLWidget, which includes an earlier version of OpenGL
|
||||
#include "InterfaceConfig.h"
|
||||
|
||||
#include <QRect>
|
||||
#include <QScriptValue>
|
||||
#include <QString>
|
||||
|
||||
#include <SharedUtil.h> // for xColor
|
||||
|
||||
#include "Overlay.h"
|
||||
|
||||
|
@ -26,9 +19,8 @@ class Overlay2D : public Overlay {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Overlay2D();
|
||||
Overlay2D() {}
|
||||
Overlay2D(const Overlay2D* overlay2D);
|
||||
~Overlay2D();
|
||||
|
||||
virtual AABox getBounds() const;
|
||||
|
||||
|
|
|
@ -8,14 +8,13 @@
|
|||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
#include "Overlays.h"
|
||||
|
||||
#include <QScriptValueIterator>
|
||||
|
||||
#include <limits>
|
||||
#include <typeinfo>
|
||||
|
||||
#include <Application.h>
|
||||
#include <avatar/AvatarManager.h>
|
||||
#include <LODManager.h>
|
||||
#include <render/Scene.h>
|
||||
|
||||
#include "BillboardOverlay.h"
|
||||
|
@ -25,7 +24,6 @@
|
|||
#include "Line3DOverlay.h"
|
||||
#include "LocalModelsOverlay.h"
|
||||
#include "ModelOverlay.h"
|
||||
#include "Overlays.h"
|
||||
#include "Rectangle3DOverlay.h"
|
||||
#include "Sphere3DOverlay.h"
|
||||
#include "Grid3DOverlay.h"
|
||||
|
@ -37,7 +35,6 @@ Overlays::Overlays() : _nextOverlayID(1) {
|
|||
}
|
||||
|
||||
Overlays::~Overlays() {
|
||||
|
||||
{
|
||||
QWriteLocker lock(&_lock);
|
||||
QWriteLocker deleteLock(&_deleteLock);
|
||||
|
@ -99,9 +96,6 @@ void Overlays::cleanupOverlaysToDelete() {
|
|||
|
||||
void Overlays::renderHUD(RenderArgs* renderArgs) {
|
||||
QReadLocker lock(&_lock);
|
||||
|
||||
auto lodManager = DependencyManager::get<LODManager>();
|
||||
|
||||
foreach(Overlay::Pointer thisOverlay, _overlaysHUD) {
|
||||
if (thisOverlay->is3D()) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
#ifndef hifi_Overlays_h
|
||||
#define hifi_Overlays_h
|
||||
|
||||
#include <QString>
|
||||
#include <QReadWriteLock>
|
||||
#include <QScriptValue>
|
||||
#include <QSignalMapper>
|
||||
|
||||
#include "Base3DOverlay.h"
|
||||
#include "Overlay.h"
|
||||
|
||||
class PickRay;
|
||||
|
||||
class OverlayPropertyResult {
|
||||
public:
|
||||
OverlayPropertyResult();
|
||||
|
@ -48,9 +48,11 @@ void RayToOverlayIntersectionResultFromScriptValue(const QScriptValue& object, R
|
|||
|
||||
class Overlays : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Overlays();
|
||||
~Overlays();
|
||||
|
||||
void init();
|
||||
void update(float deltatime);
|
||||
void renderHUD(RenderArgs* renderArgs);
|
||||
|
|
Loading…
Reference in a new issue