23 #include <osgUtil/CullVisitor>
25 #include <osg/BoundingBox>
26 #include <osg/BoundingSphere>
30 #include <matrix/vlMath.h>
51 , myDynamicLightsFlag(true)
52 , myDynamicOceanFlag(true)
53 , myOceanSeaLevelRenderBias(0.0f)
54 , myCameraAboveWater(true)
56 , myCameraResolution( 1.0 )
57 , myTerrainRadius( 1.0 )
58 , myScalingFlag( true )
59 , myClampedPixelSize( 1.0 )
60 , myLodScaleFactor( 1.0 )
61 , myCoordinateSystemChanged( false )
63 , myDynamicWaterVisibilityEnable(true)
64 , myDynamicWaterVisibilityMax(75.)
66 , myTerrainMagnificationHighLodAngle(DtDeg2Rad(15))
67 , myTerrainMagnificationScaleFactor(1.)
68 , myCameraVelocity( 0, 0, 0 )
70 , myIncludeLightPoints(true)
71 , myCurrentScaleFactor(1.0)
72 , myIndirectDistScaleEnabled(false)
73 , myIndirectDistScale(1.0)
74 , myChannelLodScale(1.0f)
75 , myFocusPointEnabled(false)
76 , myFocusPointsConsiderCamera(true)
87 myLodScaleFactor = sf;
93 return myLodScaleFactor;
99 myCameraResolution = factor;
105 return myCameraResolution;
110 myCameraVelocity = osg::Vec3d(x,y,z);
116 return myCameraVelocity;
122 myTerrainRadius = rad;
128 myAltitude2D = altitude;
146 myModelSet = modelSet;
152 return myTerrainRadius;
170 mySkyFlag = renderSky;
183 myDynamicLightsFlag = enabled;
189 return myDynamicLightsFlag;
195 myDynamicOceanFlag = enabled;
201 return myDynamicOceanFlag;
207 myOceanSeaLevelRenderBias = meters;
213 return myOceanSeaLevelRenderBias;
219 myCameraAboveWater = aboveWater;
225 return myCameraAboveWater;
231 myScalingFlag = scaling;
237 return myScalingFlag;
243 myCoordinateSystemChanged = changed;
249 return myCoordinateSystemChanged;
256 myModelScaler = scaler;
261 return myModelScaler;
266 const osg::Node& node )
const
268 if ( myModelScaler.valid() )
270 return myModelScaler->calculateScale( *
this, camera, node );
284 myClampedPixelSize = d;
290 return myClampedPixelSize;
298 myDynamicWaterVisibilityEnable = enable;
304 return myDynamicWaterVisibilityEnable;
311 myDynamicWaterVisibilityMax = visMax;
318 return myDynamicWaterVisibilityMax;
325 myTerrainMagnificationScaleFactor = factor;
332 return myTerrainMagnificationScaleFactor;
343 myTerrainMagnificationHighLodAngle = radians;
352 return myTerrainMagnificationHighLodAngle;
358 myIncludeLightPoints = flag;
364 return myIncludeLightPoints;
371 return myCurrentScaleFactor;
378 myCurrentScaleFactor = currentScaleFactor;
384 myIndirectDistScaleEnabled = enabled;
390 return myIndirectDistScaleEnabled;
396 myIndirectDistScale = scale;
402 return myIndirectDistScale;
408 myChannelLodScale = scale;
414 return myChannelLodScale;
421 myFocusPoints = points;
428 return myFocusPoints;
435 myFocusPointEnabled = enable;
442 return myFocusPointEnabled;
451 myFocusPointsConsiderCamera = enable;
460 return myFocusPointsConsiderCamera;
505 : myFixedPixelSize( 1.0 )
521 myFixedPixelSize = d;
526 return myFixedPixelSize;
531 myLength =
length; myWidth = width; myHeight = height;
551 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
554 visitor.clampedPixelSize( sphere.center(), info->
terrainRadius() );
557 calculateScaleFactors( sphere, *info, scaleFactorX,
558 scaleFactorY, scaleFactorZ );
562 double& scaleFactorX,
double& scaleFactorY,
double& scaleFactorZ)
const
564 scaleFactorX = scaleFactorY = scaleFactorZ = 1.0;
567 double curPixels = myWidth / metersPerPixel;
571 scaleFactorX = myFixedPixelSize / curPixels;
576 scaleFactorY = scaleFactorX;
double myAltitude2D
Definition: DtOsgCullVisitorParameters.h:471
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:426
void setDynamicWaterVisibilityMax(double visMax)
Set the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:309
float myCurrentScaleFactor
Definition: DtOsgCullVisitorParameters.h:489
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:419
bool myScaleZ
Definition: DtOsgCullVisitorParameters.h:618
bool myFocusPointEnabled
Definition: DtOsgCullVisitorParameters.h:496
Object used to calculate fixed scale of object based on how many pixels on screen it should take up...
Definition: DtOsgCullVisitorParameters.h:501
double fixedPixelSize() const
Definition: DtOsgCullVisitorParameters.h:524
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:254
double myLodScaleFactor
Definition: DtOsgCullVisitorParameters.h:468
bool myDynamicOceanFlag
Definition: DtOsgCullVisitorParameters.h:474
void setSkyRendering(bool renderSky)
Set whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:168
void setClampedPixelSize(double d)
Set the clamped pixel size calculated when using DtOsgFixedScaleParameters. This is ust used to pass ...
Definition: DtOsgCullVisitorParameters.h:282
double myTerrainRadius
Definition: DtOsgCullVisitorParameters.h:470
double altitude2D() const
Return the (implied) 2D altitude.
Definition: DtOsgCullVisitorParameters.h:132
double clampedPixelSize() const
Retrieve the clamped pixel size set in setClampedPixelSize.
Definition: DtOsgCullVisitorParameters.h:288
void setCameraResolution(double factor)
Set the zoom factor that effects LODing.
Definition: DtOsgCullVisitorParameters.h:97
bool myCameraAboveWater
Definition: DtOsgCullVisitorParameters.h:476
#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:193
Definition: featureContext.h:37
osg::ref_ptr< DtModelScaler > myModelScaler
Definition: DtOsgCullVisitorParameters.h:483
float myIndirectDistScale
Definition: DtOsgCullVisitorParameters.h:491
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:323
void setIndirectDistanceScaleEnabled(bool enabled)
Set if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:382
DtOsgCullVisitorParameters()
CTOR.
Definition: DtOsgCullVisitorParameters.h:48
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:376
bool myIndirectDistScaleEnabled
Definition: DtOsgCullVisitorParameters.h:490
double length() const
Definition: DtOsgCullVisitorParameters.h:534
double terrainRadius() const
Get the terrain radius.
Definition: DtOsgCullVisitorParameters.h:150
double calculateModelScale(const osg::Camera &camera, const osg::Node &node) const
calculate the model scale using the registered XR scaler.
Definition: DtOsgCullVisitorParameters.h:265
Contains makVrv::DtIndirectModelScalingAlgorithm enumeration.
float myOceanSeaLevelRenderBias
Definition: DtOsgCullVisitorParameters.h:475
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:85
DtIndirectModelScalingAlgorithm
Definition: DtIndirectModelScalingAlgorithm.h:14
DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:504
bool scaleZ() const
Definition: DtOsgCullVisitorParameters.h:610
osg::Vec3d myCameraVelocity
Definition: DtOsgCullVisitorParameters.h:486
double myCameraResolution
Definition: DtOsgCullVisitorParameters.h:469
void setFocusPointEnabled(bool enable)
set the focust point enabled flag. If enabled the focus point distances and angles are used to calcul...
Definition: DtOsgCullVisitorParameters.h:433
bool cameraAboveWater() const
Get whether the camera is above water.
Definition: DtOsgCullVisitorParameters.h:223
void setScaleX(bool b)
Definition: DtOsgCullVisitorParameters.h:585
void setCameraVelocity(double x, double y, double z)
Set the camera velocity.
Definition: DtOsgCullVisitorParameters.h:108
float myTerrainMagnificationScaleFactor
Definition: DtOsgCullVisitorParameters.h:484
void setTerrainRadius(double rad)
Set the terrain radius.
Definition: DtOsgCullVisitorParameters.h:120
virtual ~DtOsgFixedScaleParameters()
Definition: DtOsgCullVisitorParameters.h:515
DtModelScaler * findModelScaler() const
Definition: DtOsgCullVisitorParameters.h:259
void setDynamicLights(bool enabled)
Set whether dynamic lights are enabled.
Definition: DtOsgCullVisitorParameters.h:181
bool scaleX() const
Definition: DtOsgCullVisitorParameters.h:590
DtModelSetId myModelSet
Definition: DtOsgCullVisitorParameters.h:487
const osg::Vec3d & cameraVelocity() const
Get the camera velocity.
Definition: DtOsgCullVisitorParameters.h:114
bool scaling() const
Get whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:235
bool focusPointsConsiderCamera()
get the focust points consider camera enabled flag. If enabled the focus points algorithm considers t...
Definition: DtOsgCullVisitorParameters.h:458
double lodScaleFactor() const
Return the current LOD scale factor.
Definition: DtOsgCullVisitorParameters.h:91
void setDimensions(double length, double width, double height)
Definition: DtOsgCullVisitorParameters.h:529
void setTerrainMagnificationHighLodAngle(float radians)
Set the angle used when paging in high LOD tiles, the angle (radians) represents the half angle...
Definition: DtOsgCullVisitorParameters.h:341
Contains makVrv::DtObserverObject class.
void setCoordinateSystemChanged(bool changed)
Set whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:241
bool dynamicLights() const
Get whether dynamic lights rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:187
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:43
void setDynamicWaterVisibilityEnable(bool enable)
Set dynamic water visibility, based on altitude. Water visibility will be scaled from its specified v...
Definition: DtOsgCullVisitorParameters.h:296
float oceanSeaLevelRenderBias() const
Returns the ocean sea level rendering bias in meters.
Definition: DtOsgCullVisitorParameters.h:211
float myChannelLodScale
Definition: DtOsgCullVisitorParameters.h:495
float indirectDistanceScale() const
Get the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:400
void setOrthoCulling(bool ortho)
Set whether the culling should be doing in orthographic mode.
Definition: DtOsgCullVisitorParameters.h:156
double cameraResolution() const
Get the zoom factor.
Definition: DtOsgCullVisitorParameters.h:103
bool myDynamicWaterVisibilityEnable
Definition: DtOsgCullVisitorParameters.h:481
Contains the declaration of the makVrv::DtModelScaler class.
bool myIncludeLightPoints
Definition: DtOsgCullVisitorParameters.h:488
double myClampedPixelSize
Definition: DtOsgCullVisitorParameters.h:479
bool includeLightPoints() const
get the flag for including light points in this cull visitor traversal. If false then light points wi...
Definition: DtOsgCullVisitorParameters.h:362
bool dynamicOcean() const
Get whether a dynamic ocean rendering is enabled.
Definition: DtOsgCullVisitorParameters.h:199
void setScaling(bool scaling)
Set whether scalable groups should be scaled by distance.
Definition: DtOsgCullVisitorParameters.h:229
bool mySkyFlag
Definition: DtOsgCullVisitorParameters.h:472
bool indirectDistanceScaleEnabled() const
True if the distance for culling instanced data is enabled.
Definition: DtOsgCullVisitorParameters.h:388
double myDynamicWaterVisibilityMax
Definition: DtOsgCullVisitorParameters.h:482
bool myFocusPointsConsiderCamera
Definition: DtOsgCullVisitorParameters.h:492
double height() const
Definition: DtOsgCullVisitorParameters.h:544
void calculateScaleFactors(const osg::BoundingSphere &sphere, const DtOsgCullVisitorParameters &info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:561
bool coordinateSystemChanged() const
Get whether the coordinate system changed this frame.
Definition: DtOsgCullVisitorParameters.h:247
void setChannelLodScale(float scale)
set the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:406
void calculateScaleFactors(const osgUtil::CullVisitor &visitor, const osg::BoundingSphere &sphere, DtOsgCullVisitorParameters *info, double &scaleFactorX, double &scaleFactorY, double &scaleFactorZ) const
Definition: DtOsgCullVisitorParameters.h:549
double myWidth
Definition: DtOsgCullVisitorParameters.h:617
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:144
bool scaleY() const
Definition: DtOsgCullVisitorParameters.h:600
bool orthoCulling() const
Get whether the culling is to be done in 2D orthographic mode.
Definition: DtOsgCullVisitorParameters.h:162
bool myCoordinateSystemChanged
Definition: DtOsgCullVisitorParameters.h:480
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:350
bool myScalingFlag
Definition: DtOsgCullVisitorParameters.h:478
double dynamicWaterVisibilityMax() const
Get the maximum value to which water visibility will be set when dynamic water visibility is enabled...
Definition: DtOsgCullVisitorParameters.h:316
bool skyRendering() const
Get whether the sky is being rendered.
Definition: DtOsgCullVisitorParameters.h:175
bool dynamicWaterVisibilityEnable() const
Get whether dynamic water is enabled.
Definition: DtOsgCullVisitorParameters.h:302
std::vector< osg::Vec3d > myFocusPoints
Definition: DtOsgCullVisitorParameters.h:493
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:356
void setOceanSeaLevelRenderBias(float meters)
Sets the ocean sea level rendering bias in meters.
Definition: DtOsgCullVisitorParameters.h:205
void setFocusPointsConsiderCamera(bool enable)
set the focust points consider camera enabled flag. If enabled the focus points algorithm considers t...
Definition: DtOsgCullVisitorParameters.h:449
void setFixedPixelSize(double d)
Definition: DtOsgCullVisitorParameters.h:519
void setScaleZ(bool b)
Definition: DtOsgCullVisitorParameters.h:605
bool myDynamicLightsFlag
Definition: DtOsgCullVisitorParameters.h:473
float channelLodScale()
get the channel lod scale. This is only the channel configuration value and not the view magnificatio...
Definition: DtOsgCullVisitorParameters.h:412
float myTerrainMagnificationHighLodAngle
Definition: DtOsgCullVisitorParameters.h:485
float terrainMagnificationScaleFactor() const
Get the amount that any view magnification value is reduced by when determining the distance to a pag...
Definition: DtOsgCullVisitorParameters.h:330
void setIndirectDistanceScale(float scale)
Set the distance for culling instanced data.
Definition: DtOsgCullVisitorParameters.h:394
double width() const
Definition: DtOsgCullVisitorParameters.h:539
void setScaleXY(bool b)
Definition: DtOsgCullVisitorParameters.h:595
DtModelSetId modelSet() const
Get the model set currently being rendered.
Definition: DtOsgCullVisitorParameters.h:138
bool focusPointEnabled()
get the focust point enabled flag. If enabled the focus point distances and angles are used to calcul...
Definition: DtOsgCullVisitorParameters.h:440
void setAltitude2D(double altitude)
Set the (implied) altitude when orthoCulling.
Definition: DtOsgCullVisitorParameters.h:126
Contains various enum classes relating to model sets.
bool myOrthoFlag
Definition: DtOsgCullVisitorParameters.h:477
void setCameraAboveWater(bool aboveWater)
Set whether the camera is above water.
Definition: DtOsgCullVisitorParameters.h:217
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:369
double myFixedPixelSize
Definition: DtOsgCullVisitorParameters.h:616