| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/lookat.h>

Public Member Functions | |
| LookAt (const Vector &from=Vector(0.0, 0.0, 1.0), const Vector &to=Vector::origin, const Vector &up=Vector(0.0, 1.0, 0.0)) | |
| void | setFromToUp (const Vector &from, const Vector &to, const Vector &up) |
| Sets from-, to-, and up-vectors. | |
| void | setFrom (const Vector &from) |
| Vector | getFrom () const |
| Get/set the from-vector. | |
| void | setTo (const Vector &to) |
| Vector | getTo () const |
| Get/set the to-vector. | |
| void | setUp (const Vector &up) |
| Vector | getUp () const |
| Get/set the up-vector. | |
| bool | isValid () const |
| virtual const Matrix & | matrix (Engine *engine=NULL) const |
| The matrix that represents the transformation. | |
| VRS_TYPEINFO (LookAt, Transform) | |
| VRS_SERIALIZABLE (LookAt) | |
Static Public Member Functions | |
| static bool | isValid (const Vector &from, const Vector &to, const Vector &up) |
| VRS::LookAt::LookAt | ( | const Vector & | from = Vector(0.0, 0.0, 1.0), |
|
| const Vector & | to = Vector::origin, |
|||
| const Vector & | up = Vector(0.0, 1.0, 0.0) | |||
| ) |
Look-at transformation. The `up' Vector is used to speficy the up-direction. However, eventually up will always be perpendicular to the view-direction. If the specified up vector leads to a degenerated view (i.e. if it is collinear with the view direction), another (valid) up-vector will be chosen instead.
Sets from-, to-, and up-vectors.
| void VRS::LookAt::setFrom | ( | const Vector & | from | ) |
| Vector VRS::LookAt::getFrom | ( | ) | const [inline] |
Get/set the from-vector.
| void VRS::LookAt::setTo | ( | const Vector & | to | ) |
| Vector VRS::LookAt::getTo | ( | ) | const [inline] |
Get/set the to-vector.
| void VRS::LookAt::setUp | ( | const Vector & | up | ) |
| Vector VRS::LookAt::getUp | ( | ) | const [inline] |
Get/set the up-vector.
| bool VRS::LookAt::isValid | ( | ) | const |
| static bool VRS::LookAt::isValid | ( | const Vector & | from, | |
| const Vector & | to, | |||
| const Vector & | up | |||
| ) | [static] |
valid() checks if from, to, and up are currently degenerate. A LookAt object is valid, if (`to'-`from') and `up' are not approximately zero and not approximately collinear.
A LookAt object must be valid to define a valid orientation matrix. Consequently, calling matrix() method of an invalid LookAt object causes an assertion. When specifying a camera using a LookAt object, note that matrix() is called during rendering.
| VRS::LookAt::VRS_SERIALIZABLE | ( | LookAt | ) |