Havok: Fix matching issue in copy assignment operator for hkVector4f

This commit is contained in:
Léo Lam 2022-01-13 19:05:47 +01:00
parent 1511ec620d
commit 5001b38218
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
3 changed files with 17 additions and 2 deletions

View File

@ -7,9 +7,12 @@ using hkQuaternionfParameter = const class hkQuaternionf&;
class hkQuaternionf {
public:
hkQuaternionf() {} // NOLINT(modernize-use-equals-default)
HK_FORCE_INLINE hkQuaternionf(const hkQuaternionf&) = default;
HK_FORCE_INLINE hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r);
HK_FORCE_INLINE void set(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r);
HK_FORCE_INLINE hkQuaternionf& operator=(const hkQuaternionf& q);
hkVector4f m_vec;
};
@ -20,3 +23,8 @@ inline hkQuaternionf::hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hk
inline void hkQuaternionf::set(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r) {
m_vec.set(ix, iy, iz, r);
}
inline hkQuaternionf& hkQuaternionf::operator=(const hkQuaternionf& q) {
m_vec = q.m_vec;
return *this;
}

View File

@ -23,7 +23,7 @@ public:
HK_FORCE_INLINE hkVector4f() {}
HK_FORCE_INLINE hkVector4f(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w = 0);
HK_FORCE_INLINE hkVector4f(const hkVector4f& other);
HK_FORCE_INLINE hkVector4f& operator=(hkVector4fParameter) = default;
HK_FORCE_INLINE hkVector4f& operator=(hkVector4fParameter other);
// ========== Vector initialization

View File

@ -12,7 +12,14 @@ inline hkVector4f::hkVector4f(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w
set(x, y, z, w);
}
inline hkVector4f::hkVector4f(const hkVector4f& other) = default;
inline hkVector4f::hkVector4f(const hkVector4f& other) {
v = other.v;
}
inline hkVector4f& hkVector4f::operator=(hkVector4fParameter other) {
v = other.v;
return *this;
}
inline void hkVector4f::set(hkFloat32 x, hkFloat32 y, hkFloat32 z, hkFloat32 w) {
v[0] = x;