Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Ult::Frustum Class Reference

#include <Frustum.h>

Public Member Functions

 Frustum ()
 
void CalculateFrustum (const float angle, const float ratio, const float near, const float far, const Vector3D &camPos, const Vector3D &lookAt, const Vector3D &up)
 
void AddPlane (const Plane &pl)
 
bool GetPlane (const int index, Plane *out) const
 
int GetTotalPlanes () const
 
bool IsPointVisible (const float x, const float y, const float z)
 
bool IsSphereVisible (const float x, const float y, const float z, const float radius)
 
bool IsCubeVisible (const float x, const float y, const float z, const float size)
 
bool IsBoxVisible (const Vector3D &min, const Vector3D &max)
 
bool IsObbVisible (const OBB &obb)
 

Detailed Description

Collection of 6 planes making up a 3d frustum.

Constructor & Destructor Documentation

◆ Frustum()

Ult::Frustum::Frustum ( )

Frustum constructor.

Member Function Documentation

◆ AddPlane()

void Ult::Frustum::AddPlane ( const Plane & pl)

Copy the input plane to the internal frustum planes.

◆ CalculateFrustum()

void Ult::Frustum::CalculateFrustum ( const float angle,
const float ratio,
const float near,
const float far,
const Vector3D & camPos,
const Vector3D & lookAt,
const Vector3D & up )

Initialize as a camera frustum from the input parameters.

◆ GetPlane()

bool Ult::Frustum::GetPlane ( const int index,
Plane * out ) const

Store the frustum plane at the given index into 'out'.

◆ GetTotalPlanes()

int Ult::Frustum::GetTotalPlanes ( ) const
inline

Return the number of stored frustum planes.

◆ IsBoxVisible()

bool Ult::Frustum::IsBoxVisible ( const Vector3D & min,
const Vector3D & max )

Returns true if the input box overlaps the frustum.

◆ IsCubeVisible()

bool Ult::Frustum::IsCubeVisible ( const float x,
const float y,
const float z,
const float size )

Returns true if the input cube overlaps the frustum.

Parameters
x,y,zThe cube's center position.
sizeThe half width/length/height of the cube.

◆ IsObbVisible()

bool Ult::Frustum::IsObbVisible ( const OBB & obb)

Returns true if the input oriented bounding-box overlaps the frustum.

◆ IsPointVisible()

bool Ult::Frustum::IsPointVisible ( const float x,
const float y,
const float z )

Returns true if the input point is within the frustum.

◆ IsSphereVisible()

bool Ult::Frustum::IsSphereVisible ( const float x,
const float y,
const float z,
const float radius )

Returns true if the input sphere overlaps the frustum.

Parameters
x,y,zThe sphere's center position

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