Allolib  1.0
C++ Components For Interactive Multimedia
al::Nav Class Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/io/al_ControlNav.hpp>

Inheritance diagram for al::Nav:
al::Pose

Public Member Functions

 Nav (const Vec3d &pos=Vec3d(0), double smooth=0)
 
 Nav (const Nav &nav)
 Copy constructor.
 
double smooth () const
 Get smoothing amount.
 
const Vec3dur () const
 Get right unit vector.
 
const Vec3duu () const
 Get up unit vector.
 
const Vec3duf () const
 Get forward unit vector.
 
Pose vel () const
 Get current linear and angular velocities as a Pose.
 
double velScale () const
 
Navsmooth (double v)
 Set smoothing amount in [0,1)
 
Navview (double azimuth, double elevation, double bank)
 
Navview (const Quatd &v)
 
void faceToward (const Vec3d &p, double amt=1.)
 Turn to face a given world-coordinate point.
 
void faceToward (const Vec3d &point, const Vec3d &up, double amt=1.)
 
void nudgeToward (const Vec3d &p, double amt=1.)
 Move toward a given world-coordinate point.
 
void move (double dr, double du, double df)
 Set linear velocity.
 
template<class T >
void move (const Vec< 3, T > &dp)
 
void moveR (double v)
 Set linear velocity along right vector.
 
void moveU (double v)
 Set linear velocity long up vector.
 
void moveF (double v)
 Set linear velocity long forward vector.
 
Vec3dmove ()
 
void nudge (double dr, double du, double df)
 Move by a single increment.
 
template<class T >
void nudge (const Vec< 3, T > &dp)
 
void nudgeR (double amount)
 
void nudgeU (double amount)
 
void nudgeF (double amount)
 
void spin (double da, double de, double db)
 
template<class T >
void spin (const Vec< 3, T > &daeb)
 
void spin (const Quatd &v)
 Set angular velocity from a unit quaternion (versor)
 
void spinR (double v)
 Set angular velocity around right vector (elevation), in radians.
 
void spinU (double v)
 Set angular velocity around up vector (azimuth), in radians.
 
void spinF (double v)
 Set angular velocity around forward vector (bank), in radians.
 
Vec3dspin ()
 Set angular velocity directly.
 
void turn (double az, double el, double ba)
 Turn by a single increment for one step, in radians.
 
template<class T >
void turn (const Vec< 3, T > &daeb)
 
void turnR (double v)
 
void turnU (double v)
 Turn by a single increment, in radians, around the up vector (azimuth)
 
void turnF (double v)
 Turn by a single increment, in radians, around the forward vector (bank)
 
Navhalt ()
 Stop moving and spinning.
 
Navhome ()
 Go to origin, reset orientation.
 
NavsetHome ()
 set current nav to be home
 
void updateDirectionVectors ()
 Update coordinate frame basis vectors based on internal quaternion.
 
Navset (const Pose &v)
 
Navset (const Nav &v)
 
void step (double dt=1)
 Accumulate pose based on velocity.
 
double pullBack () const
 Get pull-back amount.
 
NavpullBack (double v)
 Set pull-back amount.
 
Posetransformed ()
 Get transformed pose.
 
Pose operator* (const Pose &v) const
 Get pose transformed by another pose.
 
Poseoperator*= (const Pose &v)
 Translate and rotate by argument.
 
bool operator== (const Pose &v) const
 
Vec3dpos ()
 Get "position" vector.
 
const Vec3dpos () const
 
template<class T >
Posepos (const Vec< 3, T > &v)
 Set position.
 
Posepos (double x, double y, double z)
 Set position from individual components.
 
Vec3dvec ()
 Get vector component.
 
const Vec3dvec () const
 
template<class T >
Posevec (const Vec< 3, T > &v)
 Set vector component.
 
Quatdquat ()
 Get quaternion component (represents orientation)
 
const Quatdquat () const
 
template<class T >
Posequat (const Quat< T > &v)
 Set quaternion component.
 
double x () const
 
double y () const
 
double z () const
 
Mat4d matrix () const
 Convert to 4x4 projection space matrix.
 
Mat4d directionMatrix () const
 Convert to 4x4 direction matrix.
 
void toAED (const Vec3d &to, double &azimuth, double &elevation, double &distance) const
 Get the azimuth, elevation & distance from this to another point.
 
Vec3d ux () const
 Get world space X unit vector.
 
Vec3d uy () const
 Get world space Y unit vector.
 
Vec3d uz () const
 Get world space Z unit vector.
 
template<class T >
void unitVectors (Vec< 3, T > &ux, Vec< 3, T > &uy, Vec< 3, T > &uz) const
 Get world space unit vectors.
 
template<class T >
void directionVectors (Vec< 3, T > &ur, Vec< 3, T > &uu, Vec< 3, T > &uf) const
 Get local right, up, and forward unit vectors.
 
Pose lerp (const Pose &target, double amt) const
 Get a linear-interpolated Pose between this and another.
 
Poseset (Pose &src)
 Copy all attributes from another Pose.
 
PosesetIdentity ()
 Set to identity transform.
 
 operator Vec3d ()
 
 operator Quatd ()
 
void print () const
 Print to standard output.
 

Static Public Member Functions

static Pose identity ()
 Get identity.
 

Protected Attributes

Vec3d mMove0
 
Vec3d mMove1
 
Vec3d mSpin0
 
Vec3d mSpin1
 
Vec3d mTurn
 
Vec3d mNudge
 
Vec3d mUR
 
Vec3d mUU
 
Vec3d mUF
 
double mSmooth
 
double mVelScale
 
double mPullBack0
 
double mPullBack1
 
Pose mTransformed
 
Pose mHome
 
Vec3d mVec
 
Quatd mQuat
 

Detailed Description

This manipulates a Pose with smooth angular and positional velocities. The smoothing is done using a one-pole low-pass filter which produces an exponential ease-out type of transition.

Definition at line 61 of file al_ControlNav.hpp.

Constructor & Destructor Documentation

◆ Nav()

al::Nav::Nav ( const Vec3d pos = Vec3d(0),
double  smooth = 0 
)
Parameters
[in]posInitial position
[in]smoothMotion smoothing amount in [0,1)

Member Function Documentation

◆ faceToward()

void al::Nav::faceToward ( const Vec3d point,
const Vec3d up,
double  amt = 1. 
)

Turn to face a given world-coordinate point, while maintaining an up vector

◆ spin()

void al::Nav::spin ( double  da,
double  de,
double  db 
)
inline

Set angular velocity from azimuth, elevation, and bank differentials, in radians

Definition at line 144 of file al_ControlNav.hpp.

◆ turnR()

void al::Nav::turnR ( double  v)
inline

Turn by a single increment, in radians, around the right vector (elevation)

Definition at line 180 of file al_ControlNav.hpp.


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