QQuaternion Class ReferenceThe QQuaternion class represents a quaternion consisting of a vector and scalar. Далее... #include <QQuaternion> Этот класс был введён в Qt 4.6. Открытые функции
Статические открытые члены
Связанные нечлены класса
Подробное описаниеThe QQuaternion class represents a quaternion consisting of a vector and scalar. Quaternions are used to represent rotations in 3D space, and consist of a 3D rotation axis specified by the x, y, and z coordinates, and a scalar representing the rotation angle. Описание функций-членовQQuaternion::QQuaternion ()Constructs an identity quaternion, i.e. with coordinates (1, 0, 0, 0). QQuaternion::QQuaternion ( qreal scalar, qreal xpos, qreal ypos, qreal zpos )Constructs a quaternion with the vector (xpos, ypos, zpos) and scalar. QQuaternion::QQuaternion ( qreal scalar, const QVector3D & vector )Constructs a quaternion vector from the specified vector and scalar. See also vector() and scalar(). QQuaternion::QQuaternion ( const QVector4D & vector )Constructs a quaternion from the components of vector. QQuaternion QQuaternion::conjugate () constReturns the conjugate of this quaternion, which is (-x, -y, -z, scalar). QQuaternion QQuaternion::fromAxisAndAngle ( const QVector3D & axis, qreal angle ) [static]Creates a normalized quaternion that corresponds to rotating through angle degrees about the specified 3D axis. QQuaternion QQuaternion::fromAxisAndAngle ( qreal x, qreal y, qreal z, qreal angle ) [static]Creates a normalized quaternion that corresponds to rotating through angle degrees about the 3D axis (x, y, z). bool QQuaternion::isIdentity () constReturns true if the x, y, and z components of this quaternion are set to 0.0, and the scalar component is set to 1.0; otherwise returns false. bool QQuaternion::isNull () constReturns true if the x, y, z, and scalar components of this quaternion are set to 0.0; otherwise returns false. qreal QQuaternion::length () constReturns the length of the quaternion. This is also called the "norm". Смотрите также lengthSquared() и normalized(). qreal QQuaternion::lengthSquared () constReturns the squared length of the quaternion. Смотрите также length(). QQuaternion QQuaternion::nlerp ( const QQuaternion & q1, const QQuaternion & q2, qreal t ) [static]Interpolates along the shortest linear path between the rotational positions q1 and q2. The value t should be between 0 and 1, indicating the distance to travel between q1 and q2. The result will be normalized(). If t is less than or equal to 0, then q1 will be returned. If t is greater than or equal to 1, then q2 will be returned. The nlerp() function is typically faster than slerp() and will give approximate results to spherical interpolation that are good enough for some applications. See also slerp(). void QQuaternion::normalize ()Normalizes the currect quaternion in place. Nothing happens if this is a null quaternion or the length of the quaternion is very close to 1. Смотрите также length() и normalized(). QQuaternion QQuaternion::normalized () constReturns the normalized unit form of this quaternion. If this quaternion is null, then a null quaternion is returned. If the length of the quaternion is very close to 1, then the quaternion will be returned as-is. Otherwise the normalized form of the quaternion of length 1 will be returned. Смотрите также length() и normalize(). QVector3D QQuaternion::rotatedVector ( const QVector3D & vector ) constRotates vector with this quaternion to produce a new vector in 3D space. The following code: QVector3D result = q.rotatedVector(vector); is equivalent to the following: QVector3D result = (q * QQuaternion(0, vector) * q.conjugate()).vector(); qreal QQuaternion::scalar () constReturns the scalar component of this quaternion. See also setScalar(), x(), y(), and z(). void QQuaternion::setScalar ( qreal scalar )Sets the scalar component of this quaternion to scalar. See also scalar(), setX(), setY(), and setZ(). void QQuaternion::setVector ( const QVector3D & vector )Sets the vector component of this quaternion to vector. See also vector() and setScalar(). void QQuaternion::setVector ( qreal x, qreal y, qreal z )Sets the vector component of this quaternion to (x, y, z). See also vector() and setScalar(). void QQuaternion::setX ( qreal x )Sets the x coordinate of this quaternion's vector to the given x coordinate. See also x(), setY(), setZ(), and setScalar(). void QQuaternion::setY ( qreal y )Sets the y coordinate of this quaternion's vector to the given y coordinate. See also y(), setX(), setZ(), and setScalar(). void QQuaternion::setZ ( qreal z )Sets the z coordinate of this quaternion's vector to the given z coordinate. See also z(), setX(), setY(), and setScalar(). QQuaternion QQuaternion::slerp ( const QQuaternion & q1, const QQuaternion & q2, qreal t ) [static]Interpolates along the shortest spherical path between the rotational positions q1 and q2. The value t should be between 0 and 1, indicating the spherical distance to travel between q1 and q2. If t is less than or equal to 0, then q1 will be returned. If t is greater than or equal to 1, then q2 will be returned. See also nlerp(). QVector4D QQuaternion::toVector4D () constReturns this quaternion as a 4D vector. QVector3D QQuaternion::vector () constReturns the vector component of this quaternion. See also setVector() and scalar(). qreal QQuaternion::x () constReturns the x coordinate of this quaternion's vector. See also setX(), y(), z(), and scalar(). qreal QQuaternion::y () constReturns the y coordinate of this quaternion's vector. See also setY(), x(), z(), and scalar(). qreal QQuaternion::z () constReturns the z coordinate of this quaternion's vector. See also setZ(), x(), y(), and scalar(). QQuaternion::operator QVariant () constReturns the quaternion as a QVariant. QQuaternion & QQuaternion::operator*= ( qreal factor )Multiplies this quaternion's components by the given factor, and returns a reference to this quaternion. Смотрите также operator/=(). QQuaternion & QQuaternion::operator*= ( const QQuaternion & quaternion )Multiplies this quaternion by quaternion and returns a reference to this quaternion. QQuaternion & QQuaternion::operator+= ( const QQuaternion & quaternion )Adds the given quaternion to this quaternion and returns a reference to this quaternion. Смотрите также operator-=(). QQuaternion & QQuaternion::operator-= ( const QQuaternion & quaternion )Subtracts the given quaternion from this quaternion and returns a reference to this quaternion. Смотрите также operator+=(). QQuaternion & QQuaternion::operator/= ( qreal divisor )Divides this quaternion's components by the given divisor, and returns a reference to this quaternion. Смотрите также operator*=(). Связанные нечлены классаbool qFuzzyCompare ( const QQuaternion & q1, const QQuaternion & q2 )Returns true if q1 and q2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise. bool operator!= ( const QQuaternion & q1, const QQuaternion & q2 )Returns true if q1 is not equal to q2; otherwise returns false. Этот оператор использует точное сравнение чисел с плавающей точкой. const QQuaternion operator* ( const QQuaternion & q1, const QQuaternion & q2 )Multiplies q1 and q2 using quaternion multiplication. The result corresponds to applying both of the rotations specified by q1 and q2. See also QQuaternion::operator*=(). const QQuaternion operator* ( qreal factor, const QQuaternion & quaternion )Returns a copy of the given quaternion, multiplied by the given factor. See also QQuaternion::operator*=(). const QQuaternion operator* ( const QQuaternion & quaternion, qreal factor )Returns a copy of the given quaternion, multiplied by the given factor. See also QQuaternion::operator*=(). const QQuaternion operator+ ( const QQuaternion & q1, const QQuaternion & q2 )Returns a QQuaternion object that is the sum of the given quaternions, q1 and q2; each component is added separately. See also QQuaternion::operator+=(). const QQuaternion operator- ( const QQuaternion & q1, const QQuaternion & q2 )Returns a QQuaternion object that is formed by subtracting q2 from q1; each component is subtracted separately. See also QQuaternion::operator-=(). const QQuaternion operator- ( const QQuaternion & quaternion )Это перегруженная функция. Returns a QQuaternion object that is formed by changing the sign of all three components of the given quaternion. Equivalent to QQuaternion(0,0,0,0) - quaternion. const QQuaternion operator/ ( const QQuaternion & quaternion, qreal divisor )Returns the QQuaternion object formed by dividing all components of the given quaternion by the given divisor. See also QQuaternion::operator/=(). QDataStream & operator<< ( QDataStream & stream, const QQuaternion & quaternion )Writes the given quaternion to the given stream and returns a reference to the stream. Смотрите также Преобразование типов данных Qt в последовательный вид. bool operator== ( const QQuaternion & q1, const QQuaternion & q2 )Returns true if q1 is equal to q2; otherwise returns false. Этот оператор использует точное сравнение чисел с плавающей точкой. QDataStream & operator>> ( QDataStream & stream, QEasingCurve & easing )Reads an easing curve from the given stream into the given easing curve and returns a reference to the stream. Смотрите также Преобразование типов данных Qt в последовательный вид. QDataStream & operator>> ( QDataStream & stream, QQuaternion & quaternion )Reads a quaternion from the given stream into the given quaternion and returns a reference to the stream. Смотрите также Преобразование типов данных Qt в последовательный вид. |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |