| Home | Download | Screen shots | Discussion | Documentation |
|---|
A POD-struct comprising a quaternion. More...
#include <openvrml/basetypes.h>
Public Member Functions | |
| quatf & | operator*= (const quatf &quat) throw () |
| Multiply by a quaternion. More... | |
| quatf & | operator*= (float scalar) throw () |
| Multiply by a scalar. More... | |
| quatf & | operator/= (float scalar) throw () |
| Divide by a scalar. More... | |
| quatf & | operator+= (const quatf &quat) throw () |
| Add a quaternion. More... | |
| quatf & | operator-= (const quatf &quat) throw () |
| Subtract a quaternion. More... | |
| const float & | operator[] (std::size_t index) const throw () |
| Array element dereference operator (const version). More... | |
| float & | operator[] (std::size_t index) throw () |
| Array element dereference operator (non-const version). More... | |
| float | x () const throw () |
| Get the x component. More... | |
| float | y () const throw () |
| Get the y component. More... | |
| float | z () const throw () |
| Get the z component. More... | |
| float | w () const throw () |
| Get the w component. More... | |
| void | x (float value) throw () |
| Set the x component. More... | |
| void | y (float value) throw () |
| Set the y component. More... | |
| void | z (float value) throw () |
| Set the z component. More... | |
| void | w (float value) throw () |
| Set the w component. More... | |
| const quatf | conjugate () const throw () |
| Get the conjugate. More... | |
| const quatf | inverse () const throw () |
| Get the inverse. More... | |
| float | norm () const throw () |
| Get the norm. More... | |
| const quatf | normalize () const throw () |
| Normalize the quaternion. More... | |
Public Attributes | |
| float | quat [4] |
| An array comprising the quaternion components. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| const openvrml::quatf | make_quatf () throw() |
Create a default quatf. More... | |
| const openvrml::quatf | make_quatf (const float x, const float y, const float z, const float w) throw() |
Create a quatf from four values. More... | |
| const openvrml::quatf | make_quatf (const float(&quat)[4]) throw() |
Create a quatf from an array of four values. More... | |
| const openvrml::quatf | make_quatf (const mat4f &mat) throw() |
Create a quatf from a rotation matrix. More... | |
| const openvrml::quatf | make_quatf (const rotation &rot) throw() |
Create a quatf from a rotation. More... | |
| const openvrml::quatf | operator* (const quatf &lhs, const quatf &rhs) throw() |
| Multiply two quaternions. More... | |
| const openvrml::quatf | operator* (const quatf &quat, const float scalar) throw() |
| Multiply a quaternion by a scalar. More... | |
| const openvrml::quatf | operator* (const float scalar, const quatf &quat) throw() |
| Multiply a scalar by a quaternion. More... | |
| const openvrml::quatf | operator/ (const quatf &quat, const float scalar) throw() |
| Divide a quaternion by a scalar. More... | |
| const openvrml::quatf | operator+ (const quatf &lhs, const quatf &rhs) throw() |
| Add two quaternions. More... | |
| const openvrml::quatf | operator- (const quatf &lhs, const quatf &rhs) throw() |
| Take the difference between two quaternions. More... | |
| std::ostream & | operator<< (std::ostream &out, const quatf &quat) |
| Stream output. More... | |
| bool | operator== (const quatf &lhs, const quatf &rhs) throw() |
| Compare for equality. More... | |
| bool | operator!= (const quatf &lhs, const quatf &rhs) throw() |
| Compare for inequality. More... | |
A POD-struct comprising a quaternion.
| openvrml::quatf & openvrml::quatf::operator*= | ( | const quatf & | quat | ) | |
| throw | ( | ||||
| ) | |||||
Multiply by a quaternion.
| [in] | quat | the quaternion by which to multiply. |
| openvrml::quatf & openvrml::quatf::operator*= | ( | float | scalar | ) | |
| throw | ( | ||||
| ) | |||||
Multiply by a scalar.
| [in] | scalar | value by which to multiply. |
| openvrml::quatf & openvrml::quatf::operator/= | ( | float | scalar | ) | |
| throw | ( | ||||
| ) | |||||
Divide by a scalar.
| [in] | scalar | value by which to divide. |
| openvrml::quatf & openvrml::quatf::operator+= | ( | const quatf & | quat | ) | |
| throw | ( | ||||
| ) | |||||
Add a quaternion.
| [in] | quat | the quaternion to add. |
| openvrml::quatf & openvrml::quatf::operator-= | ( | const quatf & | quat | ) | |
| throw | ( | ||||
| ) | |||||
Subtract a quaternion.
| [in] | quat | the quaternion to subtract. |
|
inline | ||||||||||||||
Array element dereference operator (const version).
| [in] | index | an index from 0–3. |
index is not larger than 3.
|
inline | ||||||||||||||
Array element dereference operator (non-const version).
| [in] | index | an index from 0–3. |
index is not larger than 3.
|
inline | |||||||||||||
Get the x component.
|
inline | |||||||||||||
Get the y component.
|
inline | |||||||||||||
Get the z component.
|
inline | |||||||||||||
Get the w component.
|
inline | ||||||||||||||
Set the x component.
| [in] | value | x component value. |
|
inline | ||||||||||||||
Set the y component.
| [in] | value | y component value. |
|
inline | ||||||||||||||
Set the z component.
| [in] | value | z component value. |
|
inline | ||||||||||||||
Set the w component.
| [in] | value | w component value. |
| const openvrml::quatf openvrml::quatf::conjugate | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get the conjugate.
| const openvrml::quatf openvrml::quatf::inverse | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get the inverse.
| float openvrml::quatf::norm | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get the norm.
| const openvrml::quatf openvrml::quatf::normalize | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Normalize the quaternion.
|
related | |||||||||||||
Create a default quatf.
quatf with the value [0.0, 0.0, 0.0, 1.0].
|
related | ||||||||||||||||||||||||||||
Create a quatf from four values.
| [in] | x | the x vector component. |
| [in] | y | the y vector component. |
| [in] | z | the z vector component. |
| [in] | w | the scalar value w. |
quatf with the value [x, y, z, w].
|
related | ||||||||||||||
Create a quatf from an array of four values.
| [in] | quat | the first three values in the array are used for the x, y, and z vector components, respectively. The fourth value in the array is used for the scalar part of the quaternion. |
quatf with the values in quat.
|
related | ||||||||||||||
Create a quatf from a rotation matrix.
| [in] | mat | a rotation matrix. |
quatf corresponding to the rotation applied by mat.
|
related | ||||||||||||||
Create a quatf from a rotation.
| [in] | rot | a rotation. |
quatf corresponding to the rotation applied by rot.
|
related | ||||||||||||||||||||
Multiply two quaternions.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
lhs and rhs.
|
related | ||||||||||||||||||||
Multiply a quaternion by a scalar.
| [in] | quat | quaternion. |
| [in] | scalar | scalar. |
quat and scalar.
|
related | ||||||||||||||||||||
Multiply a scalar by a quaternion.
| [in] | scalar | scalar. |
| [in] | quat | quaternion. |
scalar and quat.
|
related | ||||||||||||||||||||
Divide a quaternion by a scalar.
| [in] | quat | quaternion. |
| [in] | scalar | scalar. |
quat by scalar.
|
related | ||||||||||||||||||||
Add two quaternions.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
lhs and rhs.
|
related | ||||||||||||||||||||
Take the difference between two quaternions.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
lhs and rhs.
|
related |
Stream output.
| [in,out] | out | an output stream. |
| [in] | quat | a quaternion. |
out. Compare for equality.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
true if lhs and rhs are equal; false otherwise. Compare for inequality.
| [in] | lhs | left-hand operand. |
| [in] | rhs | right-hand operand. |
true if lhs and rhs are not equal; false otherwise. | float openvrml::quatf::quat[4] |
An array comprising the quaternion components.