Panda3D
|
This is a unit quaternion representing a rotation. More...
Public Member Functions | |
LRotationf () | |
LRotationf (Mat3 const ) | |
lmatrix3 | |
LRotationf (Quat const ) | |
LRotationf (float, float, float, float) | |
LRotationf (VBase4 const copy) | |
LRotationf (Mat4 const ) | |
lmatrix4 | |
LRotationf (Vec3 const , float) | |
axis + angle (in degrees) | |
LRotationf (float, float, float) | |
Sets the rotation from the given Euler angles. | |
unsigned int | addHash (unsigned int hash) |
Adds the vector into the running hash. | |
unsigned int | addHash (unsigned int hash, float threshold) |
Adds the vector into the running hash. | |
addToCell (int i, float value) | |
addW (float value) | |
addX (float value) | |
addY (float value) | |
addZ (float value) | |
bool | almostEqual (Quat const other) |
Returns true if two quaternions are memberwise equal within a default tolerance based on the numeric type. | |
bool | almostEqual (Quat const other, float threshold) |
Returns true if two quaternions are memberwise equal within a specified tolerance. | |
bool | almostEqual (VBase4 const other) |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type. | |
bool | almostEqual (VBase4 const other, float threshold) |
Returns true if two vectors are memberwise equal within a specified tolerance. | |
bool | almostSameDirection (Quat const other, float threshold) |
Returns true if two quaternions represent the same rotation within a specified tolerance. | |
float | angleDeg (Quat const other) |
Returns the angle between the orientation represented by this quaternion and the other one, expressed in degrees. | |
float | angleRad (Quat const other) |
Returns the angle between the orientation represented by this quaternion and the other one, expressed in radians. | |
int | compareTo (VBase4 const other, float threshold) |
Sorts vectors lexicographically, componentwise. | |
int | compareTo (VBase4 const other) |
This flavor of compare_to uses a default threshold value based on the numeric type. | |
Quat | conjugate () |
Returns the complex conjugate of this quat. | |
bool | conjugateFrom (Quat const other) |
Computes the conjugate of the other quat, and stores the result in this quat. | |
bool | conjugateInPlace () |
Sets this to be the conjugate of the current quat. | |
float | dot (VBase4 const other) |
extractToMatrix (Mat3 m) | |
Based on the quat lib from VRPN. | |
extractToMatrix (Mat4 m) | |
Based on the quat lib from VRPN. | |
fill (float fill_value) | |
Sets each element of the vector to the indicated fill_value. | |
VBase4 | fmax (VBase4 const other) |
VBase4 | fmin (VBase4 const other) |
float | getAngle () |
This, along with get_axis(), returns the rotation represented by the quaternion as an angle about an arbitrary axis. | |
float | getAngleRad () |
This, along with get_axis(), returns the rotation represented by the quaternion as an angle about an arbitrary axis. | |
PyObject | getattr (string attr_name) |
This is used to implement swizzle masks. | |
Vec3 | getAxis () |
This, along with get_angle(), returns the rotation represented by the quaternion as an angle about an arbitrary axis. | |
Vec3 | getAxisNormalized () |
This, along with get_angle(), returns the rotation represented by the quaternion as an angle about an arbitrary axis. | |
float | getCell (int i) |
getData () | |
Returns the address of the first of the four data elements in the vector. | |
Vec3 | getForward (CoordinateSystem cs) |
Returns the orientation represented by this quaternion, expressed as a forward vector. | |
Vec3 | getForward () |
Returns the orientation represented by this quaternion, expressed as a forward vector. | |
unsigned int | getHash () |
Returns a suitable hash for phash_map. | |
unsigned int | getHash (float threshold) |
Returns a suitable hash for phash_map. | |
VBase3 | getHpr (CoordinateSystem cs) |
Extracts the equivalent Euler angles from the unit quaternion. | |
VBase3 | getHpr () |
Extracts the equivalent Euler angles from the unit quaternion. | |
float | getI () |
float | getJ () |
float | getK () |
int | getNumComponents () |
Returns the number of elements in the vector, four. | |
float | getR () |
Vec3 | getRight () |
Returns the orientation represented by this quaternion, expressed as a right vector. | |
Vec3 | getRight (CoordinateSystem cs) |
Returns the orientation represented by this quaternion, expressed as a right vector. | |
Vec3 | getUp (CoordinateSystem cs) |
Returns the orientation represented by this quaternion, expressed as an up vector. | |
Vec3 | getUp () |
Returns the orientation represented by this quaternion, expressed as an up vector. | |
float | getW () |
float | getX () |
float | getY () |
float | getZ () |
bool | invertFrom (Quat const other) |
Computes the inverse of the other quat, and stores the result in this quat. | |
bool | invertInPlace () |
Inverts the current quat. | |
bool | isAlmostIdentity (float tolerance) |
Returns true if this quaternion represents the identity transformation within a given tolerance. | |
bool | isIdentity () |
Returns true if this quaternion represents the identity transformation: no rotation. | |
bool | isNan () |
Returns true if any component of the vector is not-a-number, false otherwise. | |
bool | isSameDirection (Quat const other) |
Returns true if two quaternions represent the same rotation within a default tolerance based on the numeric type. | |
float | length () |
Returns the length of the vector, by the Pythagorean theorem. | |
float | lengthSquared () |
Returns the square of the vector's length, cheap and easy. | |
Quat | multiply (Quat const rhs) |
actual multiply call (non virtual) | |
bool | normalize () |
Normalizes the vector in place. | |
operator new (unsigned int size) | |
bool | operator!= (VBase4 const other) |
Quat | operator* (Quat const other) |
Rotation * Orientation = Orientation This is another meaningless operation, attempting to apply an orientation to a rotation. | |
LRotationf | operator* (float scalar) |
LRotationf | operator* (LRotationf const other) |
Rotation * Rotation = Rotation. | |
Mat3 | operator* (Mat3 const ) |
Quat * Matrix = matrix. | |
Mat4 | operator* (Mat4 const ) |
Quat * Matrix = matrix. | |
Quat | operator*= (Quat const ) |
VBase4 | operator*= (float scalar) |
Quat | operator+ (Quat const other) |
VBase4 | operator+ (VBase4 const other) |
VBase4 | operator+= (VBase4 const other) |
VBase4 | operator- (VBase4 const other) |
Quat | operator- (Quat const other) |
Quat | operator- () |
VBase4 | operator-= (VBase4 const other) |
LRotationf | operator/ (float scalar) |
VBase4 | operator/= (float scalar) |
bool | operator< (VBase4 const other) |
This performs a lexicographical comparison. | |
bool | operator== (VBase4 const other) |
operator[] (int i) | |
float | operator[] (int i) |
output (ostream) | |
VBase4 | project (VBase4 const onto) |
Returns a new vector representing the projection of this vector onto another one. | |
pythonRepr (ostream out, string class_name) | |
PyObject | reduce (PyObject self) |
This special Python method is implement to provide support for the pickle module. | |
set (float x, float y, float z, float w) | |
int | setattr (PyObject self, string attr_name, PyObject assign) |
This is used to implement write masks. | |
setCell (int i, float value) | |
setFromAxisAngle (float angle_deg, Vec3 const axis) | |
angle_deg is the angle about the axis in degrees. | |
setFromAxisAngleRad (float angle_rad, Vec3 const axis) | |
angle_rad is the angle about the axis in radians. | |
setFromMatrix (Mat3 const m) | |
Sets the quaternion according to the rotation represented by the matrix. | |
setFromMatrix (Mat4 const m) | |
setHpr (VBase3 const hpr) | |
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles. | |
setHpr (VBase3 const hpr, CoordinateSystem cs) | |
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles. | |
setI (float i) | |
setitem (int i, float v) | |
setJ (float j) | |
setK (float k) | |
setR (float r) | |
setW (float value) | |
setX (float value) | |
setY (float value) | |
setZ (float value) | |
VBase4 | xform (VBase4 const v) |
Transforms a 4-d vector by the indicated rotation. | |
VBase3 | xform (VBase3 const v) |
Transforms a 3-d vector by the indicated rotation. | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
static Quat const | identQuat () |
Returns an identity quaternion. | |
static Quat | pureImaginary (Vec3 const ) |
static int | size () |
Returns 4: the number of components of a LVecBase4. | |
static VBase4 const | unitW () |
Returns a unit W vector. | |
static VBase4 const | unitX () |
Returns a unit X vector. | |
static VBase4 const | unitY () |
Returns a unit Y vector. | |
static VBase4 const | unitZ () |
Returns a unit Z vector. | |
static VBase4 const | zero () |
Returns a zero-length vector. |
This is a unit quaternion representing a rotation.
LRotationf | ( | ) |
LRotationf | ( | Mat3 | const | ) |
lmatrix3
LRotationf | ( | Mat4 | const | ) |
lmatrix4
LRotationf | ( | Quat | const | ) |
LRotationf | ( | VBase4 const | copy | ) |
LRotationf | ( | Vec3 | const, |
float | |||
) |
axis + angle (in degrees)
LRotationf | ( | float | , |
float | , | ||
float | |||
) |
Sets the rotation from the given Euler angles.
LRotationf | ( | float | , |
float | , | ||
float | , | ||
float | |||
) |
Adds the vector into the running hash.
addToCell | ( | int | i, |
float | value | ||
) | [inherited] |
addW | ( | float | value | ) | [inherited] |
addX | ( | float | value | ) | [inherited] |
addY | ( | float | value | ) | [inherited] |
addZ | ( | float | value | ) | [inherited] |
bool almostEqual | ( | Quat const | other, |
float | threshold | ||
) | [inherited] |
Returns true if two quaternions are memberwise equal within a specified tolerance.
bool almostEqual | ( | Quat const | other | ) | [inherited] |
Returns true if two quaternions are memberwise equal within a default tolerance based on the numeric type.
bool almostEqual | ( | VBase4 const | other | ) | [inherited] |
Returns true if two vectors are memberwise equal within a default tolerance based on the numeric type.
bool almostEqual | ( | VBase4 const | other, |
float | threshold | ||
) | [inherited] |
Returns true if two vectors are memberwise equal within a specified tolerance.
bool almostSameDirection | ( | Quat const | other, |
float | threshold | ||
) | [inherited] |
Returns true if two quaternions represent the same rotation within a specified tolerance.
float angleDeg | ( | Quat const | other | ) | [inherited] |
Returns the angle between the orientation represented by this quaternion and the other one, expressed in degrees.
float angleRad | ( | Quat const | other | ) | [inherited] |
Returns the angle between the orientation represented by this quaternion and the other one, expressed in radians.
This flavor of compare_to uses a default threshold value based on the numeric type.
Sorts vectors lexicographically, componentwise.
Returns a number less than 0 if this vector sorts before the other one, greater than zero if it sorts after, 0 if they are equivalent (within the indicated tolerance).
Quat conjugate | ( | ) | [inherited] |
Returns the complex conjugate of this quat.
bool conjugateFrom | ( | Quat const | other | ) | [inherited] |
Computes the conjugate of the other quat, and stores the result in this quat.
This is a fully general operation and makes no assumptions about the type of transform represented by the quat.
The other quat must be a different object than this quat. However, if you need to get a conjugate of a quat in place, see conjugate_in_place.
The return value is true if the quat was successfully inverted, false if there was a singularity.
bool conjugateInPlace | ( | ) | [inherited] |
Sets this to be the conjugate of the current quat.
Returns true if the successful, false if the quat was singular.
float dot | ( | VBase4 const | other | ) | [inherited] |
extractToMatrix | ( | Mat3 | m | ) | [inherited] |
Based on the quat lib from VRPN.
extractToMatrix | ( | Mat4 | m | ) | [inherited] |
Based on the quat lib from VRPN.
fill | ( | float | fill_value | ) | [inherited] |
Sets each element of the vector to the indicated fill_value.
This is particularly useful for initializing to zero.
float getAngle | ( | ) | [inherited] |
This, along with get_axis(), returns the rotation represented by the quaternion as an angle about an arbitrary axis.
This returns the angle, in degrees counterclockwise about the axis.
It is necessary to ensure the quaternion has been normalized (for instance, with a call to normalize()) before calling this method.
float getAngleRad | ( | ) | [inherited] |
This, along with get_axis(), returns the rotation represented by the quaternion as an angle about an arbitrary axis.
This returns the angle, in radians counterclockwise about the axis.
It is necessary to ensure the quaternion has been normalized (for instance, with a call to normalize()) before calling this method.
PyObject getattr | ( | string | attr_name | ) | [inherited] |
Vec3 getAxis | ( | ) | [inherited] |
This, along with get_angle(), returns the rotation represented by the quaternion as an angle about an arbitrary axis.
This returns the axis; it is not normalized.
Vec3 getAxisNormalized | ( | ) | [inherited] |
This, along with get_angle(), returns the rotation represented by the quaternion as an angle about an arbitrary axis.
This returns the normalized axis.
float getCell | ( | int | i | ) | [inherited] |
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from Quat.
getData | ( | ) | [inherited] |
Returns the address of the first of the four data elements in the vector.
The remaining elements occupy the next positions consecutively in memory.
Vec3 getForward | ( | CoordinateSystem | cs | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as a forward vector.
Vec3 getForward | ( | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as a forward vector.
unsigned int getHash | ( | ) | [inherited] |
Returns a suitable hash for phash_map.
unsigned int getHash | ( | float | threshold | ) | [inherited] |
Returns a suitable hash for phash_map.
VBase3 getHpr | ( | CoordinateSystem | cs | ) | [inherited] |
Extracts the equivalent Euler angles from the unit quaternion.
VBase3 getHpr | ( | ) | [inherited] |
Extracts the equivalent Euler angles from the unit quaternion.
float getI | ( | ) | [inherited] |
float getJ | ( | ) | [inherited] |
float getK | ( | ) | [inherited] |
int getNumComponents | ( | ) | [inherited] |
Returns the number of elements in the vector, four.
float getR | ( | ) | [inherited] |
Vec3 getRight | ( | CoordinateSystem | cs | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as a right vector.
Vec3 getRight | ( | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as a right vector.
Vec3 getUp | ( | CoordinateSystem | cs | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as an up vector.
Vec3 getUp | ( | ) | [inherited] |
Returns the orientation represented by this quaternion, expressed as an up vector.
float getW | ( | ) | [inherited] |
float getX | ( | ) | [inherited] |
float getY | ( | ) | [inherited] |
float getZ | ( | ) | [inherited] |
static Quat const identQuat | ( | ) | [static, inherited] |
Returns an identity quaternion.
bool invertFrom | ( | Quat const | other | ) | [inherited] |
Computes the inverse of the other quat, and stores the result in this quat.
This is a fully general operation and makes no assumptions about the type of transform represented by the quat.
The other quat must be a different object than this quat. However, if you need to invert a quat in place, see invert_in_place.
The return value is true if the quat was successfully inverted, false if there was a singularity.
bool invertInPlace | ( | ) | [inherited] |
Inverts the current quat.
Returns true if the inverse is successful, false if the quat was singular.
bool isAlmostIdentity | ( | float | tolerance | ) | [inherited] |
Returns true if this quaternion represents the identity transformation within a given tolerance.
bool isIdentity | ( | ) | [inherited] |
Returns true if this quaternion represents the identity transformation: no rotation.
bool isNan | ( | ) | [inherited] |
Returns true if any component of the vector is not-a-number, false otherwise.
bool isSameDirection | ( | Quat const | other | ) | [inherited] |
Returns true if two quaternions represent the same rotation within a default tolerance based on the numeric type.
float length | ( | ) | [inherited] |
Returns the length of the vector, by the Pythagorean theorem.
float lengthSquared | ( | ) | [inherited] |
Returns the square of the vector's length, cheap and easy.
bool normalize | ( | ) | [inherited] |
Normalizes the vector in place.
Returns true if the vector was normalized, false if it was a zero-length vector.
Reimplemented from VBase4.
operator new | ( | unsigned int | size | ) | [inherited] |
bool operator!= | ( | VBase4 const | other | ) | [inherited] |
Rotation * Orientation = Orientation This is another meaningless operation, attempting to apply an orientation to a rotation.
Reimplemented from Quat.
LRotationf operator* | ( | float | scalar | ) |
Reimplemented from Quat.
LRotationf operator* | ( | LRotationf const | other | ) |
Rotation * Rotation = Rotation.
VBase4 operator*= | ( | float | scalar | ) | [inherited] |
LRotationf operator/ | ( | float | scalar | ) |
Reimplemented from Quat.
VBase4 operator/= | ( | float | scalar | ) | [inherited] |
bool operator< | ( | VBase4 const | other | ) | [inherited] |
This performs a lexicographical comparison.
It's of questionable mathematical meaning, but sometimes has a practical purpose for sorting unique vectors, especially in an STL container. Also see compare_to().
bool operator== | ( | VBase4 const | other | ) | [inherited] |
operator[] | ( | int | i | ) | [inherited] |
float operator[] | ( | int | i | ) | [inherited] |
PyObject reduce | ( | PyObject | self | ) | [inherited] |
This special Python method is implement to provide support for the pickle module.
set | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) | [inherited] |
int setattr | ( | PyObject | self, |
string | attr_name, | ||
PyObject | assign | ||
) | [inherited] |
setCell | ( | int | i, |
float | value | ||
) | [inherited] |
setFromAxisAngle | ( | float | angle_deg, |
Vec3 const | axis | ||
) | [inherited] |
angle_deg is the angle about the axis in degrees.
axis must be normalized.
setFromAxisAngleRad | ( | float | angle_rad, |
Vec3 const | axis | ||
) | [inherited] |
angle_rad is the angle about the axis in radians.
axis must be normalized.
setFromMatrix | ( | Mat4 const | m | ) | [inherited] |
setFromMatrix | ( | Mat3 const | m | ) | [inherited] |
Sets the quaternion according to the rotation represented by the matrix.
Originally we tried an algorithm presented by Do-While Jones, but that turned out to be broken. This is based on the quat lib from UNC.
setHpr | ( | VBase3 const | hpr, |
CoordinateSystem | cs | ||
) | [inherited] |
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles.
(from Real-time Rendering, p.49)
setHpr | ( | VBase3 const | hpr | ) | [inherited] |
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles.
(from Real-time Rendering, p.49)
setI | ( | float | i | ) | [inherited] |
setitem | ( | int | i, |
float | v | ||
) | [inherited] |
setJ | ( | float | j | ) | [inherited] |
setK | ( | float | k | ) | [inherited] |
setR | ( | float | r | ) | [inherited] |
setW | ( | float | value | ) | [inherited] |
setX | ( | float | value | ) | [inherited] |
setY | ( | float | value | ) | [inherited] |
setZ | ( | float | value | ) | [inherited] |
static int size | ( | ) | [static, inherited] |
Returns 4: the number of components of a LVecBase4.
static VBase4 const unitW | ( | ) | [static, inherited] |
static VBase4 const unitX | ( | ) | [static, inherited] |
static VBase4 const unitY | ( | ) | [static, inherited] |
static VBase4 const unitZ | ( | ) | [static, inherited] |