OGRE  master
Object-Oriented Graphics Rendering Engine
Ogre::DistanceLodStrategyBase Class Referenceabstract

Level of detail strategy based on distance from camera. More...

#include <OgreDistanceLodStrategy.h>

+ Inheritance diagram for Ogre::DistanceLodStrategyBase:

Public Member Functions

 DistanceLodStrategyBase (const String &name)
 Default constructor. More...
 
Real getBaseValue () const override
 Get the value of the first (highest) level of detail. More...
 
ushort getIndex (Real value, const Mesh::MeshLodUsageList &meshLodUsageList) const override
 Get the index of the LOD usage which applies to a given value. More...
 
ushort getIndex (Real value, const Material::LodValueList &materialLodValueList) const override
 Get the index of the LOD usage which applies to a given value. More...
 
virtual Real getSquaredDepth (const MovableObject *movableObject, const Ogre::Camera *camera) const =0
 Get the squared distance between the camera and the LOD object. More...
 
bool isReferenceViewEnabled () const
 Determine if use of the reference view is enabled. More...
 
bool isSorted (const Mesh::LodValueList &values) const override
 Determine if the LOD values are sorted from greatest detail to least detail. More...
 
void setReferenceView (Real viewportWidth, Real viewportHeight, Radian fovY)
 Sets the reference view upon which the distances were based. More...
 
void setReferenceViewEnabled (bool value)
 Enables to disables use of the reference view. More...
 
void sort (Mesh::MeshLodUsageList &meshLodUsageList) const override
 Sort mesh LOD usage list from greatest to least detail. More...
 
Real transformBias (Real factor) const override
 Transform LOD bias so it only needs to be multiplied by the LOD value. More...
 
Real transformUserValue (Real userValue) const override
 Transform user supplied value to internal value. More...
 
- Public Member Functions inherited from Ogre::LodStrategy
 LodStrategy (const String &name)
 Constructor accepting name. More...
 
virtual ~LodStrategy ()
 Virtual destructor. More...
 
void assertSorted (const Mesh::LodValueList &values) const
 Assert that the LOD values are sorted from greatest detail to least detail. More...
 
const StringgetName () const
 Get the name of this strategy. More...
 
Real getValue (const MovableObject *movableObject, const Camera *camera) const
 Compute the LOD value for a given movable object relative to a given camera. More...
 

Detailed Description

Level of detail strategy based on distance from camera.

This is an abstract base class for DistanceLodBoxStrategy and DistanceLodSphereStrategy.

The purpose of the reference view is to ensure a consistent experience for all users. Monitors of different resolutions and aspect ratios will each have different results for the distance queries.

It depends on gameplay testing. If all testers had 16:9 monitors and 110° FOV, then that's the value you should enter (to ensure as much as possible the experience stays consistent for all other users who don't have a 16:9 monitor and/or use a different FOV).
If all your testers had 4:3 monitors, then enter a 4:3 resolution.
If all your testers had varying resolutions or you just didn't care, then this feature is useless for you and should be disabled (default: disabled).

Constructor & Destructor Documentation

◆ DistanceLodStrategyBase()

Ogre::DistanceLodStrategyBase::DistanceLodStrategyBase ( const String name)

Default constructor.

Member Function Documentation

◆ getBaseValue()

Real Ogre::DistanceLodStrategyBase::getBaseValue ( ) const
overridevirtual

Get the value of the first (highest) level of detail.

Implements Ogre::LodStrategy.

◆ transformBias()

Real Ogre::DistanceLodStrategyBase::transformBias ( Real  factor) const
overridevirtual

Transform LOD bias so it only needs to be multiplied by the LOD value.

Implements Ogre::LodStrategy.

◆ transformUserValue()

Real Ogre::DistanceLodStrategyBase::transformUserValue ( Real  userValue) const
overridevirtual

Transform user supplied value to internal value.

By default, performs no transformation.

Do not throw exceptions for invalid values here, as the LOD strategy may be changed such that the values become valid.

Reimplemented from Ogre::LodStrategy.

◆ getIndex() [1/2]

ushort Ogre::DistanceLodStrategyBase::getIndex ( Real  value,
const Mesh::MeshLodUsageList meshLodUsageList 
) const
overridevirtual

Get the index of the LOD usage which applies to a given value.

Implements Ogre::LodStrategy.

◆ getIndex() [2/2]

ushort Ogre::DistanceLodStrategyBase::getIndex ( Real  value,
const Material::LodValueList materialLodValueList 
) const
overridevirtual

Get the index of the LOD usage which applies to a given value.

Implements Ogre::LodStrategy.

◆ sort()

void Ogre::DistanceLodStrategyBase::sort ( Mesh::MeshLodUsageList meshLodUsageList) const
overridevirtual

Sort mesh LOD usage list from greatest to least detail.

Implements Ogre::LodStrategy.

◆ isSorted()

bool Ogre::DistanceLodStrategyBase::isSorted ( const Mesh::LodValueList values) const
overridevirtual

Determine if the LOD values are sorted from greatest detail to least detail.

Implements Ogre::LodStrategy.

◆ getSquaredDepth()

virtual Real Ogre::DistanceLodStrategyBase::getSquaredDepth ( const MovableObject movableObject,
const Ogre::Camera camera 
) const
pure virtual

Get the squared distance between the camera and the LOD object.

Implemented in Ogre::DistanceLodBoxStrategy, and Ogre::DistanceLodSphereStrategy.

◆ setReferenceView()

void Ogre::DistanceLodStrategyBase::setReferenceView ( Real  viewportWidth,
Real  viewportHeight,
Radian  fovY 
)

Sets the reference view upon which the distances were based.

Note
This automatically enables use of the reference view.
There is no corresponding get method for these values as they are not saved, but used to compute a reference value.

◆ setReferenceViewEnabled()

void Ogre::DistanceLodStrategyBase::setReferenceViewEnabled ( bool  value)

Enables to disables use of the reference view.

Note
Do not enable use of the reference view before setting it.

◆ isReferenceViewEnabled()

bool Ogre::DistanceLodStrategyBase::isReferenceViewEnabled ( ) const

Determine if use of the reference view is enabled.


The documentation for this class was generated from the following file: