8 #include "IStreamingVolume.h"
10 #include "VectorMath.h"
11 #include "Rendering.h"
27 double halfToPowerOfDepth;
31 uint faceCentralNodeFlags;
40 uint m_inactivePlaneFlags;
41 int m_sphereTestsPerformed;
42 int m_cylinderTestsPerformed;
43 double m_sagittaAtCylinderTestMinNodeDepth;
44 float m_ceilingHeight;
45 double m_cellRefineDistance;
46 double m_depthSortBias;
47 int m_deepestLevelForAltitudeLodRefinement;
52 double m_viewDependentScale;
53 float m_halfCeilingHeight;
54 float m_earthRadiusPlusHalfCeiling;
55 float m_earthRadiusPlusCeilingSq;
56 float m_halfCeilingHeightSq;
57 float m_cylinderHeight;
58 float m_earthCentreToCylinderBase;
59 double m_cameraAltitude;
60 double m_cameraSpaceErrorDenominatorMult;
64 int m_currentMostDetailedLodLevel;
65 std::vector<double> m_lodRefinementAltitudes;
66 std::vector<CameraFrustumStreamingVolumeQuadtreeNodeVisitParams> m_stack;
67 std::vector<double> m_visibilityThresholdsByDepth;
69 bool m_forceMaximumRefinement;
74 static const int PLANE_FLAGS_ALL = 0x3F;
76 const Eegeo::dv3& origin()
const {
return m_origin; }
77 const Eegeo::v3& viewDirection()
const {
return m_viewDirection; }
78 float fovRadians()
const {
return m_fovRadians; }
79 uint inactivePlaneFlags()
const {
return m_inactivePlaneFlags; }
82 const std::vector<double>& lodRefinementAltitudes,
83 int deepestLevelForAltitudeLodRefinement,
84 const Rendering::EnvironmentFlatteningService& environmentFlatteningService);
86 void ResetVolume(
const dv3& ecefInterestPoint);
88 bool IntersectsKey(
const MortonKey& key,
89 bool& canRefineIntersectedKey,
90 double& intersectedNodeDepthSortSignedDistance)
override;
92 virtual void updateStreamingVolume(
Eegeo::dv3 ecefCentre,
93 const std::vector<Geometry::Plane>& frustumPlanes,
96 void setInactivePlaneFlags(uint inactivePlaneFlags) { m_inactivePlaneFlags = inactivePlaneFlags; }
98 virtual bool intersectsOriginRelativeSphere(
float sphereRadius,
const v3& sphereCentreRelativePos);
100 bool intersectsSphere(
double sphereRadius,
double sphereCentreX,
double sphereCentreY,
double sphereCentreZ);
102 void setDeepestLevelForAltitudeLodRefinement(
int level);
104 void SetForceMaximumRefinement(
bool forceMaximumRefinement);
106 bool GetForceMaximumRefinement()
const;
110 virtual bool intersectsUprightCylinder(
double cylinderRadius,
111 double cylinderHeight,
112 double cylinderBaseCentreX,
113 double cylinderBaseCentreY,
114 double cylinderBaseCentreZ);
117 bool shouldDivideAtDepth(
int nodeDepth,
double cellCameraSpaceError);
119 int calculateMostDetailedLodLevel(
double cameraAltitude);
121 int calculateLodLevelForAltitude(
double altitude);
123 void calculateVisibilityThresholds();