PerspProj Class Reference

#include <PerspProj.h>

Inheritance diagram for PerspProj:

Projection GRAObject List of all members.

Public Member Functions

 PerspProj (double, double, double, double, double, double)
 PerspProj (const Projection &proj)
virtual Projectionclone () const
virtual Vector3 getProjectionDirection (const Vector2 &)
void set (const Projection &)
Vector4 project (const Vector4 &) const
Vector3 project (const Vector3 &) const
bool projectAndClip (const Vector4 &, Vector4 *) const
bool projectAndClip (const Vector3 &, Vector3 *) const
bool projectToPlane (const Vector3 &, Vector2 &) const
bool clip (const Vector4 &) const
bool clip (const Vector3 &) const
float getLeftPlane (void) const
float getRightPlane (void) const
float getBottomPlane (void) const
float getTopPlane (void) const
float getNearPlane (void) const
float getFarPlane (void) const
float getPlaneWidth (void) const
float getPlaneHeight (void) const
void getProjectionArea (Vector3 &, Vector3 &, Vector3 &, Vector3 &) const

Protected Member Functions

void _set_clipping_planes (double, double, double, double, double, double)

Protected Attributes

Matrix4 _projMat
float _left
float _right
float _bottom
float _top
float _near
float _far

Detailed Description

Definition at line 14 of file PerspProj.h.


Constructor & Destructor Documentation

PerspProj double  ,
double  ,
double  ,
double  ,
double  ,
double 
 

Constructor

, , , = corners of the near projection plane. , = DISTANCES to clipping planes.

Definition at line 5 of file PerspProj.cc.

References Projection::_bottom, Projection::_far, Projection::_left, Projection::_near, Projection::_projMat, Projection::_right, and Projection::_top.

Referenced by PerspProj::clone().

PerspProj const Projection proj  )  [inline]
 

Definition at line 26 of file PerspProj.h.


Member Function Documentation

void _set_clipping_planes double  ,
double  ,
double  ,
double  ,
double  ,
double 
[protected, inherited]
 

Definition at line 5 of file Projection.cc.

References Projection::_bottom, Projection::_far, Projection::_left, Projection::_near, Projection::_right, and Projection::_top.

Referenced by Projection::Projection(), and Projection::set().

bool clip const Vector3 &   )  const [inherited]
 

Definition at line 89 of file Projection.cc.

References Projection::_bottom, Projection::_left, Projection::_right, and Projection::_top.

bool clip const Vector4 &   )  const [inherited]
 

Clips 3D point using view volume

= point in space in the coord. system of the projection (e.g. world) = true if projected point is inside the voew frustum, false otherwise

Definition at line 82 of file Projection.cc.

References Projection::_bottom, Projection::_left, and Projection::_top.

Referenced by Projection::projectAndClip().

Projection * clone  )  const [virtual]
 

Clonning.

copy of source projection

Implements Projection.

Definition at line 57 of file PerspProj.cc.

References PerspProj::PerspProj().

float getBottomPlane void   )  const [inline, inherited]
 

Definition at line 121 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), CameraGL::_set_perspective_proj(), Camera::getPixelSize(), Camera::mapPixelToProjPlane(), Camera::project(), Camera::projectAndClip(), and FrameBufferGL::setColor().

float getFarPlane void   )  const [inline, inherited]
 

Definition at line 124 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), and CameraGL::_set_perspective_proj().

float getLeftPlane void   )  const [inline, inherited]
 

Returns raw frustum plane values

Definition at line 119 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), CameraGL::_set_perspective_proj(), Camera::getPixelSize(), Camera::mapPixelToProjPlane(), Camera::project(), Camera::projectAndClip(), and FrameBufferGL::setColor().

float getNearPlane void   )  const [inline, inherited]
 

Definition at line 123 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), and CameraGL::_set_perspective_proj().

float getPlaneHeight void   )  const [inline, inherited]
 

Definition at line 126 of file Projection.h.

Referenced by FrameBufferGL::setColor().

float getPlaneWidth void   )  const [inline, inherited]
 

Definition at line 125 of file Projection.h.

Referenced by FrameBufferGL::setColor().

void getProjectionArea Vector3 &  ,
Vector3 &  ,
Vector3 &  ,
Vector3 & 
const [inherited]
 

Returns corners of the projection area

Definition at line 105 of file Projection.cc.

References Projection::_bottom, Projection::_left, Projection::_near, Projection::_right, and Projection::_top.

Referenced by Camera::getProjectionPlane().

Vector3 getProjectionDirection const Vector2 &   )  [virtual]
 

Returns projection direction (normalized direction from the center of projection towards the point

= point at the projection plane, [0,0] is lower-left corner = normalized projection direction towards the

Implements Projection.

Definition at line 62 of file PerspProj.cc.

References Projection::_bottom, Projection::_left, and Projection::_near.

float getRightPlane void   )  const [inline, inherited]
 

Definition at line 120 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), CameraGL::_set_perspective_proj(), Camera::getPixelSize(), and Camera::mapPixelToProjPlane().

float getTopPlane void   )  const [inline, inherited]
 

Definition at line 122 of file Projection.h.

Referenced by CameraGL::_set_orthogonal_proj(), CameraGL::_set_perspective_proj(), Camera::getPixelSize(), and Camera::mapPixelToProjPlane().

Vector3 project const Vector3 &   )  const [inherited]
 

Definition at line 53 of file Projection.cc.

References Projection::_projMat.

Vector4 project const Vector4 &   )  const [inherited]
 

Projects 3D point using projection matrix (e.g. (0,0,0) projects to the "center" of view volume)

= point in space in the coord. system of camera point in space in the coord. system of frustum

Definition at line 46 of file Projection.cc.

References Projection::_projMat.

Referenced by Camera::project(), and Projection::projectAndClip().

bool projectAndClip const Vector3 &  ,
Vector3 * 
const [inherited]
 

Definition at line 71 of file Projection.cc.

References Projection::clip(), and Projection::project().

bool projectAndClip const Vector4 &  ,
Vector4 * 
const [inherited]
 

Projects and clips 3D point using projection matrix and view volume

= point in space in the coord. system of camera = point in space in the coord. system of frustum = true if projected point is inside the view frustum, false otherwise

Definition at line 60 of file Projection.cc.

References Projection::clip(), and Projection::project().

Referenced by Camera::projectAndClip(), and Projection::projectToPlane().

bool projectToPlane const Vector3 &  ,
Vector2 & 
const [inherited]
 

Projects a 3D point onto the projection plane

= point in space in the coord. system of the camera = computed projection: (0,0) = lower-left corner of projection area, (1,0) = lower-right corner of projection area, (0,1) = upper-left corner of projection area, (1,1) = upper-right corner of projection area, less the 0 or more then 1 => out of projection area = true if is inside view volume, false otherwise

Definition at line 94 of file Projection.cc.

References Projection::_bottom, Projection::_left, Projection::_right, Projection::_top, and Projection::projectAndClip().

void set const Projection  )  [inherited]
 

Copy

= source projection

Definition at line 39 of file Projection.cc.

References Projection::_bottom, Projection::_far, Projection::_left, Projection::_near, Projection::_projMat, Projection::_right, Projection::_set_clipping_planes(), and Projection::_top.

Referenced by Projection::Projection().


Member Data Documentation

float _bottom [protected, inherited]
 

Definition at line 30 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), Projection::clip(), Projection::getProjectionArea(), PerspProj::getProjectionDirection(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), Projection::projectToPlane(), and Projection::set().

float _far [protected, inherited]
 

Definition at line 33 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), and Projection::set().

float _left [protected, inherited]
 

Definition at line 28 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), Projection::clip(), Projection::getProjectionArea(), PerspProj::getProjectionDirection(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), Projection::projectToPlane(), and Projection::set().

float _near [protected, inherited]
 

Definition at line 32 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), Projection::getProjectionArea(), PerspProj::getProjectionDirection(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), and Projection::set().

Matrix4 _projMat [protected, inherited]
 

Definition at line 27 of file Projection.h.

Referenced by OrthoProj::OrthoProj(), PerspProj::PerspProj(), Projection::project(), Projection::Projection(), and Projection::set().

float _right [protected, inherited]
 

Definition at line 29 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), Projection::clip(), Projection::getProjectionArea(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), Projection::projectToPlane(), and Projection::set().

float _top [protected, inherited]
 

Definition at line 31 of file Projection.h.

Referenced by Projection::_set_clipping_planes(), Projection::clip(), Projection::getProjectionArea(), OrthoProj::OrthoProj(), PerspProj::PerspProj(), Projection::projectToPlane(), and Projection::set().


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 15:11:43 2006 for gra by  doxygen 1.4.6