9 #ifndef GlobeEngine_ViewFrustum_h
10 #define GlobeEngine_ViewFrustum_h
12 #include "OpenGL_Includes.h"
14 #include <vmmlib/vmmlib.hpp>
26 this->fieldOfView = 0.0;
27 this->aspectRatio = 0.0;
28 this->nearPlane = 0.0;
37 fieldOfView(_fieldOfView), aspectRatio(_aspectRatio),
38 nearPlane(_nearPlane), farPlane(_farPlane) {}
42 fieldOfView = copy->fieldOfView;
43 aspectRatio = copy->aspectRatio;
44 nearPlane = copy->nearPlane;
45 farPlane = copy->farPlane;
64 void create(vmml::Vector3d eyePosition,
71 void draw(std::shared_ptr<ge::Camera> _cam);
72 void move(vmml::Vector3d eyePosition,
75 vmml::Vector3d right);
80 bool isInFrustum(vmml::Vector3d _position,
double radius)
const;
104 bool isPointInsidePlane(
ViewFrustumPlane _plane, vmml::Vector3d point,
double _radius)
const;
106 double pointToPlaneDistance(
ViewFrustumPlane _plane, vmml::Vector3d point)
const;
113 vmml::Vector3d points[8];
123 vmml::Vector3d nearplaneCenter;
124 vmml::Vector3d farplaneCenter;
127 vmml::Vector3d aabbMin;
128 vmml::Vector3d aabbMax;
double nearPlane
Definition: ViewFrustum.h:22
bool isRoughlyInFrustumAABB3D(vmml::Vector3d _position) const
Definition: ViewFrustum.cpp:217
Definition: DrawableComponent.h:25
double getZBufferDepth() const
Definition: ViewFrustum.cpp:338
bool isStrictlyInFrustum(vmml::Vector3d _position, double radius) const
ViewFrustum()
Definition: ViewFrustum.h:59
void setAspectRatio(double _aspectRatio)
Definition: ViewFrustum.cpp:329
ViewFrustumProperties()
Definition: ViewFrustum.h:25
vmml::Vector3d aPoint
Definition: ViewFrustum.h:52
void move(vmml::Vector3d eyePosition, vmml::Vector3d view, vmml::Vector3d up, vmml::Vector3d right)
Definition: ViewFrustum.cpp:37
Definition: ViewFrustum.h:56
void setViewFrustumProperties(ViewFrustumProperties _in)
double farPlane
Definition: ViewFrustum.h:23
double normalDotAPoint
Definition: ViewFrustum.h:53
double aspectRatio
Definition: ViewFrustum.h:21
const vmml::Vector3d * getFrustumPoints() const
Definition: ViewFrustum.cpp:305
vmml::Vector3d normal
Definition: ViewFrustum.h:51
void createVAO()
Definition: ViewFrustum.cpp:138
bool isInFrustum(vmml::Vector3d _position, double radius) const
Definition: ViewFrustum.cpp:272
double fieldOfView
Definition: ViewFrustum.h:20
void destroy()
Definition: ViewFrustum.cpp:22
void createBounds(vmml::Vector3d mid, double radius)
Definition: ViewFrustum.cpp:79
double getFieldOfView() const
Definition: ViewFrustum.cpp:324
void extractPlaneNormals()
Definition: ViewFrustum.cpp:89
void clear()
Definition: ViewFrustum.cpp:14
bool isInFrustumSphere(vmml::Vector3d _position) const
Definition: ViewFrustum.cpp:256
bool isAABB2DFarAwayFromFrustumAABB2D(vmml::Vector4d _rect, double _farFactor=1.0) const
Definition: ViewFrustum.cpp:245
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: ViewFrustum.cpp:188
void create()
Definition: ViewFrustum.h:63
void calculateAABB()
Definition: ViewFrustum.cpp:122
~ViewFrustum()
Definition: ViewFrustum.h:60
const ViewFrustumProperties * getViewFrustumProperties()
Definition: ViewFrustum.cpp:310
Definition: ViewFrustum.h:18
Definition: AvalancheTrainingSimulationEngine.h:28
Definition: ViewFrustum.h:49
double getNearPlaneDist() const
Definition: ViewFrustum.cpp:314
double getFarPlaneDist() const
Definition: ViewFrustum.cpp:319
bool isAABB2DRoughlyInFrustumAABB2D(vmml::Vector4d _rect) const
Definition: ViewFrustum.cpp:228
ViewFrustumProperties(const std::shared_ptr< ViewFrustumProperties > copy)
Definition: ViewFrustum.h:41
double getAspectRatio() const
Definition: ViewFrustum.cpp:333
ViewFrustumProperties(double _fieldOfView, double _aspectRatio, double _nearPlane, double _farPlane)
Definition: ViewFrustum.h:32
void update()
Definition: ViewFrustum.cpp:211
Definition: BoundingSphere.h:19