Projection Class Reference

#include <Projection.h>

Inheritance diagram for Projection:

GRAObject OrthoProj PerspProj List of all members.

Public Member Functions

 Projection (double, double, double, double, double, double)
 Projection (const Projection &)
virtual Projectionclone () const =0
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
virtual Vector3 getProjectionDirection (const Vector2 &)=0

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 25 of file Projection.h.


Constructor & Destructor Documentation

Projection double  ,
double  ,
double  ,
double  ,
double  ,
double 
 

Constructors

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

Definition at line 23 of file Projection.cc.

References Projection::_projMat, and Projection::_set_clipping_planes().

Projection const Projection  ) 
 

Definition at line 34 of file Projection.cc.

References Projection::set().


Member Function Documentation

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

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
 

Definition at line 89 of file Projection.cc.

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

bool clip const Vector4 &   )  const
 

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().

virtual Projection* clone  )  const [pure virtual]
 

Clonning.

copy of source projection

Implemented in OrthoProj, and PerspProj.

Referenced by Camera::Camera().

float getBottomPlane void   )  const [inline]
 

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]
 

Definition at line 124 of file Projection.h.

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

float getLeftPlane void   )  const [inline]
 

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]
 

Definition at line 123 of file Projection.h.

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

float getPlaneHeight void   )  const [inline]
 

Definition at line 126 of file Projection.h.

Referenced by FrameBufferGL::setColor().

float getPlaneWidth void   )  const [inline]
 

Definition at line 125 of file Projection.h.

Referenced by FrameBufferGL::setColor().

void getProjectionArea Vector3 &  ,
Vector3 &  ,
Vector3 &  ,
Vector3 & 
const
 

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().

virtual Vector3 getProjectionDirection const Vector2 &   )  [pure 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

Implemented in OrthoProj, and PerspProj.

Referenced by Camera::getProjectionDirection().

float getRightPlane void   )  const [inline]
 

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]
 

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
 

Definition at line 53 of file Projection.cc.

References Projection::_projMat.

Vector4 project const Vector4 &   )  const
 

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
 

Definition at line 71 of file Projection.cc.

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

bool projectAndClip const Vector4 &  ,
Vector4 * 
const
 

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
 

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  ) 
 

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]
 

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]
 

Definition at line 33 of file Projection.h.

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

float _left [protected]
 

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]
 

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]
 

Definition at line 27 of file Projection.h.

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

float _right [protected]
 

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]
 

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