Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
platform
Culling
CullingVolume.h
1
// Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2
3
#pragma once
4
5
#include "SingleSphere.h"
6
#include "Types.h"
7
#include "EarthConstants.h"
8
#include "VectorMath.h"
9
10
namespace
Eegeo
11
{
12
namespace
Culling
13
{
14
struct
CullingVolume
15
{
16
public
:
17
Eegeo::Geometry::SingleSphere
sphere;
18
u32 startIndex;
19
u32 numOfIndices;
20
int
firstChildIndex;
21
int
childCount;
22
23
inline
v3
CalcScaleTarget(
const
dv3
& ecefOrigin,
float
& sphereCentreAltitude)
const
24
{
25
dv3
ecefCentre(ecefOrigin);
26
ecefCentre += sphere.centre;
27
double
ecefCentreLength = ecefCentre.Length();
28
sphereCentreAltitude =
static_cast<
float
>
(ecefCentreLength -
Eegeo::Space::EarthConstants::Radius
);
29
double
scale = (
Eegeo::Space::EarthConstants::Radius
/ ecefCentreLength);
30
ecefCentre *= scale;
31
ecefCentre -= ecefOrigin;
32
return
ecefCentre.ToSingle();
33
}
34
35
inline
bool
isLeafNode()
const
36
{
37
return
childCount == 0;
38
}
39
};
40
}
41
}
Generated on Sat Jun 10 2023 02:00:29 for eeGeo Platform SDK by
1.8.3.1