24 #include <osgUtil/CullVisitor>
26 #include <osg/BoundingBox>
27 #include <osg/BoundingSphere>
31 #include <matrix/vlMath.h>
52 , myDynamicLightsFlag(true)
53 , myDynamicOceanFlag(true)
54 , myOceanSeaLevelRenderBias(0.0f)
55 , myCameraAboveWater(true)
57 , myCameraResolution( 1.0 )
58 , myTerrainRadius( 1.0 )
59 , myScalingFlag( true )
60 , myClampedPixelSize( 1.0 )
61 , myEntityLodScaleFactor( 1.0f )
62 , myTerrainLodScaleFactor( 1.0f )
63 , myCoordinateSystemChanged( false )
65 , myDynamicWaterVisibilityEnable(true)
66 , myDynamicWaterVisibilityMax(75.)
68 , myTerrainMagnificationHighLodAngle(DtDeg2Rad(15))
69 , myTerrainMagnificationScaleFactor(1.)
70 , myCameraVelocity( 0, 0, 0 )
72 , myIncludeLightPoints(true)
73 , myCurrentScaleFactor(1.0)
74 , myIndirectDistScaleEnabled(false)
75 , myIndirectDistScale(1.0)
76 , myChannelLodScale(1.0f)
85 myTerrainLodScaleFactor = sf;
91 return myTerrainLodScaleFactor;
100 myEntityLodScaleFactor = lodDistanceScale;
106 return myEntityLodScaleFactor;
112 myCameraResolution = factor;
118 return myCameraResolution;
123 myCameraVelocity = osg::Vec3d(x,y,z);
129 return myCameraVelocity;
135 myTerrainRadius = rad;
141 myAltitude2D = altitude;
159 myModelSet = modelSet;
165 return myTerrainRadius;
182 myLodCenterSettings = settings;
187 return myLodCenterSettings;
193 mySkyFlag = renderSky;
206 myDynamicLightsFlag = enabled;
212 return myDynamicLightsFlag;
218 myDynamicOceanFlag = enabled;
224 return myDynamicOceanFlag;
230 myOceanSeaLevelRenderBias = meters;
236 return myOceanSeaLevelRenderBias;
242 myCameraAboveWater = aboveWater;
248 return myCameraAboveWater;
254 myScalingFlag = scaling;
260 return myScalingFlag;
266 myCoordinateSystemChanged = changed;
272 return myCoordinateSystemChanged;
279 myModelScaler = scaler;
284 return myModelScaler;
289 const osg::Node& node )
const
291 if ( myModelScaler.valid() )
293 return myModelScaler->calculateScale( *
this, camera, node );
307 myClampedPixelSize = d;
313 return myClampedPixelSize;
321 myDynamicWaterVisibilityEnable = enable;
327 return myDynamicWaterVisibilityEnable;
334 myDynamicWaterVisibilityMax = visMax;
341 return myDynamicWaterVisibilityMax;
348 myTerrainMagnificationScaleFactor = factor;
355 return myTerrainMagnificationScaleFactor;
366 myTerrainMagnificationHighLodAngle = radians;
375 return myTerrainMagnificationHighLodAngle;
381 myIncludeLightPoints = flag;
387 return myIncludeLightPoints;
394 return myCurrentScaleFactor;
401 myCurrentScaleFactor = currentScaleFactor;
407 myIndirectDistScaleEnabled = enabled;
413 return myIndirectDistScaleEnabled;
419 myIndirectDistScale = scale;
425 return myIndirectDistScale;
431 myChannelLodScale = scale;
437 return myChannelLodScale;
444 myFocusPoints = points;
451 return myFocusPoints;
498 : myFixedPixelSize( 1.0 )
514 myFixedPixelSize = d;
519 return myFixedPixelSize;
524 myLength =
length; myWidth = width; myHeight = height;
544 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
547 visitor.clampedPixelSize( sphere.center(), info->
terrainRadius() );
550 calculateScaleFactors( sphere, *info, scaleFactorX,
551 scaleFactorY, scaleFactorZ );
555 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
557 scaleFactorX = scaleFactorY = scaleFactorZ = 1.0;
560 double curPixels = myWidth / metersPerPixel;
564 scaleFactorX = myFixedPixelSize / curPixels;
569 scaleFactorY = scaleFactorX;
double myAltitude2D
Definition: DtOsgCullVisitorParameters.h:464
std::vector< osg::Vec3d > & focusPoints()
get the focus points. These are used to calculate the terrain intersections which are then used to li...
Definition: DtOsgCullVisitorParameters.h:449
void setDynamicWaterVisibilityMax(double visMax)
Set the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:332
float myCurrentScaleFactor
Definition: DtOsgCullVisitorParameters.h:482
void setFocusPoints(std::vector< osg::Vec3d > &points)
set the focus points. These are used to calculate the terrain intersections which are then used to li...
Definition: DtOsgCullVisitorParameters.h:442
bool myScaleZ
Definition: DtOsgCullVisitorParameters.h:611
Object used to calculate fixed scale of object based on how many pixels on screen it should take up...
Definition: DtOsgCullVisitorParameters.h:494
double fixedPixelSize() const
Definition: DtOsgCullVisitorParameters.h:517
void setModelScaler(DtModelScaler *scaler)
Set the XR scaler to use. This will not typically be called by users to change the XR Node Scaler...
Definition: DtOsgCullVisitorParameters.h:277
bool myDynamicOceanFlag
Definition: DtOsgCullVisitorParameters.h:467
void setSkyRendering(bool renderSky)
Set whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:191
void setClampedPixelSize(double d)
Set the clamped pixel size calculated when using DtOsgFixedScaleParameters. This is ust used to pass ...
Definition: DtOsgCullVisitorParameters.h:305
double myTerrainRadius
Definition: DtOsgCullVisitorParameters.h:463
double altitude2D() const
Return the (implied) 2D altitude.
Definition: DtOsgCullVisitorParameters.h:145
double clampedPixelSize() const
Retrieve the clamped pixel size set in setClampedPixelSize.
Definition: DtOsgCullVisitorParameters.h:311
void setTerrainLodScaleFactor(float sf)
Set the LOD scale factor that affects LODing and paging of terrain visuals.
Definition: DtOsgCullVisitorParameters.h:83
void setCameraResolution(double factor)
Set the zoom factor that effects LODing.
Definition: DtOsgCullVisitorParameters.h:110
bool myCameraAboveWater
Definition: DtOsgCullVisitorParameters.h:469
#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:216
Definition: featureContext.h:36
osg::ref_ptr< DtModelScaler > myModelScaler
Definition: DtOsgCullVisitorParameters.h:476
void setEntityLodScaleFactor(float lodDistanceScale)
Set the LOD scale factor that affects LODing and culling of entities NOTE: The 'lod scale factor' is ...
Definition: DtOsgCullVisitorParameters.h:98
float myIndirectDistScale
Definition: DtOsgCullVisitorParameters.h:484
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:346
void setIndirectDistanceScaleEnabled(bool enabled)
Set if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:405
float myTerrainLodScaleFactor
Definition: DtOsgCullVisitorParameters.h:459
DtOsgCullVisitorParameters()
CTOR.
Definition: DtOsgCullVisitorParameters.h:49
void setCurrentTraversalScaleFactor(float currentScaleFactor)
set the scale factor for the current place in the cull visitor traversal. this is used by the light p...
Definition: DtOsgCullVisitorParameters.h:399
bool myIndirectDistScaleEnabled
Definition: DtOsgCullVisitorParameters.h:483
double length() const
Definition: DtOsgCullVisitorParameters.h:527
double terrainRadius() const
Get the terrain radius.
Definition: DtOsgCullVisitorParameters.h:163
double calculateModelScale(const osg::Camera &camera, const osg::Node &node) const
calculate the model scale using the registered XR scaler.
Definition: DtOsgCullVisitorParameters.h:288
Contains makVrv::DtIndirectModelScalingAlgorithm enumeration.
float myOceanSeaLevelRenderBias
Definition: DtOsgCullVisitorParameters.h:468
DtIndirectModelScalingAlgorithm
Definition: DtIndirectModelScalingAlgorithm.h:15
DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:497
bool scaleZ() const
Definition: DtOsgCullVisitorParameters.h:603
osg::Vec3d myCameraVelocity
Definition: DtOsgCullVisitorParameters.h:479
double myCameraResolution
Definition: DtOsgCullVisitorParameters.h:462
bool cameraAboveWater() const
Get whether the camera is above water.
Definition: DtOsgCullVisitorParameters.h:246
void setScaleX(bool b)
Definition: DtOsgCullVisitorParameters.h:578
void setCameraVelocity(double x, double y, double z)
Set the camera velocity.
Definition: DtOsgCullVisitorParameters.h:121
float myTerrainMagnificationScaleFactor
Definition: DtOsgCullVisitorParameters.h:477
void setTerrainRadius(double rad)
Set the terrain radius.
Definition: DtOsgCullVisitorParameters.h:133
virtual ~DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:508
DtModelScaler * findModelScaler() const
Definition: DtOsgCullVisitorParameters.h:282
float channelLodScale() const
get the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:435
Definition: DtObserverObject.h:71
void setDynamicLights(bool enabled)
Set whether dynamic lights are enabled.
Definition: DtOsgCullVisitorParameters.h:204
bool scaleX() const
Definition: DtOsgCullVisitorParameters.h:583
DtModelSetId myModelSet
Definition: DtOsgCullVisitorParameters.h:480
const osg::Vec3d & cameraVelocity() const
Get the camera velocity.
Definition: DtOsgCullVisitorParameters.h:127
bool scaling() const
Get whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:258
float myEntityLodScaleFactor
Definition: DtOsgCullVisitorParameters.h:460
void setDimensions(double length, double width, double height)
Definition: DtOsgCullVisitorParameters.h:522
void setTerrainMagnificationHighLodAngle(float radians)
Set the angle used when paging in high LOD tiles, the angle (radians) represents the half angle...
Definition: DtOsgCullVisitorParameters.h:364
float terrainLodScaleFactor() const
Return the current LOD scale factor for terrain visuals.
Definition: DtOsgCullVisitorParameters.h:89
Contains makVrv::DtObserverObject class declaration.
void setCoordinateSystemChanged(bool changed)
Set whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:264
const DtObserverObject::DtLodCenterSettings & lodCenterSettings() const
Definition: DtOsgCullVisitorParameters.h:185
bool dynamicLights() const
Get whether dynamic lights rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:210
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:44
void setDynamicWaterVisibilityEnable(bool enable)
Set dynamic water visibility, based on altitude. Water visibility will be scaled from its specified v...
Definition: DtOsgCullVisitorParameters.h:319
float oceanSeaLevelRenderBias() const
Returns the ocean sea level rendering bias in meters.
Definition: DtOsgCullVisitorParameters.h:234
DtObserverObject::DtLodCenterSettings myLodCenterSettings
Definition: DtOsgCullVisitorParameters.h:489
float myChannelLodScale
Definition: DtOsgCullVisitorParameters.h:487
float indirectDistanceScale() const
Get the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:423
void setLodCenterSettings(const DtObserverObject::DtLodCenterSettings &settings)
Definition: DtOsgCullVisitorParameters.h:180
void setOrthoCulling(bool ortho)
Set whether the culling should be doing in orthographic mode.
Definition: DtOsgCullVisitorParameters.h:169
double cameraResolution() const
Get the zoom factor.
Definition: DtOsgCullVisitorParameters.h:116
bool myDynamicWaterVisibilityEnable
Definition: DtOsgCullVisitorParameters.h:474
Contains the declaration of the makVrv::DtModelScaler class.
bool myIncludeLightPoints
Definition: DtOsgCullVisitorParameters.h:481
double myClampedPixelSize
Definition: DtOsgCullVisitorParameters.h:472
bool includeLightPoints() const
get the flag for including light points in this cull visitor traversal. If false then light points wi...
Definition: DtOsgCullVisitorParameters.h:385
bool dynamicOcean() const
Get whether a dynamic ocean rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:222
Contains the DtObserverModeManager class declaration.
void setScaling(bool scaling)
Set whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:252
bool mySkyFlag
Definition: DtOsgCullVisitorParameters.h:465
bool indirectDistanceScaleEnabled() const
True if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:411
double myDynamicWaterVisibilityMax
Definition: DtOsgCullVisitorParameters.h:475
double height() const
Definition: DtOsgCullVisitorParameters.h:537
void calculateScaleFactors(const osg::BoundingSphere &sphere, const DtOsgCullVisitorParameters &info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:554
bool coordinateSystemChanged() const
Get whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:270
void setChannelLodScale(float scale)
set the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:429
void calculateScaleFactors(const osgUtil::CullVisitor &visitor, const osg::BoundingSphere &sphere, DtOsgCullVisitorParameters *info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:542
double myWidth
Definition: DtOsgCullVisitorParameters.h:610
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
void setModelSet(DtModelSetId modelSet)
Set the model set currently being rendered.
Definition: DtOsgCullVisitorParameters.h:157
bool scaleY() const
Definition: DtOsgCullVisitorParameters.h:593
bool orthoCulling() const
Get whether the culling is to be done in 2D orthographic mode.
Definition: DtOsgCullVisitorParameters.h:175
bool myCoordinateSystemChanged
Definition: DtOsgCullVisitorParameters.h:473
float terrainMagnificationHighLodAngle() const
Get the viewing angle within which high LOD tiles will be used ex. rad angle=0.26179 = 15 degrees...
Definition: DtOsgCullVisitorParameters.h:373
float entityLodScaleFactor() const
Return the current LOD scale factor for entities.
Definition: DtOsgCullVisitorParameters.h:104
bool myScalingFlag
Definition: DtOsgCullVisitorParameters.h:471
double dynamicWaterVisibilityMax() const
Get the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:339
bool skyRendering() const
Get whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:198
bool dynamicWaterVisibilityEnable() const
Get whether dynamic water is enabled.
Definition: DtOsgCullVisitorParameters.h:325
std::vector< osg::Vec3d > myFocusPoints
Definition: DtOsgCullVisitorParameters.h:485
DtModelSetId
Definition: DtModelSetEnums.h:19
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:379
void setOceanSeaLevelRenderBias(float meters)
Sets the ocean sea level rendering bias in meters.
Definition: DtOsgCullVisitorParameters.h:228
void setFixedPixelSize(double d)
Definition: DtOsgCullVisitorParameters.h:512
void setScaleZ(bool b)
Definition: DtOsgCullVisitorParameters.h:598
bool myDynamicLightsFlag
Definition: DtOsgCullVisitorParameters.h:466
float myTerrainMagnificationHighLodAngle
Definition: DtOsgCullVisitorParameters.h:478
float terrainMagnificationScaleFactor() const
Get the amount that any view magnification value is reduced by when determining the distance to a pag...
Definition: DtOsgCullVisitorParameters.h:353
void setIndirectDistanceScale(float scale)
Set the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:417
double width() const
Definition: DtOsgCullVisitorParameters.h:532
void setScaleXY(bool b)
Definition: DtOsgCullVisitorParameters.h:588
DtModelSetId modelSet() const
Get the model set currently being rendered.
Definition: DtOsgCullVisitorParameters.h:151
void setAltitude2D(double altitude)
Set the (implied) altitude when orthoCulling.
Definition: DtOsgCullVisitorParameters.h:139
Contains various enum classes relating to model sets.
bool myOrthoFlag
Definition: DtOsgCullVisitorParameters.h:470
void setCameraAboveWater(bool aboveWater)
Set whether the camera is above water.
Definition: DtOsgCullVisitorParameters.h:240
float currentTraversalScaleFactor()
get the scale factor for the current place in the cull visitor traversal. this is used by the light p...
Definition: DtOsgCullVisitorParameters.h:392
double myFixedPixelSize
Definition: DtOsgCullVisitorParameters.h:609