LQuaterniond¶
-
class LQuaterniond¶
Bases:
LVecBase4dThis is the base quaternion class
Inheritance diagram
digraph inheritance48e3e817f8 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "LQuaterniond" [URL="acron.core.LQuaterniond.html#acron.core.LQuaterniond",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "LVecBase4d" -> "LQuaterniond" [arrowsize=0.75,style=""]; "LVecBase4d" [URL="acron.core.LVecBase4d.html#acron.core.LVecBase4d",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "LVecBase4d" [arrowsize=0.75,style=""]; }- LQuaterniond.__add__()¶
- LQuaterniond.__div__()¶
- LQuaterniond.__imul__()¶
- LQuaterniond.__init__()¶
- LQuaterniond.__mul__()¶
- LQuaterniond.__pow__()¶
Returns a new quaternion that represents this quaternion raised to the given power.
- LQuaterniond.__sub__()¶
- LQuaterniond.__sub__()¶
- LQuaterniond.almost_equal()¶
Returns true if two quaternions are memberwise equal within a default tolerance based on the numeric type.
Returns true if two quaternions are memberwise equal within a specified tolerance.
- LQuaterniond.almost_same_direction()¶
Returns true if two quaternions represent the same rotation within a specified tolerance.
- LQuaterniond.angle_deg()¶
Returns the angle between the orientation represented by this quaternion and the other one, expressed in degrees.
- LQuaterniond.angle_rad()¶
Returns the angle between the orientation represented by this quaternion and the other one, expressed in radians.
- LQuaterniond.conjugate()¶
Returns the complex conjugate of this quat.
- LQuaterniond.conjugate_from()¶
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.
- LQuaterniond.conjugate_in_place()¶
Sets this to be the conjugate of the current quat. Returns true if the successful, false if the quat was singular.
- LQuaterniond.extract_to_matrix()¶
Based on the quat lib from VRPN.
Based on the quat lib from VRPN.
- LQuaterniond.get_angle()¶
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.
- LQuaterniond.get_angle_rad()¶
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.
- LQuaterniond.get_axis()¶
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.
- LQuaterniond.get_axis_normalized()¶
This, along with
get_angle(), returns the rotation represented by the quaternion as an angle about an arbitrary axis. This returns the normalized axis.
- static LQuaterniond.get_class_type()¶
- LQuaterniond.get_forward()¶
Returns the orientation represented by this quaternion, expressed as a forward vector.
- LQuaterniond.get_hpr()¶
Extracts the equivalent Euler angles from the unit quaternion.
- LQuaterniond.get_i()¶
- LQuaterniond.get_j()¶
- LQuaterniond.get_k()¶
- LQuaterniond.get_r()¶
- LQuaterniond.get_right()¶
Returns the orientation represented by this quaternion, expressed as a right vector.
- LQuaterniond.get_up()¶
Returns the orientation represented by this quaternion, expressed as an up vector.
- static LQuaterniond.ident_quat()¶
Returns an identity quaternion.
- LQuaterniond.invert_from()¶
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.
- LQuaterniond.invert_in_place()¶
Inverts the current quat. Returns true if the inverse is successful, false if the quat was singular.
- LQuaterniond.is_almost_identity()¶
Returns true if this quaternion represents the identity transformation within a given tolerance.
- LQuaterniond.is_identity()¶
Returns true if this quaternion represents the identity transformation: no rotation.
- LQuaterniond.is_same_direction()¶
Returns true if two quaternions represent the same rotation within a default tolerance based on the numeric type.
- LQuaterniond.multiply()¶
actual multiply call (non virtual)
- LQuaterniond.normalize()¶
- LQuaterniond.output()¶
- static LQuaterniond.pure_imaginary()¶
- LQuaterniond.set_from_axis_angle()¶
angle_degis the angle about the axis in degrees. axis must be normalized.
- LQuaterniond.set_from_axis_angle_rad()¶
angle_radis the angle about the axis in radians. axis must be normalized.
- LQuaterniond.set_from_matrix()¶
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.
- LQuaterniond.set_hpr()¶
Sets the quaternion as the unit quaternion that is equivalent to these Euler angles. (from Real-time Rendering, p.49)
- LQuaterniond.set_i()¶
- LQuaterniond.set_j()¶
- LQuaterniond.set_k()¶
- LQuaterniond.set_r()¶
- LQuaterniond.xform()¶
Transforms a 3-d vector by the indicated rotation
Transforms a 4-d vector by the indicated rotation