NcEngine
Quaternion.h File Reference
#include "Vector.h"

Go to the source code of this file.

Classes

struct  nc::Quaternion
 Quaternion type for representing 3D rotations. More...
 

Functions

auto nc::Normalize (const Quaternion &quat) -> Quaternion
 Return a normalized quaternion.
 
auto nc::Multiply (const Quaternion &lhs, const Quaternion &rhs) -> Quaternion
 Multiplies two quaternions. More...
 
auto nc::Difference (const Quaternion &lhs, const Quaternion &rhs) -> Quaternion
 Finds rotation between lhs and rhs such that result * lhs == rhs.
 
auto nc::Slerp (const Quaternion &lhs, const Quaternion &rhs, float factor) -> Quaternion
 Interpolates from lhs to rhs.
 
auto nc::Scale (const Quaternion &quat, float factor) -> Quaternion
 Slerp from Identity to quat.
 
auto nc::operator== (const Quaternion &lhs, const Quaternion &rhs) -> bool
 
auto nc::operator!= (const Quaternion &lhs, const Quaternion &rhs) -> bool
 

Detailed Description

Function Documentation

◆ Multiply()

auto nc::Multiply ( const Quaternion lhs,
const Quaternion rhs 
) -> Quaternion

Multiplies two quaternions.

Note
For consistency with DirectXMath, the argument order is reversed from the order in which they are multiplied. In other words, this computes the lhs rotation followed by rhs (or the product rhs*lhs).