Some explanations about the Ogre Quaternary class

Source: Internet
Author: User

Static Data Member

Quaternion quaternion: zre) (0.0, 0.0, 0.0, 0.0); zero element

Quaternion quaternion: Identity (1.0, 0.0, 0.0, 0.0)

Constructor

Ogre: quaternion: Quaternion ( Real FW=1.0,
    Real FX=0.0,
    Real FY=0.0,
    Real FZ=0.0  
  )      
Ogre: quaternion: Quaternion ( Const matrix3 & Rot ) Constructs a quaternary element from a 3*3 rotation matrix.

Ogre: quaternion (const radian &Rfangle, Const vector3 &Rkaxis) The angle and coordinate axis construct a four-element

Point multiplication: The point multiplication of a four-element system represents the degree of similarity of rotation. The result is a real number. The larger the value, the more similar the rotation method.

Real ogre: quaternion: dot ( Const quaternion & Rkq ) Const

It is generated by a 3*3 rotation matrix and the parameter is a rotation matrix.

Void quaternion: fromrotationmatrix (const matrix3 & krot)

Convert the Quaternary element to a rotation matrix. The parameter is a return parameter and the received rotation matrix is obtained.

Void quaternion: torotationmatrix (matrix3 & krot) const

The angle and axis of the axis and angle representation are generated by the Quaternary element. The parameter is a reference parameter and is used for callback.

Void quaternion: toangleaxis (real & rfangle, vector3 & rkaxis) const

It is generated from the rotation matrix expressed by three vectors. The parameter is the rotation matrix expressed by multiple vectors pointed to by the pointer (generally three)

Void quaternion: fromaxes (const vector3 * akaxis)

Generate a four-byte element from the rotation matrix expressed by three vectors.

Void fromaxes (const vector3 & xaxis, const vector3 & yaxis, const vector3 & zaxis );

A rotation matrix is generated by the Quaternary element. The matrix is expressed by multiple (3) vectors pointed to by the pointer.

Void toaxes (vector3 * akaxis) const;

A rotation matrix is generated by the Quaternary element. The matrix is expressed by three vectors.

Void toaxes (vector3 & xaxis, vector3 & yaxis, vector3 & zaxis );

Overload = Operator

Quaternion & operator = (const quaternion & rkq );

Overload + operator

Quaternion operator + (const quaternion & rkq) const;

Overload-Operator

Quaternion operator-(const quaternion & rkq) const;

Reload the * operator, which is a quaternary asterisk.

Quaternion operator * (const quaternion & rkq) const;

Overload the * operator, which is a scalar.

Quaternion operator * (real fscalar) const;

Reload the * operator, which is a quaternary asterisk. Reload is used as a member.

Friend quaternion operator * (real fscalar, const quaternion & rkq );

Overload negative Operators

Quaternion operator-() const;

Overload = Operator

Bool operator = (const quaternion & RHs) const;

Quaternary point Multiplication

Real dot (const quaternion & rkq) const;

MoD

Real norm () const;

Evaluate the reciprocal of the four element. The value of this element is not 0.

Quaternion inverse () const;

Evaluate the reciprocal of the Unit Four-dimensional element (!). The current four-dimensional element (!) is the Unit Four-dimensional element.

Quaternion unitinverse () const; // apply to unit-length Quaternion

Evaluate the exponent of the Quaternary element, that is, the power of the Quaternary element of E.

Quaternion exp () const;

Evaluate the logarithm of the Quaternary Element Based on E

Quaternion log () const;

Rotate the vector with a quaternary number (it seems that nvidia sdk supports this ).

Vector3 operator * (const vector3 & rkvector) const;

Static member functions and spherical linear interpolation. The FT parameter is a time factor of 0-1.

Static quaternion slerp (real ft, const quaternion & RKP, const quaternion & rkq );

Static member functions, spherical linear interpolation with interference factors. The FT parameter is a time factor of 0-1.

Static quaternion slerpextraspins (real ft, const quaternion & RKP, const quaternion & rkq,

Int iextraspins );

It is not clear the purpose of static member functions.

Static void intermediate (const quaternion & rkq0,

Const quaternion & rkq1, const quaternion & rkq2,

Quaternion & RKa, quaternion & RKb );

Static member functions, spline interpolation (quadratic interpolation ). The objective is to obtain a smooth target line through interpolation when the shape of a spline is known. FT is a time factor of 0-1. RKP and rkq are the start and end points of the spline, while RKA is the start and end points of a first-line segment during the RKb Interpolation Process (control point connections ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.