Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
Quaternion.h
Go to the documentation of this file.
1
//! @file Quaternion.h
2
//! CQuaternion class definition for handling quaternion
3
//!
4
//
5
//////////////////////////////////////////////////////////////////////
6
7
#if !defined(AFX_QUATERNION_H__04F856D9_60E8_45A9_993A_335E6079939E__INCLUDED_)
8
#define AFX_QUATERNION_H__04F856D9_60E8_45A9_993A_335E6079939E__INCLUDED_
9
10
#ifdef _MSC_VER
11
#pragma once
12
#endif
// _MSC_VER
13
14
BEGIN_MOOTOOLS_NAMESPACE
15
16
//! @class CQuaternion
17
//! @brief The class defines a quaternion transformation
18
//!
19
class
DLL_3DFUNCTION
CQuaternion
20
{
21
public
:
22
double
val[4];
23
24
public
:
25
CQuaternion
();
26
CQuaternion
(
double
h
,
double
p,
double
b);
27
CQuaternion
(
const
C3DVector
& v,
double
f
);
28
CQuaternion
(
double
a,
double
b,
double
c
,
double
d
);
29
CQuaternion
(
const
double
*p);
30
CQuaternion
(
const
float
* p);
31
32
//! @name Values access
33
//! @{
34
double
& operator[](
const
int
n
);
35
double
* ValPtr();
36
const
double
* ValPtr()
const
;
37
38
//! @}
39
40
//! @name operators
41
//! @{
42
const
CQuaternion
& operator*=(
const
CQuaternion
&
q
);
43
CQuaternion
operator*(
const
CQuaternion
&
quat
)
const
;
44
CQuaternion
operator*(
double
f
)
const
;
45
CQuaternion
operator/(
double
f
)
const
;
46
CQuaternion
operator+(
const
CQuaternion
&
quat
)
const
;
47
CQuaternion
& operator=(
const
C3DVector
&
vec
);
48
CQuaternion
& operator=(
const
CQuaternion
&
quat
);
49
bool
operator==(
const
CQuaternion
&)
const
;
50
bool
operator!=(
const
CQuaternion
&)
const
;
51
CQuaternion
& operator=(
const
C4x4Matrix
&
m
);
52
53
//! @}
54
55
void
Rotate(
const
C3DVector
&
vAxis
,
double
fAngle
);
56
void
Rotate(
const
CQuaternion
&
quat
);
57
58
void
SetAxisAngle(
const
C3DVector
&
vAxis
,
double
radians
);
59
bool
GetAxisAngle(
C3DVector
&
vAxis
,
double
&
radians
)
const
;
60
void
GetHPBAngles(
double
&
heading
,
double
&
pitch
,
double
&
bank
)
const
;
61
62
static
CQuaternion
Slerp(
const
CQuaternion
&
q1
,
const
CQuaternion
&
q2
,
const
float
t);
63
64
bool
IsIdentity(
double
precision
= PRECISION_LIMIT)
const
;
65
bool
IsValid()
const
;
66
67
// Magnitude/normalize methods
68
double
MagnitudeSquared()
const
;
69
double
Magnitude()
const
;
70
void
Normalize();
71
};
72
73
inline
double
* CQuaternion::ValPtr()
74
{
75
return
(val);
76
}
77
78
inline
const
double
* CQuaternion::ValPtr()
const
79
{
80
return
(val);
81
}
82
83
END_MOOTOOLS_NAMESPACE
84
85
#endif
// !defined(AFX_QUATERNION_H__04F856D9_60E8_45A9_993A_335E6079939E__INCLUDED_)
C3DTPoint
The class defines an x, y, z 3D point which can use int, float or double.
Definition
3DPoint.h:27
C3DTVector< real >
C4x4TMatrix< float >
CQuaternion
The class defines a quaternion transformation.
Definition
Quaternion.h:20
VS2022-PolygonCruncherSDK-Full-IO
SDK
Includes
Quaternion.h
Generated by
1.9.8