OgreDistanceLodStrategy.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Distance_Lod_Strategy_H__
#define __Distance_Lod_Strategy_H__
#include "OgrePrerequisites.h"
#include "OgreLodStrategy.h"
#include "OgreSingleton.h"
#include "OgreNode.h"
namespace Ogre {
class _OgreExport DistanceLodStrategy : public LodStrategy
{
protected:
virtual Real getValueImpl(const MovableObject *movableObject, const Camera *camera) const;
public:
DistanceLodStrategy(const String& name);
virtual Real getBaseValue() const;
virtual Real transformBias(Real factor) const;
virtual Real transformUserValue(Real userValue) const;
virtual ushort getIndex(Real value, const Mesh::MeshLodUsageList& meshLodUsageList) const;
virtual ushort getIndex(Real value, const Material::LodValueList& materialLodValueList) const;
virtual void sort(Mesh::MeshLodUsageList& meshLodUsageList) const;
virtual bool isSorted(const Mesh::LodValueList& values) const;
virtual Real getSquaredDepth(const MovableObject *movableObject, const Ogre::Camera *camera) const = 0;
void setReferenceView(Real viewportWidth, Real viewportHeight, Radian fovY);
void setReferenceViewEnabled(bool value);
bool isReferenceViewEnabled() const;
private:
bool mReferenceViewEnabled;
Real mReferenceViewValue;
};
class _OgreExport DistanceLodSphereStrategy : public DistanceLodStrategy, public Singleton<DistanceLodSphereStrategy>
{
public:
DistanceLodSphereStrategy();
Real getSquaredDepth(const MovableObject *movableObject, const Ogre::Camera *camera) const;
static DistanceLodSphereStrategy& getSingleton(void);
static DistanceLodSphereStrategy* getSingletonPtr(void);
};
class _OgreExport DistanceLodBoxStrategy : public DistanceLodStrategy, public Singleton<DistanceLodBoxStrategy>
{
public:
DistanceLodBoxStrategy();
Real getSquaredDepth(const MovableObject *movableObject, const Ogre::Camera *camera) const;
static DistanceLodBoxStrategy& getSingleton(void);
static DistanceLodBoxStrategy* getSingletonPtr(void);
};
} // namespace
#endif
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::MovableObject
Abstract class defining a movable object in a scene.
Definition: OgreMovableObject.h:60
Ogre::LodStrategy
Strategy for determining level of detail.
Definition: OgreLodStrategy.h:54
Ogre::Material::LodValueList
vector< Real >::type LodValueList
distance list used to specify LOD
Definition: OgreMaterial.h:95
Ogre::DistanceLodSphereStrategy
Level of detail strategy based on distance from camera to an object&#39;s bounding sphere.
Definition: OgreDistanceLodStrategy.h:131
Ogre::DistanceLodStrategy::mReferenceViewEnabled
bool mReferenceViewEnabled
Definition: OgreDistanceLodStrategy.h:107
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::DistanceLodStrategy::mReferenceViewValue
Real mReferenceViewValue
Definition: OgreDistanceLodStrategy.h:108
OgreLodStrategy.h
Ogre::DistanceLodStrategy
Level of detail strategy based on distance from camera.
Definition: OgreDistanceLodStrategy.h:55
OgreSingleton.h
OgreNode.h
OgrePrerequisites.h
Ogre::Mesh::MeshLodUsageList
vector< MeshLodUsage >::type MeshLodUsageList
Definition: OgreMesh.h:103
Ogre::Mesh::LodValueList
vector< Real >::type LodValueList
Definition: OgreMesh.h:102
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::DistanceLodBoxStrategy
Level of detail strategy based on distance from camera to an object&#39;s bounding box.
Definition: OgreDistanceLodStrategy.h:193
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.