PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PurePosUpTarget Class Reference

PURE class for PUT (position, up and target) vectors. More...

Detailed Description

PURE class for PUT (position, up and target) vectors.

PURE uses the left-handed Cartesian coordinate system. This means the XZ plane is horizontal, the XY and and YZ planes are vertical, a positive X value means right, a positive Y value means up, and a positive Z value means forward.

Definition at line 26 of file PurePosUpTarget.h.

#include <PurePosUpTarget.h>

+ Inheritance diagram for PurePosUpTarget:

Public Member Functions

 PurePosUpTarget ()
 Initializes the position vector to [0,0,0], the up vector to [0,1,0] and the target vector to [0,0,1].
 
 PurePosUpTarget (const PurePosUpTarget &cm)
 
 PurePosUpTarget (const PureVector &pos, const PureVector &target, const PureVector &up)
 Initializes the position, up and target vectors with the given vectors.
 
PureVectorgetPosVec ()
 Gets Position vector.
 
const PureVectorgetPosVec () const
 Gets Position vector.
 
PureVectorgetTargetVec ()
 Gets Target vector.
 
const PureVectorgetTargetVec () const
 Gets Target vector.
 
PureVectorgetUpVec ()
 Gets Up vector.
 
const PureVectorgetUpVec () const
 Gets Up vector.
 
void Move (TPureFloat amount)
 Moves forward or backward by the specified amount based on current direction.
 
void Strafe (TPureFloat amount)
 Moves horizontally by the specified amount based on current direction.
 
void Elevate (TPureFloat amount)
 Changes Y-position by the specified amount.
 
void SetRotation (TPureFloat x, TPureFloat y, TPureFloat z)
 Sets direction.
 
TPureBool operator== (const PurePosUpTarget &clr) const
 Equals to operator.
 
TPureBool operator!= (const PurePosUpTarget &clr) const
 Not equals to operator.
 
PurePosUpTargetoperator= (const PurePosUpTarget &vec)
 Assignment operator.
 

Private Attributes

PureVector vPos
 
PureVector vTarget
 
PureVector vUp
 Position (eye), target (focus or view), up vectors.
 

Constructor & Destructor Documentation

◆ PurePosUpTarget() [1/3]

PurePosUpTarget::PurePosUpTarget ( )

Initializes the position vector to [0,0,0], the up vector to [0,1,0] and the target vector to [0,0,1].

Definition at line 21 of file PurePosUpTarget.cpp.

◆ PurePosUpTarget() [2/3]

PurePosUpTarget::PurePosUpTarget ( const PurePosUpTarget & cm)

Definition at line 28 of file PurePosUpTarget.cpp.

◆ PurePosUpTarget() [3/3]

PurePosUpTarget::PurePosUpTarget ( const PureVector & pos,
const PureVector & target,
const PureVector & up )

Initializes the position, up and target vectors with the given vectors.

Definition at line 38 of file PurePosUpTarget.cpp.

Member Function Documentation

◆ Elevate()

void PurePosUpTarget::Elevate ( TPureFloat amount)

Changes Y-position by the specified amount.

Definition at line 141 of file PurePosUpTarget.cpp.

◆ getPosVec() [1/2]

PureVector & PurePosUpTarget::getPosVec ( )

Gets Position vector.

By default it is (0,0,0). We are looking from the Position vector to the Target vector. Changing the Position vector will result in changing the pitch and/or the yaw i.e. rotation along the X- and/or the Y-axis. If you don't want to change pitch and yaw, apply the same change to the Target vector as well: use the Move()/Strafe()/Elevate() functions.

Definition at line 52 of file PurePosUpTarget.cpp.

◆ getPosVec() [2/2]

const PureVector & PurePosUpTarget::getPosVec ( ) const

Gets Position vector.

By default it is (0,0,0). We are looking from the Position vector to the Target vector. Changing the Position vector will result in changing the pitch and/or the yaw i.e. rotation along the X- and/or the Y-axis. If you don't want to change pitch and yaw, apply the same change to the Target vector as well: use the Move()/Strafe()/Elevate() functions.

Definition at line 64 of file PurePosUpTarget.cpp.

◆ getTargetVec() [1/2]

PureVector & PurePosUpTarget::getTargetVec ( )

Gets Target vector.

We are looking from the Position vector to the Target vector. By default it is (0,0,1) which means 0 degrees pitch and yaw together with the default (0,0,0) Position vector. Changing the Target vector will result in changing the pitch and/or the yaw i.e. rotation along the X- and/or the Y-axis. If you don't want to change pitch and yaw, apply the same change to the Position vector as well: use the Move()/Strafe()/Elevate() functions.

Definition at line 76 of file PurePosUpTarget.cpp.

◆ getTargetVec() [2/2]

const PureVector & PurePosUpTarget::getTargetVec ( ) const

Gets Target vector.

We are looking from the Position vector to the Target vector. By default it is (0,0,1) which means 0 degrees pitch and yaw together with the default (0,0,0) Position vector. Changing the Target vector will result in changing the pitch and/or the yaw i.e. rotation along the X- and/or the Y-axis. If you don't want to change pitch and yaw, apply the same change to the Position vector as well: use the Move()/Strafe()/Elevate() functions.

Definition at line 88 of file PurePosUpTarget.cpp.

◆ getUpVec() [1/2]

PureVector & PurePosUpTarget::getUpVec ( )

Gets Up vector.

By default it is (0,1,0) meaning 0 degrees roll. Changing the Up vector results in rotation along the Z axis.

Definition at line 98 of file PurePosUpTarget.cpp.

◆ getUpVec() [2/2]

const PureVector & PurePosUpTarget::getUpVec ( ) const

Gets Up vector.

By default it is (0,1,0) meaning 0 degrees roll. Changing the Up vector results in rotation along the Z axis.

Definition at line 108 of file PurePosUpTarget.cpp.

◆ Move()

void PurePosUpTarget::Move ( TPureFloat amount)

Moves forward or backward by the specified amount based on current direction.

Definition at line 116 of file PurePosUpTarget.cpp.

◆ operator!=()

TPureBool PurePosUpTarget::operator!= ( const PurePosUpTarget & clr) const

Not equals to operator.

Definition at line 183 of file PurePosUpTarget.cpp.

◆ operator=()

PurePosUpTarget & PurePosUpTarget::operator= ( const PurePosUpTarget & vec)

Assignment operator.

Definition at line 192 of file PurePosUpTarget.cpp.

◆ operator==()

TPureBool PurePosUpTarget::operator== ( const PurePosUpTarget & clr) const

Equals to operator.

Definition at line 174 of file PurePosUpTarget.cpp.

◆ SetRotation()

void PurePosUpTarget::SetRotation ( TPureFloat x,
TPureFloat y,
TPureFloat z )

Sets direction.

Definition at line 150 of file PurePosUpTarget.cpp.

◆ Strafe()

void PurePosUpTarget::Strafe ( TPureFloat amount)

Moves horizontally by the specified amount based on current direction.

Definition at line 127 of file PurePosUpTarget.cpp.

Member Data Documentation

◆ vPos

PureVector PurePosUpTarget::vPos
private

Definition at line 67 of file PurePosUpTarget.h.

◆ vTarget

PureVector PurePosUpTarget::vTarget
private

Definition at line 67 of file PurePosUpTarget.h.

◆ vUp

PureVector PurePosUpTarget::vUp
private

Position (eye), target (focus or view), up vectors.

Definition at line 67 of file PurePosUpTarget.h.


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