VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtModelScaler Class Reference

The DtModelScaler prepares the data from the osg camera, osg node, and cull visitor parameters and then passes it to the DtScalingAlgorithm provided to the model scaler. An instance of this class is created each frame for each DtOsgChannel and given to the DtOsgCullVisitorParameters to make it available to the DtOsgCullVisitor and to the DtInstanceManager.

Inheritance diagram for makVrv::DtModelScaler:
Inheritance graph
[legend]

Public Member Functions

 DtModelScaler (DtDe &de, DtScalingAlgorithm *scalingAlgorithm)
 
virtual double calculateScale (const DtOsgCullVisitorParameters &info, const osg::Camera &camera, const osg::Vec3d &position, double modelRadius, DtUniqueID objectElementId) const
 
double calculateScale (const DtOsgCullVisitorParameters &info, const osg::Camera &camera, const osg::Node &node) const
 
const DtScalingAlgorithmscalingAlgorithm () const
 

Protected Member Functions

virtual ~DtModelScaler ()
 

Protected Attributes

DtScalingAlgorithmmyAlgorithm
 
DtDemyDe
 

Private Member Functions

 DtModelScaler ()
 
 DtModelScaler (const DtModelScaler &orig)
 
DtModelScaleroperator= (const DtModelScaler &rhs)
 

Constructor & Destructor Documentation

makVrv::DtModelScaler::DtModelScaler ( DtDe de,
DtScalingAlgorithm scalingAlgorithm 
)

CTOR.

Create a model scaler with the desired scaling algorithm

virtual makVrv::DtModelScaler::~DtModelScaler ( )
protectedvirtual

DTOR - Called from osg::Referenced. This is protected to prevent the accidental creation of the scaler on the stack.

makVrv::DtModelScaler::DtModelScaler ( )
private
makVrv::DtModelScaler::DtModelScaler ( const DtModelScaler orig)
private

Member Function Documentation

virtual double makVrv::DtModelScaler::calculateScale ( const DtOsgCullVisitorParameters info,
const osg::Camera &  camera,
const osg::Vec3d &  position,
double  modelRadius,
DtUniqueID  objectElementId 
) const
virtual

Calculate the scale factor. Override the implementation of this method by registering a custom DtScalingAlgorithm implementation.

Parameters
[in]infois the cull visitor parameters object, which contains the current scale factor setting, as well as other potentially useful information for a scaling algorithm.
[in]camerais the current cull or intersector camera, from which the eyepoint can be found, as well as the viewport, model view and projection matrices, if desired.
[in]positionis the position of the object to be scaled
[in]modelRadiusis the bounding radius of the object to be scaled
[in]objectElementIdis the element ID of the object being scaled, if it exists - check first for (DtUniqueID)0.
Returns
the amount to scale the object
double makVrv::DtModelScaler::calculateScale ( const DtOsgCullVisitorParameters info,
const osg::Camera &  camera,
const osg::Node &  node 
) const

Calculate the scale factor. This is the method called by visitors to determine the scale factor. It extracts the position, modelRadius, and elementID (if any) from the osg::Node and then calls the overridable calculateScale with those values.

const DtScalingAlgorithm& makVrv::DtModelScaler::scalingAlgorithm ( ) const

Accessor for this model scaler's scaling algorithm.

DtModelScaler& makVrv::DtModelScaler::operator= ( const DtModelScaler rhs)
private

Member Data Documentation

DtScalingAlgorithm* makVrv::DtModelScaler::myAlgorithm
protected
DtDe& makVrv::DtModelScaler::myDe
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)