Cinder  0.9.1
Public Types | Public Member Functions | Protected Attributes | List of all members
cinder::FrustumT< T > Class Template Reference

#include <Frustum.h>

Public Types

enum  FrustumSection {
  NEAR, FAR, LEFT, RIGHT,
  TOP, BOTTOM
}
 
typedef glm::tvec3< T, glm::defaultpVec3T
 
typedef glm::tmat4x4< T, glm::defaultpMat4T
 

Public Member Functions

 FrustumT ()
 
 FrustumT (const Camera &cam)
 
 FrustumT (const Vec3T &ntl, const Vec3T &ntr, const Vec3T &nbl, const Vec3T &nbr, const Vec3T &ftl, const Vec3T &ftr, const Vec3T &fbl, const Vec3T &fbr)
 
 FrustumT (const Mat4T &mat)
 
void set (const Camera &cam)
 
void set (const Camera &cam, const Vec3T &ntl, const Vec3T &ntr, const Vec3T &nbl, const Vec3T &nbr)
 
void set (const Vec3T &ntl, const Vec3T &ntr, const Vec3T &nbl, const Vec3T &nbr, const Vec3T &ftl, const Vec3T &ftr, const Vec3T &fbl, const Vec3T &fbr)
 
void set (const Mat4T &mat)
 
bool contains (const Vec3T &loc) const
 
bool contains (const Vec3T &center, T radius) const
 
bool contains (const Vec3T &center, const Vec3T &size) const
 
bool contains (const Sphere &sphere) const
 
bool contains (const AxisAlignedBox &box) const
 
bool intersects (const Vec3T &loc) const
 
bool intersects (const Vec3T &center, T radius) const
 
bool intersects (const Vec3T &center, const Vec3T &size) const
 
bool intersects (const Sphere &sphere) const
 
bool intersects (const AxisAlignedBox &box) const
 
const PlaneT< T > & getPlane (FrustumSection section) const
 

Protected Attributes

PlaneT< T > mFrustumPlanes [6]
 

Member Typedef Documentation

template<typename T >
typedef glm::tvec3<T, glm::defaultp> cinder::FrustumT< T >::Vec3T
template<typename T >
typedef glm::tmat4x4<T, glm::defaultp> cinder::FrustumT< T >::Mat4T

Member Enumeration Documentation

template<typename T >
enum cinder::FrustumT::FrustumSection
Enumerator
NEAR 
FAR 
LEFT 
RIGHT 
TOP 
BOTTOM 

Constructor & Destructor Documentation

template<typename T >
cinder::FrustumT< T >::FrustumT ( )
template<typename T >
cinder::FrustumT< T >::FrustumT ( const Camera cam)

Creates a world space frustum based on the camera's parameters.

template<typename T >
cinder::FrustumT< T >::FrustumT ( const Vec3T ntl,
const Vec3T ntr,
const Vec3T nbl,
const Vec3T nbr,
const Vec3T ftl,
const Vec3T ftr,
const Vec3T fbl,
const Vec3T fbr 
)

Creates a frustum based on the corners of a near and far portal.

template<typename T >
cinder::FrustumT< T >::FrustumT ( const Mat4T mat)

Creates a frustum based on a (projection) matrix. The six planes of the frustum are derived from the matrix. To create a world space frustum, use a view-projection matrix.

Member Function Documentation

template<typename T >
void cinder::FrustumT< T >::set ( const Camera cam)

Creates a world space frustum based on the camera's parameters.

template<typename T >
void cinder::FrustumT< T >::set ( const Camera cam,
const Vec3T ntl,
const Vec3T ntr,
const Vec3T nbl,
const Vec3T nbr 
)

Creates a world space frustum based on the camera's parameters and four corners of a portal.

template<typename T >
void cinder::FrustumT< T >::set ( const Vec3T ntl,
const Vec3T ntr,
const Vec3T nbl,
const Vec3T nbr,
const Vec3T ftl,
const Vec3T ftr,
const Vec3T fbl,
const Vec3T fbr 
)

Creates a frustum based on the corners of a near and far portal.

template<typename T >
void cinder::FrustumT< T >::set ( const Mat4T mat)

Creates a frustum based on a (projection) matrix. The six planes of the frustum are derived from the matrix. To create a world space frustum, use a view-projection matrix.

template<typename T >
bool cinder::FrustumT< T >::contains ( const Vec3T loc) const

Returns true if point is within frustum.

template<typename T >
bool cinder::FrustumT< T >::contains ( const Vec3T center,
radius 
) const

Returns true if the sphere is fully contained within frustum. See also 'intersects'.

template<typename T >
bool cinder::FrustumT< T >::contains ( const Vec3T center,
const Vec3T size 
) const

Returns true if the box is fully contained within frustum. See also 'intersects'.

template<typename T >
bool cinder::FrustumT< T >::contains ( const Sphere sphere) const

Returns true if the sphere is fully contained within frustum. See also 'intersects'.

template<typename T >
bool cinder::FrustumT< T >::contains ( const AxisAlignedBox box) const

Returns true if the box is fully contained within frustum. See also 'intersects'.

template<typename T >
bool cinder::FrustumT< T >::intersects ( const Vec3T loc) const

Returns true if point is within frustum.

template<typename T >
bool cinder::FrustumT< T >::intersects ( const Vec3T center,
radius 
) const

Returns true if the sphere is fully or partially contained within frustum. See also 'contains'.

template<typename T >
bool cinder::FrustumT< T >::intersects ( const Vec3T center,
const Vec3T size 
) const

Returns true if the box is fully or partially contained within frustum. See also 'contains'.

template<typename T >
bool cinder::FrustumT< T >::intersects ( const Sphere sphere) const

Returns true if the sphere is fully or partially contained within frustum. See also 'contains'.

template<typename T >
bool cinder::FrustumT< T >::intersects ( const AxisAlignedBox box) const

Returns true if the box is fully or partially contained within frustum. See also 'contains'.

template<typename T >
const PlaneT<T>& cinder::FrustumT< T >::getPlane ( FrustumSection  section) const

Returns a const reference to the Plane associated with /a section of the Frustum.

Member Data Documentation

template<typename T >
PlaneT<T> cinder::FrustumT< T >::mFrustumPlanes[6]
protected

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