overte-HifiExperiments/libraries/render-utils/src/AbstractViewStateInterface.h
2015-05-26 17:32:41 -07:00

64 lines
2 KiB
C++

//
// AbstractViewStateInterface.h
// interface/src/renderer
//
// Created by Brad Hefta-Gaub on 12/16/14.
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_AbstractViewStateInterface_h
#define hifi_AbstractViewStateInterface_h
#include <glm/glm.hpp>
#include <functional>
#include <QtGlobal>
class Transform;
class QThread;
class ViewFrustum;
class PickRay;
class EnvironmentData;
/// Interface provided by Application to other objects that need access to the current view state details
class AbstractViewStateInterface {
public:
/// Returns the shadow distances for the current view state
virtual const glm::vec3& getShadowDistances() const = 0;
/// gets the current view frustum for rendering the view state
virtual ViewFrustum* getCurrentViewFrustum() = 0;
/// overrides environment data
virtual void overrideEnvironmentData(const EnvironmentData& newData) = 0;
virtual void endOverrideEnvironmentData() = 0;
/// gets the shadow view frustum for rendering the view state
virtual ViewFrustum* getShadowViewFrustum() = 0;
virtual bool getShadowsEnabled() = 0;
virtual bool getCascadeShadowsEnabled() = 0;
virtual QThread* getMainThread() = 0;
virtual const Transform& getViewTransform() const = 0;
virtual void setupWorldLight() = 0;
virtual bool shouldRenderMesh(float largestDimension, float distanceToCamera) = 0;
virtual float getSizeScale() const = 0;
virtual int getBoundaryLevelAdjust() const = 0;
virtual PickRay computePickRay(float x, float y) const = 0;
virtual const glm::vec3& getAvatarPosition() const = 0;
virtual void postLambdaEvent(std::function<void()> f) = 0;
virtual qreal getDevicePixelRatio() = 0;
static AbstractViewStateInterface* instance();
static void setInstance(AbstractViewStateInterface* instance);
};
#endif // hifi_AbstractViewStateInterface_h