Molecular Vis
Improving perception of molecular visualization
FrustumCull Class Reference

Class for frustum-culling. More...

#include <FrustumCull.h>

Public Types

enum  Classification { OUTSIDE, INTERSECT, INSIDE }
 

Public Member Functions

void setCamInternals (float angle, float ratio, float nearD, float farD)
 
void setCamDef (const glm::vec3 &p, const glm::vec3 &l, const glm::vec3 &u)
 
Classification pointInFrustum (const glm::vec3 &p) const
 
Classification sphereInFrustum (const glm::vec3 &p, float raio) const
 

Detailed Description

Class for frustum-culling.

Member Enumeration Documentation

◆ Classification

Enum for classification of intersection

Member Function Documentation

◆ pointInFrustum()

FrustumCull::Classification FrustumCull::pointInFrustum ( const glm::vec3 &  p) const

Checks if a point lies inside the frustum region

Parameters
pcoordinates of the point to check
Returns
INSIDE or OUTSIDE depending on if the point lies inside or outside of the frustum region

◆ setCamDef()

void FrustumCull::setCamDef ( const glm::vec3 &  p,
const glm::vec3 &  l,
const glm::vec3 &  u 
)

Sets the parameters needed for calculation of frustum planes. These parameters come from the camera position and orientation. Calling this function updates the Culling Planes.

Parameters
pposition of camera
lcoordinates of point where the camera looks at / focus point.
uVector pointing up from the camera.
l,udefine the camera coordinate system.

◆ setCamInternals()

void FrustumCull::setCamInternals ( float  angle,
float  ratio,
float  nearD,
float  farD 
)

Sets the parameters needed for calculation of frustum planes. These parameters come from the camera projection

Parameters
angleField of view of camera in degrees.
ratioAspect ratio.
nearDNear plane z.
farDFar plane z.

◆ sphereInFrustum()

FrustumCull::Classification FrustumCull::sphereInFrustum ( const glm::vec3 &  p,
float  raio 
) const

Checks the intersection of a sphere with the frustum region

Parameters
pcoordinates of the center of the sphere.
raioradius of the sphere
Returns
INSIDE, INTERSECT or OUTSIDE, depending if the circle lies totally inside or partially inside or outside the frustum region

The documentation for this class was generated from the following files: