From 9b83919815f6a6ce5d73da1c28483970d0ca5589 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Feb 2021 14:22:28 -0600 Subject: added dev/MinGfx/ --- dev/MinGfx/docs/html/quaternion_8h_source.html | 222 +++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 dev/MinGfx/docs/html/quaternion_8h_source.html (limited to 'dev/MinGfx/docs/html/quaternion_8h_source.html') diff --git a/dev/MinGfx/docs/html/quaternion_8h_source.html b/dev/MinGfx/docs/html/quaternion_8h_source.html new file mode 100644 index 0000000..78bd632 --- /dev/null +++ b/dev/MinGfx/docs/html/quaternion_8h_source.html @@ -0,0 +1,222 @@ + + + + + + + +MinGfx Toolkit: src/quaternion.h Source File + + + + + + + + + + + + +
+
+ + + + + + +
+
MinGfx Toolkit +  1.0 +
+
A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.
+
+
+ + + + + + + + +
+
+ + +
+ +
+ + +
+
+
+
quaternion.h
+
+
+Go to the documentation of this file.
1 /*
+
2  This file is part of the MinGfx Project.
+
3 
+
4  Copyright (c) 2017,2018 Regents of the University of Minnesota.
+
5  All Rights Reserved.
+
6 
+
7  Original Author(s) of this File:
+
8  Dan Keefe, 2018, University of Minnesota
+
9 
+
10  Author(s) of Significant Updates/Modifications to the File:
+
11  ...
+
12  */
+
13 
+
14 #ifndef SRC_QUATERNION_H_
+
15 #define SRC_QUATERNION_H_
+
16 
+
17 #include <iostream>
+
18 
+
19 #include "vector3.h"
+
20 
+
21 namespace mingfx {
+
22 
+
41 class Quaternion {
+
42 public:
+ +
45 
+
47  Quaternion(float qx, float qy, float qz, float qw);
+
48 
+
51  Quaternion(float *ptr);
+
52 
+
54  Quaternion(const Quaternion& other);
+
55 
+
56  virtual ~Quaternion();
+
57 
+
59  bool operator==(const Quaternion& q) const;
+
60 
+
62  bool operator!=(const Quaternion& q) const;
+
63 
+ +
66 
+
68  float operator[](const int i) const;
+
69 
+
71  float& operator[](const int i);
+
72 
+
74  float x() const { return q[0]; }
+
75 
+
77  float y() const { return q[1]; }
+
78 
+
80  float z() const { return q[2]; }
+
81 
+
83  float w() const { return q[3]; }
+
84 
+
86  const float * value_ptr() const;
+
87 
+
89  float Dot(const Quaternion& q) const;
+
90 
+
92  float Length() const;
+
93 
+
95  void Normalize();
+
96 
+
99  Quaternion ToUnit() const;
+
100 
+ +
103 
+ +
106 
+
109  Quaternion Slerp(const Quaternion &other, float alpha) const;
+
110 
+
112  // the specified axis.
+
113  static Quaternion FromAxisAngle(const Vector3 &axis, float angle);
+
114 
+
116  static Quaternion FromEulerAnglesZYX(const Vector3 &angles);
+
117 
+
120  static Quaternion Slerp(const Quaternion &a, const Quaternion &b, float alpha);
+
121 
+
122 private:
+
123  float q[4];
+
124 };
+
125 
+
126 
+ +
128 Quaternion operator/(const Quaternion& q, const float s);
+
129 Quaternion operator*(const float s, const Quaternion& q);
+
130 Quaternion operator*(const Quaternion& q, const float s);
+ + + +
134 
+
135 std::ostream & operator<< ( std::ostream &os, const Quaternion &q);
+
136 std::istream & operator>> ( std::istream &is, Quaternion &q);
+
137 
+
138 
+
139 } // end namespace
+
140 
+
141 
+
142 #endif
+
A quaternion to represent rotations in 3D space.
Definition: quaternion.h:41
+
Quaternion Slerp(const Quaternion &other, float alpha) const
Uses spherical interpolation to interpoloate between the rotation stored in this quaternion and the r...
+
Vector3 ToEulerAnglesZYX() const
Converts the rotation specified by the quaternion into Euler angles.
+
void Normalize()
Normalizes the quat by making it unit length.
+
Quaternion(float *ptr)
Creates a quate from a pointer to 4 floating point numbers in the order qx, qy, qz,...
+
Quaternion(const Quaternion &other)
Copy constructor.
+
virtual ~Quaternion()
+
static Quaternion Slerp(const Quaternion &a, const Quaternion &b, float alpha)
Uses spherical interpolation to interpoloate between the rotations specified by two quaternions.
+
Quaternion ToUnit() const
Returns a normalized (i.e., unit length) version of the quaternion without modifying the original.
+
float & operator[](const int i)
Writable access the ith coordinate of the quaternion (qx, qy, qz, qw).
+
float operator[](const int i) const
Read only access to the ith coordinate of the quaternion (qx, qy, qz, qw).
+
static Quaternion FromAxisAngle(const Vector3 &axis, float angle)
Creates a new quaternion that describes a rotation by angle radians about.
+
Quaternion(float qx, float qy, float qz, float qw)
Creates a quat from the 4 parameters.
+
float z() const
Read only access to the z coordinate of the imaginary part of the quaternion.
Definition: quaternion.h:80
+
float x() const
Read only access to the x coordinate of the imaginary part of the quaternion.
Definition: quaternion.h:74
+
float w() const
Read only access to the w, real part, of the quaternion.
Definition: quaternion.h:83
+
float Dot(const Quaternion &q) const
Returns the dot product of this quaternion with another.
+
static Quaternion FromEulerAnglesZYX(const Vector3 &angles)
Creates a new quaternion from a rotation defined in Euler angles.
+
bool operator==(const Quaternion &q) const
Check for "equality", taking floating point imprecision into account.
+
Quaternion Conjugate() const
Returns the conjugate of the quaternion.
+
const float * value_ptr() const
Returns a const pointer to the raw data array, stored in the order qx, qy, qz, qw.
+
Quaternion & operator=(const Quaternion &q)
Assignment operator.
+
Quaternion()
Creates a quat with the identity rotation.
+
bool operator!=(const Quaternion &q) const
Check for "inequality", taking floating point imprecision into account.
+
float y() const
Read only access to the y coordinate of the imaginary part of the quaternion.
Definition: quaternion.h:77
+
float Length() const
Returns the length of the quaternion.
+
A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...
Definition: vector3.h:62
+
Namespace for the MinGfx Toolkit.
Definition: aabb.h:21
+
Quaternion operator-(const Quaternion &q)
+
AABB operator+(const AABB &A, const AABB &B)
+
Quaternion operator/(const Quaternion &q, const float s)
+
std::ostream & operator<<(std::ostream &os, const Color &c)
+
std::istream & operator>>(std::istream &is, Color &c)
+
Matrix4 operator*(const Matrix4 &m, const float &s)
Multiply matrix and scalar, returns the new matrix.
+ +
+ + + + + -- cgit v1.2.3