Classes | |
class | Camera |
class | RollingAverage |
class | ScrollMomentum |
Utility class for adding simple momentum to 2D or 3D UI elements. More... | |
class | SmartArrayDestructor |
alternative destructor for arrays of objects More... | |
class | SmartInstanceDestructor |
default destruction template class used by smart pointer. More... | |
class | SmartPointer |
Functions | |
const char * | BoolToStr (uint32_t bVal) |
Leap::Vector | CartesianToSpherical (const Leap::Vector &vCartesian) |
template<typename T > | |
T | Clamp (T inVal, T minVal, T maxVal) |
Leap::Vector | ComponentWiseMax (const Leap::Vector &vLHS, const Leap::Vector &vRHS) |
Leap::Vector | ComponentWiseMin (const Leap::Vector &vLHS, const Leap::Vector &vRHS) |
Leap::Vector | ComponentWiseReciprocal (const Leap::Vector &vVec) |
Leap::Vector | ComponentWiseScale (const Leap::Vector &vLHS, const Leap::Vector &vRHS) |
float | Elevation (const Leap::Vector &vVec) |
compute the spherical elevation of a vector direction in y above the z/x plane | |
Leap::Matrix | ExtractRotation (const Leap::Matrix &mtxTransform) |
create a new matrix with just the rotation block from the argument matrix | |
template<class Vec2 > | |
Leap::Vector | FromVector2 (const Vec2 &vIn, float fZ=0.0f) |
requires that the source vector type have direct member access with names x, y | |
template<class Vec3 > | |
Leap::Vector | FromVector3 (const Vec3 &vIn) |
requires that the source vector type have direct member access with names x, y, z | |
float | Heading (const Leap::Vector &vVec) |
compute the polar/spherical heading of a vector direction in z/x plane | |
template<typename T > | |
bool | IsNearEqual (const T &a, const T &b) |
works with Vectors as well as floats | |
bool | IsNearZero (float fVal) |
bool | IsNearZero (const Leap::Vector &vVec) |
template<typename InterpType , typename ParamType > | |
InterpType | Linterp (InterpType a, InterpType b, ParamType t) |
works with Vector as well as floating point scalar types. | |
template<typename T > | |
T | Max (T lhs, T rhs) |
float | MaxComponent (const Leap::Vector &vVec) |
template<typename T > | |
T | Min (T lhs, T rhs) |
float | MinComponent (const Leap::Vector &vVec) |
Leap::Vector | NormalizeSpherical (const Leap::Vector &vSpherical) |
set magnitude to 1 and bring heading to (-Pi,Pi], elevation into [-Pi/2, Pi/2] | |
Leap::Matrix | RigidInverse (const Leap::Matrix &mtxTransform) |
Leap::Matrix | RotationInverse (const Leap::Matrix &mtxRot) |
returns a matrix representing the inverse rotation by simple transposition of the rotation block. | |
Leap::Vector | SphericalToCartesian (const Leap::Vector &vSpherical) |
Variables | |
static const float | kf2Pi = kfPi + kfPi |
static const float | kfEpsilon = 0.00001f |
static const float | kfHalfPi = kfPi * 0.5f |
static const float | kfPi = Leap::PI |
const char* LeapUtil::BoolToStr | ( | uint32_t | bVal | ) | [inline] |
Definition at line 209 of file LeapUtil.h.
Leap::Vector LeapUtil::CartesianToSpherical | ( | const Leap::Vector & | vCartesian | ) | [inline] |
convert from Cartesian (rectangular) coordinates to spherical coordinates (magnitude, heading, elevation)
Definition at line 168 of file LeapUtil.h.
T LeapUtil::Clamp | ( | T | inVal, |
T | minVal, | ||
T | maxVal | ||
) |
Definition at line 58 of file LeapUtil.h.
Leap::Vector LeapUtil::ComponentWiseMax | ( | const Leap::Vector & | vLHS, |
const Leap::Vector & | vRHS | ||
) | [inline] |
Definition at line 129 of file LeapUtil.h.
Leap::Vector LeapUtil::ComponentWiseMin | ( | const Leap::Vector & | vLHS, |
const Leap::Vector & | vRHS | ||
) | [inline] |
Definition at line 124 of file LeapUtil.h.
Leap::Vector LeapUtil::ComponentWiseReciprocal | ( | const Leap::Vector & | vVec | ) | [inline] |
Definition at line 139 of file LeapUtil.h.
Leap::Vector LeapUtil::ComponentWiseScale | ( | const Leap::Vector & | vLHS, |
const Leap::Vector & | vRHS | ||
) | [inline] |
Definition at line 134 of file LeapUtil.h.
float LeapUtil::Elevation | ( | const Leap::Vector & | vVec | ) | [inline] |
compute the spherical elevation of a vector direction in y above the z/x plane
Definition at line 161 of file LeapUtil.h.
Leap::Matrix LeapUtil::ExtractRotation | ( | const Leap::Matrix & | mtxTransform | ) | [inline] |
create a new matrix with just the rotation block from the argument matrix
Definition at line 102 of file LeapUtil.h.
Leap::Vector LeapUtil::FromVector2 | ( | const Vec2 & | vIn, |
float | fZ = 0.0f |
||
) |
requires that the source vector type have direct member access with names x, y
Definition at line 72 of file LeapUtil.h.
Leap::Vector LeapUtil::FromVector3 | ( | const Vec3 & | vIn | ) |
requires that the source vector type have direct member access with names x, y, z
Definition at line 79 of file LeapUtil.h.
float LeapUtil::Heading | ( | const Leap::Vector & | vVec | ) | [inline] |
compute the polar/spherical heading of a vector direction in z/x plane
Definition at line 155 of file LeapUtil.h.
bool LeapUtil::IsNearEqual | ( | const T & | a, |
const T & | b | ||
) | [inline] |
works with Vectors as well as floats
Definition at line 96 of file LeapUtil.h.
bool LeapUtil::IsNearZero | ( | float | fVal | ) | [inline] |
Definition at line 84 of file LeapUtil.h.
bool LeapUtil::IsNearZero | ( | const Leap::Vector & | vVec | ) | [inline] |
Definition at line 89 of file LeapUtil.h.
InterpType LeapUtil::Linterp | ( | InterpType | a, |
InterpType | b, | ||
ParamType | t | ||
) |
works with Vector as well as floating point scalar types.
Definition at line 65 of file LeapUtil.h.
T LeapUtil::Max | ( | T | lhs, |
T | rhs | ||
) |
Definition at line 52 of file LeapUtil.h.
float LeapUtil::MaxComponent | ( | const Leap::Vector & | vVec | ) | [inline] |
Definition at line 149 of file LeapUtil.h.
T LeapUtil::Min | ( | T | lhs, |
T | rhs | ||
) |
Definition at line 46 of file LeapUtil.h.
float LeapUtil::MinComponent | ( | const Leap::Vector & | vVec | ) | [inline] |
Definition at line 144 of file LeapUtil.h.
Leap::Vector LeapUtil::NormalizeSpherical | ( | const Leap::Vector & | vSpherical | ) | [inline] |
set magnitude to 1 and bring heading to (-Pi,Pi], elevation into [-Pi/2, Pi/2]
Definition at line 174 of file LeapUtil.h.
Leap::Matrix LeapUtil::RigidInverse | ( | const Leap::Matrix & | mtxTransform | ) | [inline] |
returns a matrix that is the orthonormal inverse of the argument matrix. this is only valid if the input matrix is orthonormal (the basis vectors are mutually perpendicular and of length 1)
Definition at line 117 of file LeapUtil.h.
Leap::Matrix LeapUtil::RotationInverse | ( | const Leap::Matrix & | mtxRot | ) | [inline] |
returns a matrix representing the inverse rotation by simple transposition of the rotation block.
Definition at line 108 of file LeapUtil.h.
Leap::Vector LeapUtil::SphericalToCartesian | ( | const Leap::Vector & | vSpherical | ) | [inline] |
convert from spherical coordinates (magnitude, heading, elevation) to Cartesian (rectangular) coordinates
Definition at line 196 of file LeapUtil.h.
const float LeapUtil::kf2Pi = kfPi + kfPi [static] |
Definition at line 41 of file LeapUtil.h.
const float LeapUtil::kfEpsilon = 0.00001f [static] |
Definition at line 43 of file LeapUtil.h.
const float LeapUtil::kfHalfPi = kfPi * 0.5f [static] |
Definition at line 42 of file LeapUtil.h.
const float LeapUtil::kfPi = Leap::PI [static] |
LeapMath is not intended to be a full-function vector math library. It defines a few useful classes that are needed to pass vector values around and do a few basic spatial operations. You are highly encouraged to use a complete and optimized vector math library for any serious computation. math utility functions To minimize additional code requirements for Leap samples no external math library is used. These utility functions provide extra functionality not available in LeapMath. In general this code is designed for transparency and simplicity rather than speed. It is a minimal subset of extra functionality needed to implement LeapScene and the sample code. It is not intended to be a complete vector math utility library.
Definition at line 40 of file LeapUtil.h.