16 #include <osg/BoundingBox>
17 #include <osg/BoundingSphere>
19 #include <osgUtil/CullVisitor>
25 #include <matrix/vlMath.h>
46 , myDynamicLightsFlag(true)
47 , myDynamicOceanFlag(true)
49 , myCameraResolution( 1.0 )
50 , myTerrainRadius( 1.0 )
51 , myScalingFlag( true )
52 , myClampedPixelSize( 1.0 )
53 , myLodScaleFactor( 1.0 )
54 , myCoordinateSystemChanged( false )
57 , myDynamicWaterVisibilityEnable(true)
58 , myDynamicWaterVisibilityMax(75.)
60 , myTerrainMagnificationHighLodAngle(DtDeg2Rad(15))
61 , myTerrainMagnificationScaleFactor(1.)
62 , myCameraVelocity( 0, 0, 0 )
64 , myIncludeLightPoints(true)
65 , myCurrentScaleFactor(1.0)
66 , myIndirectDistScaleEnabled(false)
67 , myIndirectDistScale(1.0)
68 , myChannelLodScale(1.0)
69 , myFocusPointEnabled(false)
80 myLodScaleFactor = sf;
86 return myLodScaleFactor;
92 myCameraResolution = factor;
98 return myCameraResolution;
103 myCameraVelocity = osg::Vec3d(x,y,z);
109 return myCameraVelocity;
115 myTerrainRadius = rad;
121 myAltitude2D = altitude;
139 myModelSet = modelSet;
145 return myTerrainRadius;
163 mySkyFlag = renderSky;
176 myDynamicLightsFlag = enabled;
182 return myDynamicLightsFlag;
188 myDynamicOceanFlag = enabled;
194 return myDynamicOceanFlag;
200 myScalingFlag = scaling;
206 return myScalingFlag;
212 myCoordinateSystemChanged = changed;
218 return myCoordinateSystemChanged;
225 myModelScaler = scaler;
230 return myModelScaler;
235 const osg::Node& node )
const
237 if ( myModelScaler.valid() )
239 return myModelScaler->calculateScale( *
this, camera, node );
248 inline double calculateScale(
const osg::Camera& camera,
const osg::Vec3d& position,
249 double modelRadius,
DtUniqueID objectElementId)
const
251 if (myModelScaler.valid())
253 return myModelScaler->calculateScale(*
this, camera, position, modelRadius, objectElementId);
267 myClampedPixelSize = d;
273 return myClampedPixelSize;
281 myDynamicWaterVisibilityEnable = enable;
287 return myDynamicWaterVisibilityEnable;
294 myDynamicWaterVisibilityMax = visMax;
301 return myDynamicWaterVisibilityMax;
308 myTerrainMagnificationScaleFactor = factor;
315 return myTerrainMagnificationScaleFactor;
326 myTerrainMagnificationHighLodAngle = radians;
335 return myTerrainMagnificationHighLodAngle;
341 myIncludeLightPoints = flag;
347 return myIncludeLightPoints;
354 return myCurrentScaleFactor;
361 myCurrentScaleFactor = currentScaleFactor;
367 myIndirectDistScaleEnabled = enabled;
373 return myIndirectDistScaleEnabled;
379 myIndirectDistScale = scale;
385 return myIndirectDistScale;
391 myChannelLodScale = scale;
397 return myChannelLodScale;
404 myFocusPoints = points;
411 return myFocusPoints;
418 myFocusPointEnabled = enable;
425 return myFocusPointEnabled;
465 : myFixedPixelSize( 1.0 )
481 myFixedPixelSize = d;
486 return myFixedPixelSize;
491 myLength = length; myWidth = width; myHeight = height;
511 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
514 visitor.clampedPixelSize( sphere.center(), info->
terrainRadius() );
517 calculateScaleFactors( sphere, *info, scaleFactorX,
518 scaleFactorY, scaleFactorZ );
522 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
524 scaleFactorX = scaleFactorY = scaleFactorZ = 1.0;
527 double curPixels = myWidth / metersPerPixel;
531 scaleFactorX = myFixedPixelSize / curPixels;
536 scaleFactorY = scaleFactorX;
double myAltitude2D
Definition: DtOsgCullVisitorParameters.h:433
std::vector< osg::Vec3d > & focusPoints()
get the focus points.
Definition: DtOsgCullVisitorParameters.h:409
void setDynamicWaterVisibilityMax(double visMax)
Set the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:292
float myCurrentScaleFactor
Definition: DtOsgCullVisitorParameters.h:450
void setFocusPoints(std::vector< osg::Vec3d > &points)
set the focus points.
Definition: DtOsgCullVisitorParameters.h:402
bool myScaleZ
Definition: DtOsgCullVisitorParameters.h:578
bool myFocusPointEnabled
Definition: DtOsgCullVisitorParameters.h:456
Object used to calculate fixed scale of object based on how many pixels on screen it should take up...
Definition: DtOsgCullVisitorParameters.h:461
double fixedPixelSize() const
Definition: DtOsgCullVisitorParameters.h:484
void setModelScaler(DtModelScaler *scaler)
Set the XR scaler to use.
Definition: DtOsgCullVisitorParameters.h:223
double myLodScaleFactor
Definition: DtOsgCullVisitorParameters.h:430
bool myDynamicOceanFlag
Definition: DtOsgCullVisitorParameters.h:437
void setSkyRendering(bool renderSky)
Set whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:161
void setClampedPixelSize(double d)
Set the clamped pixel size calculated when using DtOsgFixedScaleParameters.
Definition: DtOsgCullVisitorParameters.h:265
double myTerrainRadius
Definition: DtOsgCullVisitorParameters.h:432
double altitude2D() const
Return the (implied) 2D altitude.
Definition: DtOsgCullVisitorParameters.h:125
double clampedPixelSize() const
Retrieve the clamped pixel size set in setClampedPixelSize.
Definition: DtOsgCullVisitorParameters.h:271
void setCameraResolution(double factor)
Set the zoom factor that effects LODing.
Definition: DtOsgCullVisitorParameters.h:90
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
The DtModelScaler prepares the data from the osg camera, osg node, and cull visitor parameters and th...
Definition: DtModelScaler.h:32
void setDynamicOcean(bool enabled)
Set whether a dynamic ocean rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:186
Definition: featureContext.h:37
osg::ref_ptr< DtModelScaler > myModelScaler
Definition: DtOsgCullVisitorParameters.h:444
float myIndirectDistScale
Definition: DtOsgCullVisitorParameters.h:452
void setTerrainMagnificationScaleFactor(float factor)
Set the amount that any view magnification value is reduced by when determining the distance to a pag...
Definition: DtOsgCullVisitorParameters.h:306
void setIndirectDistanceScaleEnabled(bool enabled)
Set if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:365
DtOsgCullVisitorParameters()
CTOR.
Definition: DtOsgCullVisitorParameters.h:43
void setCurrentTraversalScaleFactor(float currentScaleFactor)
set the scale factor for the current place in the cull visitor traversal.
Definition: DtOsgCullVisitorParameters.h:359
bool myIndirectDistScaleEnabled
Definition: DtOsgCullVisitorParameters.h:451
double length() const
Definition: DtOsgCullVisitorParameters.h:494
double terrainRadius() const
Get the terrain radius.
Definition: DtOsgCullVisitorParameters.h:143
double calculateModelScale(const osg::Camera &camera, const osg::Node &node) const
calculate the model scale using the registered XR scaler.
Definition: DtOsgCullVisitorParameters.h:234
void setLodScaleFactor(double sf)
Set the LOD scale factor that affects LODing and paging; this is the product of the channels LOD scal...
Definition: DtOsgCullVisitorParameters.h:78
DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:464
bool scaleZ() const
Definition: DtOsgCullVisitorParameters.h:570
osg::Vec3d myCameraVelocity
Definition: DtOsgCullVisitorParameters.h:447
double myCameraResolution
Definition: DtOsgCullVisitorParameters.h:431
void setFocusPointEnabled(bool enable)
set the focust point enabled flag.
Definition: DtOsgCullVisitorParameters.h:416
void setScaleX(bool b)
Definition: DtOsgCullVisitorParameters.h:545
void setCameraVelocity(double x, double y, double z)
Set the camera velocity.
Definition: DtOsgCullVisitorParameters.h:101
float myTerrainMagnificationScaleFactor
Definition: DtOsgCullVisitorParameters.h:445
void setTerrainRadius(double rad)
Set the terrain radius.
Definition: DtOsgCullVisitorParameters.h:113
virtual ~DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:475
DtModelScaler * findModelScaler() const
Definition: DtOsgCullVisitorParameters.h:228
void setDynamicLights(bool enabled)
Set whether dynamic lights are enabled.
Definition: DtOsgCullVisitorParameters.h:174
bool scaleX() const
Definition: DtOsgCullVisitorParameters.h:550
const osg::Vec3d & cameraVelocity() const
Get the camera velocity.
Definition: DtOsgCullVisitorParameters.h:107
bool scaling() const
Get whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:204
unsigned int myModelSet
Definition: DtOsgCullVisitorParameters.h:448
double lodScaleFactor() const
Return the current LOD scale factor.
Definition: DtOsgCullVisitorParameters.h:84
void setDimensions(double length, double width, double height)
Definition: DtOsgCullVisitorParameters.h:489
void setTerrainMagnificationHighLodAngle(float radians)
Set the angle used when paging in high LOD tiles, the angle (radians) represents the half angle...
Definition: DtOsgCullVisitorParameters.h:324
Contains makVrv::DtObserverObject class.
void setCoordinateSystemChanged(bool changed)
Set whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:210
unsigned int modelSet() const
Get the model set currently being rendered.
Definition: DtOsgCullVisitorParameters.h:131
bool dynamicLights() const
Get whether dynamic lights rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:180
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:38
void setDynamicWaterVisibilityEnable(bool enable)
Set dynamic water visibility, based on altitude.
Definition: DtOsgCullVisitorParameters.h:279
float myChannelLodScale
Definition: DtOsgCullVisitorParameters.h:455
float indirectDistanceScale() const
Get the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:383
void setOrthoCulling(bool ortho)
Set whether the culling should be doing in orthographic mode.
Definition: DtOsgCullVisitorParameters.h:149
double cameraResolution() const
Get the zoom factor.
Definition: DtOsgCullVisitorParameters.h:96
bool myDynamicWaterVisibilityEnable
Definition: DtOsgCullVisitorParameters.h:442
Contains the declaration of the makVrv::DtModelScaler class.
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
bool myIncludeLightPoints
Definition: DtOsgCullVisitorParameters.h:449
double myClampedPixelSize
Definition: DtOsgCullVisitorParameters.h:440
bool includeLightPoints() const
get the flag for including light points in this cull visitor traversal. If false then light points wi...
Definition: DtOsgCullVisitorParameters.h:345
bool dynamicOcean() const
Get whether a dynamic ocean rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:192
void setScaling(bool scaling)
Set whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:198
bool mySkyFlag
Definition: DtOsgCullVisitorParameters.h:435
bool indirectDistanceScaleEnabled() const
True if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:371
double myDynamicWaterVisibilityMax
Definition: DtOsgCullVisitorParameters.h:443
double height() const
Definition: DtOsgCullVisitorParameters.h:504
void calculateScaleFactors(const osg::BoundingSphere &sphere, const DtOsgCullVisitorParameters &info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:521
double myAltitude3D
Definition: DtOsgCullVisitorParameters.h:434
bool coordinateSystemChanged() const
Get whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:216
void setChannelLodScale(float scale)
set the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:389
void calculateScaleFactors(const osgUtil::CullVisitor &visitor, const osg::BoundingSphere &sphere, DtOsgCullVisitorParameters *info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:509
double myWidth
Definition: DtOsgCullVisitorParameters.h:577
bool scaleY() const
Definition: DtOsgCullVisitorParameters.h:560
bool orthoCulling() const
Get whether the culling is to be done in 2D orthographic mode.
Definition: DtOsgCullVisitorParameters.h:155
double calculateScale(const osg::Camera &camera, const osg::Vec3d &position, double modelRadius, DtUniqueID objectElementId) const
Definition: DtOsgCullVisitorParameters.h:248
bool myCoordinateSystemChanged
Definition: DtOsgCullVisitorParameters.h:441
float terrainMagnificationHighLodAngle() const
Get the viewing angle within which high LOD tiles will be used ex.
Definition: DtOsgCullVisitorParameters.h:333
bool myScalingFlag
Definition: DtOsgCullVisitorParameters.h:439
double dynamicWaterVisibilityMax() const
Get the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:299
bool skyRendering() const
Get whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:168
bool dynamicWaterVisibilityEnable() const
Get whether dynamic water is enabled.
Definition: DtOsgCullVisitorParameters.h:285
void setModelSet(unsigned int modelSet)
Set the model set currently being rendered.
Definition: DtOsgCullVisitorParameters.h:137
std::vector< osg::Vec3d > myFocusPoints
Definition: DtOsgCullVisitorParameters.h:453
void setIncludeLightPoints(bool flag)
set the flag for including light points in this cull visitor traversal. If false then light points wi...
Definition: DtOsgCullVisitorParameters.h:339
void setFixedPixelSize(double d)
Definition: DtOsgCullVisitorParameters.h:479
void setScaleZ(bool b)
Definition: DtOsgCullVisitorParameters.h:565
bool myDynamicLightsFlag
Definition: DtOsgCullVisitorParameters.h:436
float channelLodScale()
get the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:395
float myTerrainMagnificationHighLodAngle
Definition: DtOsgCullVisitorParameters.h:446
float terrainMagnificationScaleFactor() const
Get the amount that any view magnification value is reduced by when determining the distance to a pag...
Definition: DtOsgCullVisitorParameters.h:313
void setIndirectDistanceScale(float scale)
Set the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:377
double width() const
Definition: DtOsgCullVisitorParameters.h:499
void setScaleXY(bool b)
Definition: DtOsgCullVisitorParameters.h:555
bool focusPointEnabled()
get the focust point enabled flag.
Definition: DtOsgCullVisitorParameters.h:423
void setAltitude2D(double altitude)
Set the (implied) altitude when orthoCulling.
Definition: DtOsgCullVisitorParameters.h:119
bool myOrthoFlag
Definition: DtOsgCullVisitorParameters.h:438
float currentTraversalScaleFactor()
get the scale factor for the current place in the cull visitor traversal.
Definition: DtOsgCullVisitorParameters.h:352
double myFixedPixelSize
Definition: DtOsgCullVisitorParameters.h:576