mirror of https://github.com/zeldaret/botw.git
Havok: Split some math headers to avoid header dependency issues
This commit is contained in:
parent
0ef08bde7e
commit
eda37507ba
|
@ -16,12 +16,14 @@ add_library(hkStubs OBJECT
|
|||
Havok/Common/Base/Math/Header/hkMathHeaderConstants.h
|
||||
Havok/Common/Base/Math/Matrix/hkMatrix3.h
|
||||
Havok/Common/Base/Math/Matrix/hkMatrix3f.h
|
||||
Havok/Common/Base/Math/Matrix/hkMatrix3f.inl
|
||||
Havok/Common/Base/Math/Matrix/hkRotation.h
|
||||
Havok/Common/Base/Math/Matrix/hkRotationf.h
|
||||
Havok/Common/Base/Math/Matrix/hkTransform.h
|
||||
Havok/Common/Base/Math/Matrix/hkTransformf.h
|
||||
Havok/Common/Base/Math/Quaternion/hkQuaternion.h
|
||||
Havok/Common/Base/Math/Quaternion/hkQuaternionf.h
|
||||
Havok/Common/Base/Math/Quaternion/hkQuaternionf.inl
|
||||
Havok/Common/Base/Math/SweptTransform/hkSweptTransform.h
|
||||
Havok/Common/Base/Math/SweptTransform/hkSweptTransformf.h
|
||||
Havok/Common/Base/Math/SweptTransform/hkSweptTransformfUtil.h
|
||||
|
@ -32,6 +34,7 @@ add_library(hkStubs OBJECT
|
|||
Havok/Common/Base/Math/Vector/hkVector4f.inl
|
||||
Havok/Common/Base/Math/Vector/hkVector4Comparison.h
|
||||
Havok/Common/Base/Math/Vector/hkVector4fComparison.h
|
||||
Havok/Common/Base/Math/Vector/hkVector4fComparison.inl
|
||||
|
||||
Havok/Common/Base/Memory/Allocator/hkMemoryAllocator.h
|
||||
Havok/Common/Base/Memory/Allocator/Lifo/hkLifoAllocator.h
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4f.h>
|
||||
|
||||
class hkMatrix3f {
|
||||
public:
|
||||
hkMatrix3f() {} // NOLINT(modernize-use-equals-default)
|
||||
|
@ -27,60 +25,3 @@ public:
|
|||
hkVector4f m_col1;
|
||||
hkVector4f m_col2;
|
||||
};
|
||||
|
||||
inline hkFloat32& hkMatrix3f::operator()(int row, int col) {
|
||||
return getColumn(col)(row);
|
||||
}
|
||||
|
||||
inline const hkFloat32& hkMatrix3f::operator()(int row, int col) const {
|
||||
return getColumn(col)(row);
|
||||
}
|
||||
|
||||
template <int Row, int Col>
|
||||
inline hkSimdFloat32 hkMatrix3f::get() const {
|
||||
return getColumn<Col>().template getComponent<Row>();
|
||||
}
|
||||
|
||||
template <int Row, int Col>
|
||||
inline void hkMatrix3f::set(hkSimdFloat32Parameter s) {
|
||||
getColumn<Col>().template setComponent<Row>(s);
|
||||
}
|
||||
|
||||
inline hkVector4f& hkMatrix3f::getColumn(int i) {
|
||||
return (&m_col0)[i];
|
||||
}
|
||||
|
||||
inline const hkVector4f& hkMatrix3f::getColumn(int i) const {
|
||||
return (&m_col0)[i];
|
||||
}
|
||||
|
||||
template <int I>
|
||||
inline const hkVector4f& hkMatrix3f::getColumn() const {
|
||||
return (&m_col0)[I];
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::getRows(hkVector4f& r0, hkVector4f& r1, hkVector4f& r2) const {
|
||||
hkVector4f c0;
|
||||
c0.set(m_col0(0), m_col1(0), m_col2(0));
|
||||
hkVector4f c1;
|
||||
c1.set(m_col0(1), m_col1(1), m_col2(1));
|
||||
hkVector4f c2;
|
||||
c2.set(m_col0(2), m_col1(2), m_col2(2));
|
||||
|
||||
r0 = c0;
|
||||
r1 = c1;
|
||||
r2 = c2;
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::setZero() {
|
||||
m_col0.setZero();
|
||||
m_col1.setZero();
|
||||
m_col2.setZero();
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::setIdentity() {
|
||||
hkMatrix3f* __restrict d = this;
|
||||
d->m_col0 = hkVector4f::getConstant<HK_QUADREAL_1000>();
|
||||
d->m_col1 = hkVector4f::getConstant<HK_QUADREAL_0100>();
|
||||
d->m_col2 = hkVector4f::getConstant<HK_QUADREAL_0010>();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
inline hkFloat32& hkMatrix3f::operator()(int row, int col) {
|
||||
return getColumn(col)(row);
|
||||
}
|
||||
|
||||
inline const hkFloat32& hkMatrix3f::operator()(int row, int col) const {
|
||||
return getColumn(col)(row);
|
||||
}
|
||||
|
||||
template <int Row, int Col>
|
||||
inline hkSimdFloat32 hkMatrix3f::get() const {
|
||||
return getColumn<Col>().template getComponent<Row>();
|
||||
}
|
||||
|
||||
template <int Row, int Col>
|
||||
inline void hkMatrix3f::set(hkSimdFloat32Parameter s) {
|
||||
getColumn<Col>().template setComponent<Row>(s);
|
||||
}
|
||||
|
||||
inline hkVector4f& hkMatrix3f::getColumn(int i) {
|
||||
return (&m_col0)[i];
|
||||
}
|
||||
|
||||
inline const hkVector4f& hkMatrix3f::getColumn(int i) const {
|
||||
return (&m_col0)[i];
|
||||
}
|
||||
|
||||
template <int I>
|
||||
inline const hkVector4f& hkMatrix3f::getColumn() const {
|
||||
return (&m_col0)[I];
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::getRows(hkVector4f& r0, hkVector4f& r1, hkVector4f& r2) const {
|
||||
hkVector4f c0;
|
||||
c0.set(m_col0(0), m_col1(0), m_col2(0));
|
||||
hkVector4f c1;
|
||||
c1.set(m_col0(1), m_col1(1), m_col2(1));
|
||||
hkVector4f c2;
|
||||
c2.set(m_col0(2), m_col1(2), m_col2(2));
|
||||
|
||||
r0 = c0;
|
||||
r1 = c1;
|
||||
r2 = c2;
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::setZero() {
|
||||
m_col0.setZero();
|
||||
m_col1.setZero();
|
||||
m_col2.setZero();
|
||||
}
|
||||
|
||||
inline void hkMatrix3f::setIdentity() {
|
||||
hkMatrix3f* __restrict d = this;
|
||||
d->m_col0 = hkVector4f::getConstant<HK_QUADREAL_1000>();
|
||||
d->m_col1 = hkVector4f::getConstant<HK_QUADREAL_0100>();
|
||||
d->m_col2 = hkVector4f::getConstant<HK_QUADREAL_0010>();
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <Havok/Common/Base/Math/Matrix/hkMatrix3f.h>
|
||||
#include <Havok/Common/Base/Math/Quaternion/hkQuaternionf.h>
|
||||
|
||||
class hkRotationf : public hkMatrix3f {
|
||||
public:
|
||||
void set(hkQuaternionfParameter q);
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <Havok/Common/Base/Math/Matrix/hkRotationf.h>
|
||||
#include <Havok/Common/Base/Math/Quaternion/hkQuaternionf.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4f.h>
|
||||
|
||||
class hkTransformf {
|
||||
public:
|
||||
HK_FORCE_INLINE hkTransformf() = default;
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4f.h>
|
||||
|
||||
using hkQuaternionfParameter = const class hkQuaternionf&;
|
||||
|
||||
class hkQuaternionf {
|
||||
public:
|
||||
hkQuaternionf() {} // NOLINT(modernize-use-equals-default)
|
||||
|
@ -43,102 +39,3 @@ public:
|
|||
|
||||
hkVector4f m_vec;
|
||||
};
|
||||
|
||||
inline hkQuaternionf::hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r) {
|
||||
set(ix, iy, iz, r);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
inline const hkFloat32& hkQuaternionf::operator()(int i) const {
|
||||
return m_vec(i);
|
||||
}
|
||||
|
||||
template <int I>
|
||||
inline hkSimdFloat32 hkQuaternionf::getComponent() const {
|
||||
return m_vec.getComponent<I>();
|
||||
}
|
||||
|
||||
inline hkFloat32 hkQuaternionf::getReal() const {
|
||||
return m_vec(3);
|
||||
}
|
||||
|
||||
inline hkSimdFloat32 hkQuaternionf::getRealPart() const {
|
||||
return m_vec.getW();
|
||||
}
|
||||
|
||||
inline const hkVector4f& hkQuaternionf::getImag() const {
|
||||
return m_vec;
|
||||
}
|
||||
|
||||
inline hkBool32 hkQuaternionf::hasValidAxis() const {
|
||||
return m_vec.lengthSquared<3>().isGreater(hkSimdFloat32::getConstant<HK_QUADREAL_EPS_SQRD>());
|
||||
}
|
||||
|
||||
void hkQuaternionf::getAxis(hkVector4f& axis) const {
|
||||
hkVector4f result = getImag();
|
||||
result.normalize<3>();
|
||||
axis.setFlipSign(result, getRealPart().lessZero());
|
||||
}
|
||||
|
||||
inline hkFloat32 hkQuaternionf::getAngle() const {
|
||||
return getAngleSr().val();
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::mul(hkQuaternionfParameter q) {
|
||||
setMul(*this, q);
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
const auto rReal = r.getRealPart();
|
||||
const auto qReal = q.getRealPart();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(rImag, qImag);
|
||||
vec.addMul(rReal, qImag);
|
||||
vec.addMul(qReal, rImag);
|
||||
m_vec.setXYZ_W(vec, (rReal * qReal) - rImag.dot<3>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setMulInverse(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(qImag, rImag);
|
||||
vec.subMul(r.getRealPart(), qImag);
|
||||
vec.addMul(q.getRealPart(), rImag);
|
||||
m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setInverseMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(qImag, rImag);
|
||||
vec.addMul(r.getRealPart(), qImag);
|
||||
vec.subMul(q.getRealPart(), rImag);
|
||||
m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setInverse(const hkQuaternionf& q) {
|
||||
m_vec.setNeg<3>(q.getImag());
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::normalize() {
|
||||
m_vec.normalizeUnsafe<4>();
|
||||
}
|
||||
|
||||
inline const hkQuaternionf& hkQuaternionf::getIdentity() {
|
||||
return reinterpret_cast<const hkQuaternionf&>(g_vectorfConstants[HK_QUADREAL_0001]);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
#pragma once
|
||||
|
||||
inline hkQuaternionf::hkQuaternionf(hkFloat32 ix, hkFloat32 iy, hkFloat32 iz, hkFloat32 r) {
|
||||
set(ix, iy, iz, r);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
inline const hkFloat32& hkQuaternionf::operator()(int i) const {
|
||||
return m_vec(i);
|
||||
}
|
||||
|
||||
template <int I>
|
||||
inline hkSimdFloat32 hkQuaternionf::getComponent() const {
|
||||
return m_vec.getComponent<I>();
|
||||
}
|
||||
|
||||
inline hkFloat32 hkQuaternionf::getReal() const {
|
||||
return m_vec(3);
|
||||
}
|
||||
|
||||
inline hkSimdFloat32 hkQuaternionf::getRealPart() const {
|
||||
return m_vec.getW();
|
||||
}
|
||||
|
||||
inline const hkVector4f& hkQuaternionf::getImag() const {
|
||||
return m_vec;
|
||||
}
|
||||
|
||||
inline hkBool32 hkQuaternionf::hasValidAxis() const {
|
||||
return m_vec.lengthSquared<3>().isGreater(hkSimdFloat32::getConstant<HK_QUADREAL_EPS_SQRD>());
|
||||
}
|
||||
|
||||
void hkQuaternionf::getAxis(hkVector4f& axis) const {
|
||||
hkVector4f result = getImag();
|
||||
result.normalize<3>();
|
||||
axis.setFlipSign(result, getRealPart().lessZero());
|
||||
}
|
||||
|
||||
inline hkFloat32 hkQuaternionf::getAngle() const {
|
||||
return getAngleSr().val();
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::mul(hkQuaternionfParameter q) {
|
||||
setMul(*this, q);
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
const auto rReal = r.getRealPart();
|
||||
const auto qReal = q.getRealPart();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(rImag, qImag);
|
||||
vec.addMul(rReal, qImag);
|
||||
vec.addMul(qReal, rImag);
|
||||
m_vec.setXYZ_W(vec, (rReal * qReal) - rImag.dot<3>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setMulInverse(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(qImag, rImag);
|
||||
vec.subMul(r.getRealPart(), qImag);
|
||||
vec.addMul(q.getRealPart(), rImag);
|
||||
m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setInverseMul(hkQuaternionfParameter r, hkQuaternionfParameter q) {
|
||||
const auto rImag = r.getImag();
|
||||
const auto qImag = q.getImag();
|
||||
|
||||
hkVector4f vec;
|
||||
vec.setCross(qImag, rImag);
|
||||
vec.addMul(r.getRealPart(), qImag);
|
||||
vec.subMul(q.getRealPart(), rImag);
|
||||
m_vec.setXYZ_W(vec, rImag.dot<4>(qImag));
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::setInverse(const hkQuaternionf& q) {
|
||||
m_vec.setNeg<3>(q.getImag());
|
||||
}
|
||||
|
||||
inline void hkQuaternionf::normalize() {
|
||||
m_vec.normalizeUnsafe<4>();
|
||||
}
|
||||
|
||||
inline const hkQuaternionf& hkQuaternionf::getIdentity() {
|
||||
return reinterpret_cast<const hkQuaternionf&>(g_vectorfConstants[HK_QUADREAL_0001]);
|
||||
}
|
|
@ -11,8 +11,6 @@
|
|||
#include <cmath>
|
||||
#endif
|
||||
|
||||
using hkSimdFloat32Parameter = const class hkSimdFloat32&;
|
||||
|
||||
class hkSimdFloat32 {
|
||||
public:
|
||||
#ifdef HK_SIMD_FLOAT32_AARCH64_NEON
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
#error "Include <Havok/Common/Base/Math/hkMath.h> or hkBase.h"
|
||||
#endif
|
||||
|
||||
using hkVector4fParameter = const class hkVector4f&;
|
||||
using hkVector4fComparisonParameter = const class hkVector4fComparison&;
|
||||
|
||||
class hkMatrix3f;
|
||||
class hkTransformf;
|
||||
|
||||
class hkVector4f {
|
||||
public:
|
||||
HK_DECLARE_CLASS_ALLOCATOR(hkVector4f)
|
||||
|
|
|
@ -65,59 +65,3 @@ public:
|
|||
|
||||
m128u m_mask;
|
||||
};
|
||||
|
||||
inline void hkVector4fComparison::setAnd(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask & b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setAndNot(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask & ~b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setXor(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask ^ b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setOr(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask | b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setNot(hkVector4fComparisonParameter a) {
|
||||
m_mask = ~a.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setSelect(hkVector4fComparisonParameter comp,
|
||||
hkVector4fComparisonParameter trueValue,
|
||||
hkVector4fComparisonParameter falseValue) {
|
||||
#ifdef HK_VECTOR4F_AARCH64_NEON
|
||||
m_mask = vbslq_u32(comp.m_mask, trueValue.m_mask, falseValue.m_mask);
|
||||
#else
|
||||
m_mask = (comp.m_mask & trueValue.m_mask) | (comp.m_mask & ~falseValue.m_mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <hkVector4fComparison::Mask m>
|
||||
inline hkBool32 hkVector4fComparison::allAreSet() const {
|
||||
return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&
|
||||
((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);
|
||||
}
|
||||
|
||||
inline hkBool32 hkVector4fComparison::allAreSet(hkVector4fComparison::Mask m) const {
|
||||
return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&
|
||||
((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);
|
||||
}
|
||||
|
||||
template <hkVector4fComparison::Mask m>
|
||||
inline hkBool32 hkVector4fComparison::anyIsSet() const {
|
||||
return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||
|
||||
((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);
|
||||
}
|
||||
|
||||
inline hkBool32 hkVector4fComparison::anyIsSet(Mask m) const {
|
||||
return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||
|
||||
((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
#pragma once
|
||||
|
||||
inline void hkVector4fComparison::setAnd(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask & b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setAndNot(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask & ~b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setXor(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask ^ b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setOr(hkVector4fComparisonParameter a,
|
||||
hkVector4fComparisonParameter b) {
|
||||
m_mask = a.m_mask | b.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setNot(hkVector4fComparisonParameter a) {
|
||||
m_mask = ~a.m_mask;
|
||||
}
|
||||
|
||||
inline void hkVector4fComparison::setSelect(hkVector4fComparisonParameter comp,
|
||||
hkVector4fComparisonParameter trueValue,
|
||||
hkVector4fComparisonParameter falseValue) {
|
||||
#ifdef HK_VECTOR4F_AARCH64_NEON
|
||||
m_mask = vbslq_u32(comp.m_mask, trueValue.m_mask, falseValue.m_mask);
|
||||
#else
|
||||
m_mask = (comp.m_mask & trueValue.m_mask) | (comp.m_mask & ~falseValue.m_mask);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <hkVector4fComparison::Mask m>
|
||||
inline hkBool32 hkVector4fComparison::allAreSet() const {
|
||||
return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&
|
||||
((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);
|
||||
}
|
||||
|
||||
inline hkBool32 hkVector4fComparison::allAreSet(hkVector4fComparison::Mask m) const {
|
||||
return ((m & MASK_X) == 0 || m_mask[0] != 0) && ((m & MASK_Y) == 0 || m_mask[1] != 0) &&
|
||||
((m & MASK_Z) == 0 || m_mask[2] != 0) && ((m & MASK_W) == 0 || m_mask[3] != 0);
|
||||
}
|
||||
|
||||
template <hkVector4fComparison::Mask m>
|
||||
inline hkBool32 hkVector4fComparison::anyIsSet() const {
|
||||
return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||
|
||||
((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);
|
||||
}
|
||||
|
||||
inline hkBool32 hkVector4fComparison::anyIsSet(Mask m) const {
|
||||
return ((m & MASK_X) != 0 && m_mask[0] != 0) || ((m & MASK_Y) != 0 && m_mask[1] != 0) ||
|
||||
((m & MASK_Z) != 0 && m_mask[2] != 0) || ((m & MASK_W) != 0 && m_mask[3] != 0);
|
||||
}
|
|
@ -2,18 +2,43 @@
|
|||
|
||||
#define HK_MATH_H
|
||||
|
||||
#include <Havok/Common/Base/Types/hkBaseTypes.h>
|
||||
// Note: these headers have to be included in a specific order.
|
||||
// clang-format off
|
||||
|
||||
#include <Havok/Common/Base/Types/hkBaseTypes.h>
|
||||
#include <Havok/Common/Base/Math/Header/hkMathHeaderConstants.h>
|
||||
|
||||
// Forward declarations
|
||||
class hkVector4f;
|
||||
class hkVector4fComparison;
|
||||
class hkSimdFloat32;
|
||||
class hkQuaternionf;
|
||||
class hkMatrix3f;
|
||||
class hkRotationf;
|
||||
class hkTransformf;
|
||||
|
||||
// Type aliases
|
||||
using hkVector4fParameter = const hkVector4f&;
|
||||
using hkVector4fComparisonParameter = const hkVector4fComparison&;
|
||||
using hkSimdFloat32Parameter = const hkSimdFloat32&;
|
||||
using hkQuaternionfParameter = const hkQuaternionf&;
|
||||
|
||||
// Headers
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4Comparison.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkSimdReal.h>
|
||||
#include <Havok/Common/Base/Math/Quaternion/hkQuaternion.h>
|
||||
#include <Havok/Common/Base/Math/Matrix/hkMatrix3.h>
|
||||
#include <Havok/Common/Base/Math/Matrix/hkRotation.h>
|
||||
#include <Havok/Common/Base/Math/Matrix/hkTransform.h>
|
||||
#include <Havok/Common/Base/Math/Quaternion/hkQuaternion.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkSimdReal.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4.h>
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4Comparison.h>
|
||||
|
||||
// Implementations
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4f.inl>
|
||||
#include <Havok/Common/Base/Math/Vector/hkVector4fComparison.inl>
|
||||
#include <Havok/Common/Base/Math/Quaternion/hkQuaternionf.inl>
|
||||
#include <Havok/Common/Base/Math/Matrix/hkMatrix3f.inl>
|
||||
|
||||
// clang-format on
|
||||
|
||||
namespace hkMath {
|
||||
|
||||
|
|
Loading…
Reference in New Issue