Home | Download | Screen shots | Discussion | Documentation |
---|
Public Member Functions | |
quatf () throw () | |
Default constructor. | |
quatf (float x, float y, float z, float w) throw () | |
Construct from four values. | |
quatf (const float(&quat)[4]) throw () | |
Construct from an array of four values. | |
quatf (const rotation &rot) throw () | |
Construct from an rotation. | |
quatf (const mat4f &mat) throw () | |
Construct from a rotation matrix. | |
quatf & | operator *= (const quatf &quat) throw () |
Multiply by a quaternion. | |
quatf & | operator *= (float scalar) throw () |
Multiply by a scalar. | |
quatf & | operator/= (float scalar) throw () |
Divide by a scalar. | |
quatf & | operator+= (const quatf &quat) throw () |
Add a quaternion. | |
quatf & | operator-= (const quatf &quat) throw () |
Subtract a quaternion. | |
const float & | operator[] (size_t index) const throw () |
Array element dereference operator (const version). | |
float & | operator[] (size_t index) throw () |
Array element dereference operator (non-const version). | |
float | x () const throw () |
Get the x component. | |
float | y () const throw () |
Get the y component. | |
float | z () const throw () |
Get the z component. | |
float | w () const throw () |
Get the w component. | |
void | x (float value) throw () |
Set the x component. | |
void | y (float value) throw () |
Set the y component. | |
void | z (float value) throw () |
Set the z component. | |
void | w (float value) throw () |
Set the w component. | |
const quatf | conjugate () const throw () |
Get the conjugate. | |
const quatf | inverse () const throw () |
Get the inverse. | |
float | norm () const throw () |
Get the norm. | |
const quatf | normalize () const throw () |
Normalize the quaternion. | |
Private Attributes | |
float | quat [4] |
An array comprising the quaternion components. | |
Related Functions | |
(Note that these are not member functions.) | |
const quatf | operator * (const quatf &lhs, const quatf &rhs) throw() |
Multiply two quaternions. | |
const quatf | operator * (const quatf &quat, const float scalar) throw() |
Multiply a quaternion by a scalar. | |
const quatf | operator * (const float scalar, const quatf &quat) throw() |
Multiply a scalar by a quaternion. | |
const quatf | operator/ (const quatf &quat, const float scalar) throw() |
Divide a quaternion by a scalar. | |
const quatf | operator+ (const quatf &lhs, const quatf &rhs) throw() |
Add two quaternions. | |
const quatf | operator- (const quatf &lhs, const quatf &rhs) throw() |
Take the difference between two quaternions. | |
std::ostream & | operator<< (std::ostream &out, const quatf &quat) |
Stream output. | |
bool | operator== (const quatf &lhs, const quatf &rhs) throw() |
Compare for equality. | |
bool | operator!= (const quatf &lhs, const quatf &rhs) throw() |
Compare for inequality. |
openvrml::quatf::quatf | ( | ) | throw () |
Default constructor.
openvrml::quatf::quatf | ( | float | x, | |
float | y, | |||
float | z, | |||
float | w | |||
) | throw () |
Construct from four values.
x | the x vector component. | |
y | the y vector component. | |
z | the z vector component. | |
w | the scalar value w. |
openvrml::quatf::quatf | ( | const float & | quat[4] | ) | throw () [explicit] |
Construct from an array of four values.
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. |
openvrml::quatf::quatf | ( | const rotation & | rot | ) | throw () [explicit] |
Construct from an rotation.
rot | a rotation. |
openvrml::quatf::quatf | ( | const mat4f & | mat | ) | throw () [explicit] |
Construct from a rotation matrix.
mat | a rotation matrix. |
Multiply by a quaternion.
quat | the quaternion by which to multiply. |
quatf & openvrml::quatf::operator *= | ( | float | scalar | ) | throw () |
Multiply by a scalar.
scalar | value by which to multiply. |
quatf & openvrml::quatf::operator/= | ( | float | scalar | ) | throw () |
Divide by a scalar.
scalar | value by which to divide. |
Add a quaternion.
quat | the quaternion to add. |
Subtract a quaternion.
quat | the quaternion to subtract. |
const float & openvrml::quatf::operator[] | ( | size_t | index | ) | const throw () [inline] |
Array element dereference operator (const version).
index | an index from 0 - 3. |
index
is not larger than 3. float & openvrml::quatf::operator[] | ( | size_t | index | ) | throw () [inline] |
Array element dereference operator (non-const version).
index | an index from 0 - 3. |
index
is not larger than 3. float openvrml::quatf::x | ( | ) | const throw () [inline] |
Get the x component.
float openvrml::quatf::y | ( | ) | const throw () [inline] |
Get the y component.
float openvrml::quatf::z | ( | ) | const throw () [inline] |
Get the z component.
float openvrml::quatf::w | ( | ) | const throw () [inline] |
Get the w component.
void openvrml::quatf::x | ( | float | value | ) | throw () [inline] |
Set the x component.
value | x component value. |
void openvrml::quatf::y | ( | float | value | ) | throw () [inline] |
Set the y component.
value | y component value. |
void openvrml::quatf::z | ( | float | value | ) | throw () [inline] |
Set the z component.
value | z component value. |
void openvrml::quatf::w | ( | float | value | ) | throw () [inline] |
Set the w component.
value | w component value. |
const quatf openvrml::quatf::conjugate | ( | ) | const throw () |
Get the conjugate.
const quatf openvrml::quatf::inverse | ( | ) | const throw () |
Get the inverse.
float openvrml::quatf::norm | ( | ) | const throw () |
Get the norm.
const quatf openvrml::quatf::normalize | ( | ) | const throw () |
Normalize the quaternion.
Multiply two quaternions.
lhs | left-hand operand. | |
rhs | right-hand operand. |
lhs
and rhs
. Multiply a quaternion by a scalar.
quat | quaternion. | |
scalar | scalar. |
quat
and scalar
. Multiply a scalar by a quaternion.
scalar | scalar. | |
quat | quaternion. |
scalar
and quat
. Divide a quaternion by a scalar.
quat | quaternion. | |
scalar | scalar. |
quat
by scalar
. Add two quaternions.
lhs | left-hand operand. | |
rhs | right-hand operand. |
lhs
and rhs
. Take the difference between two quaternions.
lhs | left-hand operand. | |
rhs | right-hand operand. |
lhs
and rhs
. std::ostream & operator<< | ( | std::ostream & | out, | |
const quatf & | quat | |||
) | [related] |
Stream output.
out | an output stream. | |
quat | a quaternion. |
out
. Compare for equality.
lhs | left-hand operand. | |
rhs | right-hand operand. |
true
if lhs
and rhs
are equal; false
otherwise. Compare for inequality.
lhs | left-hand operand. | |
rhs | right-hand operand. |
true
if lhs
and rhs
are not equal; false
otherwise.
float openvrml::quatf::quat[4] [private] |
An array comprising the quaternion components.
For internal use only.