PERRY v1.0.0
P-E-R-R-Y/PERRY helps creating games with a bunch of tools.
Loading...
Searching...
No Matches
Quaternion Class Reference

quaternion are four-dimensional vector that can be used to represent rotations in 3D space. More...

#include <Quaternion.hpp>

Public Member Functions

 Quaternion ()
 Construct a new Quaternion object.
 
 Quaternion (float w, float x, float y, float z)
 Construct a new Quaternion object.
 
 ~Quaternion ()
 Destroy the Quaternion object.
 
Quaternion conjugate () const
 conjugate will return the conjugate of the quaternion
 
void normalize ()
 normalize will normalize the quaternion
 
void enforceSign ()
 enforceSign will enforce the sign of the quaternion
 
sf::Vector3f rotate (sf::Vector3f point, sf::Vector3f center={0, 0, 0}) const
 rotate will rotate a point around a center
 
Quaternion operator* (const Quaternion &other) const
 operator* will multiply two quaternions
 

Static Public Member Functions

static Quaternion identity ()
 return the identity quaternion
 
static Quaternion fromEulerAngles (float x, float y, float z)
 fromEulerAngles will create a quaternion from euler angles
 
static Quaternion fromAxisAngle (float angle, sf::Vector3f axis)
 fromAxisAngle will create a quaternion from an axis and an angle
 
static Quaternion fromVectors (const sf::Vector3f &v1, const sf::Vector3f &v2)
 quaterninon representing the rotation from one vector to another
 

Public Attributes

float w
 
float x
 
float y
 
float z
 

Detailed Description

quaternion are four-dimensional vector that can be used to represent rotations in 3D space.


The documentation for this class was generated from the following file: