Exemplo n.º 1
0
QVector3D MathUtil::Slerp(QVector3D p1, QVector3D p2, float i)
{

    p1.normalize();
    p2.normalize();

    QVector3D c = QVector3D::crossProduct(p1, p2);
    if (c.length() < 0.001f)
        c = QVector3D(0, 1, 0);
    c.normalize();

    float angle = acosf(QVector3D::dotProduct(p1, p2));

    return GetRotatedAxis(i * angle, p1, c);

}
Exemplo n.º 2
0
 void cVec4::RotateAxis(double angle, const cVec3 & axis)
 {
   (*this)=GetRotatedAxis(angle, axis);
 }
Exemplo n.º 3
0
void PxVector::RotateAxis(double angle, const PxVector & axis)
{
	(*this)=GetRotatedAxis(angle, axis);
}
Exemplo n.º 4
0
void VECTOR4D::RotateAxis(double angle, const VECTOR3D & axis)
{
	(*this)=GetRotatedAxis(angle, axis);
}
Exemplo n.º 5
0
void Vector3::RotateAxis(double angle, const Vector3 & axis) {
    (*this)=GetRotatedAxis(angle, axis);
}
Exemplo n.º 6
0
 cVec3 cVec3::GetRotatedByQuaternion(const cQuaternion& rhs) const
 {
   return cVec3(GetRotatedAxis(rhs.GetAngleRadians(), rhs.GetAxis()));
 }