The Nebula Device 3: Math::frustum Class Reference

The Nebula Device 3

Math::frustum Class Reference

#include <frustum.h>


Detailed Description

Defines a clipping frustum made of 6 planes.

(C) 2010 Radon Labs GmbH

Public Types

enum  PlaneIndex
 plane indices

Public Member Functions

 frustum ()
 default constructor
 frustum (const matrix44 &invViewProj)
 construct from view and projection matrix
void set (const matrix44 &invViewProj)
 setup from view and proj matrix
void set (const bbox &box, const matrix44 &boxTransform)
 setup from transformed bounding box
bool inside (const point &p) const
 test if point is inside frustum
uint clipmask (const point &p) const
 get clip bitmask of point (0 if inside, (1<<PlaneIndex) if outside)
ClipStatus::Type clip (const line &l, line &clippedLine) const
 clip line against view frustum
ClipStatus::Type clipstatus (const bbox &box) const
 get clip status of a local bounding box
ClipStatus::Type clipstatus (const bbox &box, const matrix44 &boxTransform) const
 get clip status of a transformed bounding box
template<typename T>
as () const
 convert to any type

Member Function Documentation

void Math::frustum::set ( const matrix44 invViewProj  )  [inline]

setup from view and proj matrix

Setup frustum from invViewProj matrix (transform from projection space into world space).

void Math::frustum::set ( const bbox box,
const matrix44 boxTransform 
) [inline]

setup from transformed bounding box

Setup from a transformed bounding box.

bool Math::frustum::inside ( const point p  )  const [inline]

test if point is inside frustum

Test if point is inside frustum.

uint Math::frustum::clipmask ( const point p  )  const [inline]

get clip bitmask of point (0 if inside, (1<<PlaneIndex) if outside)

Get clipmask of point.

ClipStatus::Type Math::frustum::clipstatus ( const bbox box,
const matrix44 boxTransform 
) const [inline]

get clip status of a transformed bounding box

Returns the clip status of a transformed bounding box.