blob: 297e9374a9020efa1bfbb572a9b1667afb6f2910 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#pragma once
class hkTransformf {
public:
HK_FORCE_INLINE hkTransformf() = default;
HK_FORCE_INLINE hkTransformf(const hkTransformf& other);
HK_FORCE_INLINE hkTransformf(const hkRotationf& r, hkVector4fParameter t);
HK_FORCE_INLINE hkTransformf(hkQuaternionfParameter r, hkVector4fParameter t);
hkTransformf& operator=(const hkTransformf& other) = default;
hkRotationf& getRotation() { return m_rotation; }
const hkRotationf& getRotation() const { return m_rotation; }
hkVector4f& getTranslation() { return m_translation; }
const hkVector4f& getTranslation() const { return m_translation; }
HK_FORCE_INLINE void set(const hkRotationf& r, hkVector4fParameter t);
HK_FORCE_INLINE void set(hkQuaternionfParameter q, hkVector4fParameter t);
HK_FORCE_INLINE static const hkTransformf& getIdentity();
HK_FORCE_INLINE void setIdentity();
hkRotationf m_rotation;
hkVector4f m_translation;
};
inline hkTransformf::hkTransformf(const hkTransformf& other) {
const auto col0 = other.m_rotation.m_col0;
const auto col1 = other.m_rotation.m_col1;
const auto col2 = other.m_rotation.m_col2;
const auto col3 = other.m_translation;
m_rotation.m_col0 = col0;
m_rotation.m_col1 = col1;
m_rotation.m_col2 = col2;
m_translation = col3;
}
inline hkTransformf::hkTransformf(const hkRotationf& r, const hkVector4f& t)
: m_rotation(r), m_translation(t) {}
inline hkTransformf::hkTransformf(hkQuaternionfParameter r, const hkVector4f& t)
: m_translation(t) {
m_rotation.set(r);
}
inline void hkTransformf::set(const hkRotationf& r, const hkVector4f& t) {
m_rotation = r;
m_translation = t;
}
inline void hkTransformf::set(const hkQuaternionf& q, const hkVector4f& t) {
m_rotation.set(q);
m_translation = t;
}
inline const hkTransformf& hkTransformf::getIdentity() {
return reinterpret_cast<const hkTransformf&>(g_vectorfConstants[HK_QUADREAL_1000]);
}
inline void hkTransformf::setIdentity() {
m_rotation.setIdentity();
m_translation.setZero();
}
|