OgrePixelCountLodStrategy.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 __Pixel_Count_Lod_Strategy_H__
#define __Pixel_Count_Lod_Strategy_H__
#include "OgrePrerequisites.h"
#include "OgreLodStrategy.h"
#include "OgreSingleton.h"
#include "OgreNode.h"
namespace Ogre {
class _OgreExport PixelCountLodStrategy : public LodStrategy
{
protected:
virtual Real getValueImpl(const MovableObject *movableObject, const Camera *camera) const = 0;
public:
PixelCountLodStrategy(const String& name);
virtual Real getBaseValue() const;
virtual Real transformBias(Real factor) 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;
};
class _OgreExport AbsolutePixelCountLodStrategy : public PixelCountLodStrategy, public Singleton<AbsolutePixelCountLodStrategy>
{
public:
AbsolutePixelCountLodStrategy();
Real getValueImpl(const MovableObject *movableObject, const Camera *camera) const;
static AbsolutePixelCountLodStrategy& getSingleton(void);
static AbsolutePixelCountLodStrategy* getSingletonPtr(void);
};
class _OgreExport ScreenRatioPixelCountLodStrategy : public PixelCountLodStrategy, public Singleton<ScreenRatioPixelCountLodStrategy>
{
public:
ScreenRatioPixelCountLodStrategy();
Real getValueImpl(const MovableObject *movableObject, const Camera *camera) const;
static ScreenRatioPixelCountLodStrategy& getSingleton(void);
static ScreenRatioPixelCountLodStrategy* 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::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::AbsolutePixelCountLodStrategy
Definition: OgrePixelCountLodStrategy.h:77
OgreLodStrategy.h
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::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::PixelCountLodStrategy
Abstract base class for level of detail strategy based on pixel count approximations from bounding sp...
Definition: OgrePixelCountLodStrategy.h:46
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
Ogre::ScreenRatioPixelCountLodStrategy
Definition: OgrePixelCountLodStrategy.h:122

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