Allolib
1.0
C++ Components For Interactive Multimedia
|
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 Vec3d & | ur () const |
Get right unit vector. | |
const Vec3d & | uu () const |
Get up unit vector. | |
const Vec3d & | uf () const |
Get forward unit vector. | |
Pose | vel () const |
Get current linear and angular velocities as a Pose. | |
double | velScale () const |
Nav & | smooth (double v) |
Set smoothing amount in [0,1) | |
Nav & | view (double azimuth, double elevation, double bank) |
Nav & | view (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. | |
Vec3d & | move () |
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. | |
Vec3d & | spin () |
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) | |
Nav & | halt () |
Stop moving and spinning. | |
Nav & | home () |
Go to origin, reset orientation. | |
Nav & | setHome () |
set current nav to be home | |
void | updateDirectionVectors () |
Update coordinate frame basis vectors based on internal quaternion. | |
Nav & | set (const Pose &v) |
Nav & | set (const Nav &v) |
void | step (double dt=1) |
Accumulate pose based on velocity. | |
double | pullBack () const |
Get pull-back amount. | |
Nav & | pullBack (double v) |
Set pull-back amount. | |
Pose & | transformed () |
Get transformed pose. | |
Pose | operator* (const Pose &v) const |
Get pose transformed by another pose. | |
Pose & | operator*= (const Pose &v) |
Translate and rotate by argument. | |
bool | operator== (const Pose &v) const |
Vec3d & | pos () |
Get "position" vector. | |
const Vec3d & | pos () const |
template<class T > | |
Pose & | pos (const Vec< 3, T > &v) |
Set position. | |
Pose & | pos (double x, double y, double z) |
Set position from individual components. | |
Vec3d & | vec () |
Get vector component. | |
const Vec3d & | vec () const |
template<class T > | |
Pose & | vec (const Vec< 3, T > &v) |
Set vector component. | |
Quatd & | quat () |
Get quaternion component (represents orientation) | |
const Quatd & | quat () const |
template<class T > | |
Pose & | quat (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. | |
Pose & | set (Pose &src) |
Copy all attributes from another Pose. | |
Pose & | setIdentity () |
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 |
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.
[in] | pos | Initial position |
[in] | smooth | Motion smoothing amount in [0,1) |
Turn to face a given world-coordinate point, while maintaining an up vector
|
inline |
Set angular velocity from azimuth, elevation, and bank differentials, in radians
Definition at line 144 of file al_ControlNav.hpp.
|
inline |
Turn by a single increment, in radians, around the right vector (elevation)
Definition at line 180 of file al_ControlNav.hpp.