[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Quaternions. Internally quaternions are represented as just an array of four floats; the first three are the vector component and the last is the scalar component.
Inherits <sequence>
and <collection>
. When viewed
as sequence, it is just like a vector of four floats.
Returns true iff obj is a quaternion.
#,(quatf x y z w)
External representation of quaternion xi+yj+zk+w.
Returns a new unit quaternion that represents a rotation around vector axis by angle radians. Axis can be a vector4f, a point4f or a f32vector (only first three component is used). Axis must be a unit vector; if axis is anormalized, the result is undefined.
If both axis and angle is omitted,
#,(quatf 0 0 0 1)
is returned.
Returns a new quaternion whose elements are initialized by x, y, z, w.
Converts between a list of four real numbers and a quaternion.
Returns a new quaternion whose elements are initialized by the first four elements of f32vector x. If start is given, the initial value is taken starting from start-th index in x.
Returns a new f32vector whose contents is the same as a quaternion q.
Returns a fresh copy of a quaternion q.
Copies contents of a quaternion srcq to a quaternion dstq.
Sets a quaternion quat so that it represents a rotation around a unit vector axis by angle angle radians. Axis can be a vector4f, a point4f or a f32vector (only first three component is used).
Given two unit vectors v and w, calculates and returns
a quaternion that represents a rotation from v to w.
The destructive version vectors->quatf!
modifies q.
The arguments must be all unit vectors, v1 and v2 must be perpendicular, and also w1 and w2 must be perpendicular.
Calculates and returns a quaternion that represents a rotation which transforms v1 to w1, and v2 to w2, respectively. The destructive version stores the result into q.
Addition and subtraction of quaternions. The destructive version modifies the first argument.
Multiplies a quaternion q by a scalar value s. The destructive version modifies q.
Multiply two quaternions p and q. The destructive version modifies p as well.
Returns a conjugate of a quaternion p. The destructive version modifies q as well.
Transforms a vector or a point p by quaternion q, that is, returns qpq*, where q* is a conjugate of q.
This procedure assumes q is normalized.
P can be a vector4f, a point4f or a f32vector (only first three elements are used). Returns the same type of object as p.
Returns norm of q.
Returns normalized quaternion of q. The destructive version modifies q.
Returns a matrix that represents a rotation specified by a unit quaternion q. The behavior is undefined if q is not normalized. The destructive version modifies m.
Extracts the rotation component of a matrix m and
returns a quaterion that represents the rotation.
Matrix4f->quatf!
also uses q as the storage
to store the result.
Returns a quaternion that interpolates between two unit quaternions p and q, by a scalar value t. The destructive version modifies t.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on June, 7 2008 using texi2html 1.78.