1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00
SqMod/source/Base/Quaternion.hpp

323 lines
10 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_QUATERNION_HPP_
#define _BASE_QUATERNION_HPP_
// ------------------------------------------------------------------------------------------------
#include "SqBase.hpp"
2015-09-30 02:56:11 +02:00
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
*
2015-09-30 02:56:11 +02:00
*/
struct Quaternion
{
/* --------------------------------------------------------------------------------------------
* ...
*/
typedef float Value;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static const Quaternion NIL;
static const Quaternion MIN;
static const Quaternion MAX;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
Value x, y, z, w;
/* --------------------------------------------------------------------------------------------
*
*/
Quaternion();
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion(Value sv);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion(Value xv, Value yv, Value zv);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion(Value xv, Value yv, Value zv, Value wv);
/* --------------------------------------------------------------------------------------------
*
*/
Quaternion(const Quaternion & o);
/* --------------------------------------------------------------------------------------------
*
*/
2015-09-30 02:56:11 +02:00
~Quaternion();
/* --------------------------------------------------------------------------------------------
*
*/
Quaternion & operator = (const Quaternion & o);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator = (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator = (const Vector3 & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator = (const Vector4 & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator += (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator -= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator *= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator /= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator %= (const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator += (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator -= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator *= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator /= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator %= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator ++ ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion & operator -- ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator ++ (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator -- (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator + (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator - (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator * (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator / (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator % (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator + (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator - (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator * (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator / (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator % (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator + () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion operator - () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator == (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator != (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator < (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator > (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator <= (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator >= (const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Int32 Cmp(const Quaternion & q) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
CSStr ToString() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value ns);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value nx, Value ny, Value nz);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value nx, Value ny, Value nz, Value nw);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Quaternion & q);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector3 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector4 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(CSStr values, SQChar delim);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate();
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value min, Value max);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value xmin, Value xmax, Value ymin, Value ymax, Value zmin, Value zmax, Value wmin, Value wmax);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Clear()
{
x = 0.0, y = 0.0, z = 0.0, w = 0.0;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
Quaternion Abs() const;
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_QUATERNION_HPP_