LQuaterniond

from panda3d.core import LQuaterniond
class LQuaterniond

Bases: LVecBase4d

This is the base quaternion class

Inheritance diagram

Inheritance diagram of LQuaterniond

__init__(*args, **kwargs)
almostEqual()

C++ Interface: almost_equal(LQuaterniond self, const LQuaterniond other) almost_equal(LQuaterniond self, const LQuaterniond other, double threshold)

/**
  • 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.

*/

almostSameDirection()

C++ Interface: almost_same_direction(LQuaterniond self, const LQuaterniond other, double threshold)

/**
  • Returns true if two quaternions represent the same rotation within a

  • specified tolerance.

*/

almost_equal()

C++ Interface: almost_equal(LQuaterniond self, const LQuaterniond other) almost_equal(LQuaterniond self, const LQuaterniond other, double threshold)

/**
  • 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.

*/

almost_same_direction()

C++ Interface: almost_same_direction(LQuaterniond self, const LQuaterniond other, double threshold)

/**
  • Returns true if two quaternions represent the same rotation within a

  • specified tolerance.

*/

angleDeg()

C++ Interface: angle_deg(LQuaterniond self, const LQuaterniond other)

/**
  • Returns the angle between the orientation represented by this quaternion

  • and the other one, expressed in degrees.

*/

angleRad()

C++ Interface: angle_rad(LQuaterniond self, const LQuaterniond other)

/**
  • Returns the angle between the orientation represented by this quaternion

  • and the other one, expressed in radians.

*/

angle_deg()

C++ Interface: angle_deg(LQuaterniond self, const LQuaterniond other)

/**
  • Returns the angle between the orientation represented by this quaternion

  • and the other one, expressed in degrees.

*/

angle_rad()

C++ Interface: angle_rad(LQuaterniond self, const LQuaterniond other)

/**
  • Returns the angle between the orientation represented by this quaternion

  • and the other one, expressed in radians.

*/

conjugate()

C++ Interface: conjugate(LQuaterniond self)

/**
  • Returns the complex conjugate of this quat.

*/

conjugateFrom()

C++ Interface: conjugate_from(const LQuaterniond self, const LQuaterniond other)

/**
  • 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.

*/

conjugateInPlace()

C++ Interface: conjugate_in_place(const LQuaterniond self)

/**
  • Sets this to be the conjugate of the current quat. Returns true if the

  • successful, false if the quat was singular.

*/

conjugate_from()

C++ Interface: conjugate_from(const LQuaterniond self, const LQuaterniond other)

/**
  • 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.

*/

conjugate_in_place()

C++ Interface: conjugate_in_place(const LQuaterniond self)

/**
  • Sets this to be the conjugate of the current quat. Returns true if the

  • successful, false if the quat was singular.

*/

extractToMatrix()

C++ Interface: extract_to_matrix(LQuaterniond self, LMatrix4d m) extract_to_matrix(LQuaterniond self, LMatrix3d m)

/**
  • Based on the quat lib from VRPN.

*/

/**
  • Based on the quat lib from VRPN.

*/

extract_to_matrix()

C++ Interface: extract_to_matrix(LQuaterniond self, LMatrix4d m) extract_to_matrix(LQuaterniond self, LMatrix3d m)

/**
  • Based on the quat lib from VRPN.

*/

/**
  • Based on the quat lib from VRPN.

*/

getAngle()

C++ Interface: get_angle(LQuaterniond self)

/**
  • 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.

*/

getAngleRad()

C++ Interface: get_angle_rad(LQuaterniond self)

/**
  • 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.

*/

getAxis()

C++ Interface: get_axis(LQuaterniond self)

/**
  • 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.

*/

getAxisNormalized()

C++ Interface: get_axis_normalized(LQuaterniond self)

/**
  • This, along with get_angle(), returns the rotation represented by the

  • quaternion as an angle about an arbitrary axis. This returns the

  • normalized axis.

*/

getClassType()

C++ Interface: get_class_type()

getForward()

C++ Interface: get_forward(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as a

  • forward vector.

*/

getHpr()

C++ Interface: get_hpr(LQuaterniond self, int cs)

/**
  • Extracts the equivalent Euler angles from the unit quaternion.

*/

getI()

C++ Interface: get_i(LQuaterniond self)

/**

*/

getJ()

C++ Interface: get_j(LQuaterniond self)

/**

*/

getK()

C++ Interface: get_k(LQuaterniond self)

/**

*/

getR()

C++ Interface: get_r(LQuaterniond self)

/**

*/

getRight()

C++ Interface: get_right(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as a

  • right vector.

*/

getUp()

C++ Interface: get_up(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as an up

  • vector.

*/

get_angle()

C++ Interface: get_angle(LQuaterniond self)

/**
  • 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.

*/

get_angle_rad()

C++ Interface: get_angle_rad(LQuaterniond self)

/**
  • 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.

*/

get_axis()

C++ Interface: get_axis(LQuaterniond self)

/**
  • 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.

*/

get_axis_normalized()

C++ Interface: get_axis_normalized(LQuaterniond self)

/**
  • This, along with get_angle(), returns the rotation represented by the

  • quaternion as an angle about an arbitrary axis. This returns the

  • normalized axis.

*/

get_class_type()

C++ Interface: get_class_type()

get_forward()

C++ Interface: get_forward(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as a

  • forward vector.

*/

get_hpr()

C++ Interface: get_hpr(LQuaterniond self, int cs)

/**
  • Extracts the equivalent Euler angles from the unit quaternion.

*/

get_i()

C++ Interface: get_i(LQuaterniond self)

/**

*/

get_j()

C++ Interface: get_j(LQuaterniond self)

/**

*/

get_k()

C++ Interface: get_k(LQuaterniond self)

/**

*/

get_r()

C++ Interface: get_r(LQuaterniond self)

/**

*/

get_right()

C++ Interface: get_right(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as a

  • right vector.

*/

get_up()

C++ Interface: get_up(LQuaterniond self, int cs)

/**
  • Returns the orientation represented by this quaternion, expressed as an up

  • vector.

*/

identQuat()

C++ Interface: ident_quat()

/**
  • Returns an identity quaternion.

*/

ident_quat()

C++ Interface: ident_quat()

/**
  • Returns an identity quaternion.

*/

invertFrom()

C++ Interface: invert_from(const LQuaterniond self, const LQuaterniond other)

/**
  • 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.

*/

invertInPlace()

C++ Interface: invert_in_place(const LQuaterniond self)

/**
  • Inverts the current quat. Returns true if the inverse is successful, false

  • if the quat was singular.

*/

invert_from()

C++ Interface: invert_from(const LQuaterniond self, const LQuaterniond other)

/**
  • 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.

*/

invert_in_place()

C++ Interface: invert_in_place(const LQuaterniond self)

/**
  • Inverts the current quat. Returns true if the inverse is successful, false

  • if the quat was singular.

*/

isAlmostIdentity()

C++ Interface: is_almost_identity(LQuaterniond self, double tolerance)

/**
  • Returns true if this quaternion represents the identity transformation

  • within a given tolerance.

*/

isIdentity()

C++ Interface: is_identity(LQuaterniond self)

/**
  • Returns true if this quaternion represents the identity transformation: no

  • rotation.

*/

isSameDirection()

C++ Interface: is_same_direction(LQuaterniond self, const LQuaterniond other)

/**
  • Returns true if two quaternions represent the same rotation within a

  • default tolerance based on the numeric type.

*/

is_almost_identity()

C++ Interface: is_almost_identity(LQuaterniond self, double tolerance)

/**
  • Returns true if this quaternion represents the identity transformation

  • within a given tolerance.

*/

is_identity()

C++ Interface: is_identity(LQuaterniond self)

/**
  • Returns true if this quaternion represents the identity transformation: no

  • rotation.

*/

is_same_direction()

C++ Interface: is_same_direction(LQuaterniond self, const LQuaterniond other)

/**
  • Returns true if two quaternions represent the same rotation within a

  • default tolerance based on the numeric type.

*/

multiply()

C++ Interface: multiply(LQuaterniond self, const LQuaterniond rhs)

/**
  • actual multiply call (non virtual)

*/

normalize()

C++ Interface: normalize(const LQuaterniond self)

/**

*/

output()

C++ Interface: output(LQuaterniond self, ostream param0)

/**

*/

pureImaginary()

C++ Interface: pure_imaginary(const LVector3d v)

/**

*/

pure_imaginary()

C++ Interface: pure_imaginary(const LVector3d v)

/**

*/

setFromAxisAngle()

C++ Interface: set_from_axis_angle(const LQuaterniond self, double angle_deg, const LVector3d axis)

/**
  • angle_deg is the angle about the axis in degrees. axis must be normalized.

*/

setFromAxisAngleRad()

C++ Interface: set_from_axis_angle_rad(const LQuaterniond self, double angle_rad, const LVector3d axis)

/**
  • angle_rad is the angle about the axis in radians. axis must be normalized.

*/

setFromMatrix()

C++ Interface: set_from_matrix(const LQuaterniond self, const LMatrix4d m) set_from_matrix(const LQuaterniond self, const LMatrix3d m)

/**

*/

/**
  • 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()

C++ Interface: set_hpr(const LQuaterniond self, const LVecBase3d hpr, int cs)

/**
  • Sets the quaternion as the unit quaternion that is equivalent to these

  • Euler angles. (from Real-time Rendering, p.49)

*/

setI()

C++ Interface: set_i(const LQuaterniond self, double i)

/**

*/

setJ()

C++ Interface: set_j(const LQuaterniond self, double j)

/**

*/

setK()

C++ Interface: set_k(const LQuaterniond self, double k)

/**

*/

setR()

C++ Interface: set_r(const LQuaterniond self, double r)

/**

*/

set_from_axis_angle()

C++ Interface: set_from_axis_angle(const LQuaterniond self, double angle_deg, const LVector3d axis)

/**
  • angle_deg is the angle about the axis in degrees. axis must be normalized.

*/

set_from_axis_angle_rad()

C++ Interface: set_from_axis_angle_rad(const LQuaterniond self, double angle_rad, const LVector3d axis)

/**
  • angle_rad is the angle about the axis in radians. axis must be normalized.

*/

set_from_matrix()

C++ Interface: set_from_matrix(const LQuaterniond self, const LMatrix4d m) set_from_matrix(const LQuaterniond self, const LMatrix3d m)

/**

*/

/**
  • 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.

*/

set_hpr()

C++ Interface: set_hpr(const LQuaterniond self, const LVecBase3d hpr, int cs)

/**
  • Sets the quaternion as the unit quaternion that is equivalent to these

  • Euler angles. (from Real-time Rendering, p.49)

*/

set_i()

C++ Interface: set_i(const LQuaterniond self, double i)

/**

*/

set_j()

C++ Interface: set_j(const LQuaterniond self, double j)

/**

*/

set_k()

C++ Interface: set_k(const LQuaterniond self, double k)

/**

*/

set_r()

C++ Interface: set_r(const LQuaterniond self, double r)

/**

*/

xform()

C++ Interface: xform(LQuaterniond self, const LVecBase4d v) xform(LQuaterniond self, const LVecBase3d v)

/**
  • Transforms a 3-d vector by the indicated rotation

*/

/**
  • Transforms a 4-d vector by the indicated rotation

*/