mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 02:48:25 -05:00
Changed FrustrumCuller to FrustumCuller
This commit is contained in:
@@ -91,7 +91,7 @@ namespace openspace {
|
||||
|
||||
_patchRenderer.reset(new LatLonPatchRenderer(geometry));
|
||||
|
||||
_frustrumCuller = std::shared_ptr<FrustrumCuller>(new FrustrumCuller());
|
||||
_frustumCuller = std::shared_ptr<FrustumCuller>(new FrustumCuller());
|
||||
|
||||
}
|
||||
|
||||
@@ -116,8 +116,8 @@ namespace openspace {
|
||||
return *_patchRenderer;
|
||||
}
|
||||
|
||||
FrustrumCuller& ChunkLodGlobe::getFrustrumCuller() {
|
||||
return *_frustrumCuller;
|
||||
FrustumCuller& ChunkLodGlobe::getFrustumCuller() {
|
||||
return *_frustumCuller;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace openspace {
|
||||
~ChunkLodGlobe();
|
||||
|
||||
LatLonPatchRenderer& getPatchRenderer();
|
||||
FrustrumCuller& getFrustrumCuller();
|
||||
FrustumCuller& getFrustumCuller();
|
||||
|
||||
bool initialize() override;
|
||||
bool deinitialize() override;
|
||||
@@ -84,7 +84,7 @@ namespace openspace {
|
||||
std::unique_ptr<ChunkNode> _rightRoot;
|
||||
|
||||
// Frustrum culler
|
||||
std::shared_ptr<FrustrumCuller> _frustrumCuller;
|
||||
std::shared_ptr<FrustumCuller> _frustumCuller;
|
||||
|
||||
// the patch used for actual rendering
|
||||
std::unique_ptr<LatLonPatchRenderer> _patchRenderer;
|
||||
|
||||
@@ -169,7 +169,7 @@ int ChunkNode::calculateDesiredLevelAndUpdateIsVisible(const RenderData& data, c
|
||||
|
||||
|
||||
// Do frustrum culling
|
||||
FrustrumCuller& culler = _owner.getFrustrumCuller();
|
||||
FrustumCuller& culler = _owner.getFrustumCuller();
|
||||
|
||||
if (!culler.isVisible(data, _patch, _owner.globeRadius)) {
|
||||
_isVisible = false;
|
||||
|
||||
@@ -34,17 +34,17 @@ namespace openspace {
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
// PATCH RENDERER //
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
FrustrumCuller::FrustrumCuller()
|
||||
FrustumCuller::FrustumCuller()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
FrustrumCuller::~FrustrumCuller() {
|
||||
FrustumCuller::~FrustumCuller() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool FrustrumCuller::isVisible(const RenderData& data, const vec3& point, const glm::vec2& marginScreenSpace) {
|
||||
bool FrustumCuller::isVisible(const RenderData& data, const vec3& point, const glm::vec2& marginScreenSpace) {
|
||||
|
||||
mat4 modelTransform = translate(mat4(1), data.position.vec3());
|
||||
mat4 viewTransform = data.camera.combinedViewMatrix();
|
||||
@@ -56,7 +56,7 @@ namespace openspace {
|
||||
}
|
||||
|
||||
|
||||
bool FrustrumCuller::isVisible(const RenderData& data, const GeodeticPatch& patch, double radius) {
|
||||
bool FrustumCuller::isVisible(const RenderData& data, const GeodeticPatch& patch, double radius) {
|
||||
// An axis aligned bounding box based on the patch's minimum boudning sphere is
|
||||
// used for testnig
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace openspace {
|
||||
|
||||
|
||||
|
||||
bool FrustrumCuller::testPoint(const glm::vec2& pointScreenSpace,
|
||||
bool FrustumCuller::testPoint(const glm::vec2& pointScreenSpace,
|
||||
const glm::vec2& marginScreenSpace) const
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace openspace {
|
||||
}
|
||||
|
||||
|
||||
glm::vec2 FrustrumCuller::transformToScreenSpace(const vec3& point,
|
||||
glm::vec2 FrustumCuller::transformToScreenSpace(const vec3& point,
|
||||
const mat4x4& modelViewProjection) const
|
||||
{
|
||||
vec4 pointProjectionSpace = modelViewProjection * vec4(point, 1.0f);
|
||||
|
||||
@@ -41,11 +41,11 @@ namespace openspace {
|
||||
using namespace glm;
|
||||
|
||||
|
||||
class FrustrumCuller {
|
||||
class FrustumCuller {
|
||||
public:
|
||||
|
||||
FrustrumCuller();
|
||||
~FrustrumCuller();
|
||||
FrustumCuller();
|
||||
~FrustumCuller();
|
||||
|
||||
/**
|
||||
Returns true if the point is inside the view frustrum defined in RenderData.
|
||||
|
||||
Reference in New Issue
Block a user