mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-24 00:31:16 +00:00
Add Vector3/Vector4 to Data vector
This commit is contained in:
parent
c56423baa3
commit
123f143514
@ -65,7 +65,7 @@ class Matrix4Impl {
|
||||
virtual void ToQuaternion(Vector4Impl* p_resultQuat);
|
||||
virtual int FUN_10002710(const Vector3Impl* p_vec);
|
||||
|
||||
inline float& operator[](size_t idx) { return (*m_data)[idx >> 2][idx & 3]; }
|
||||
inline float& operator[](size_t idx) { return ((float*) m_data)[idx]; }
|
||||
|
||||
protected:
|
||||
Matrix4* m_data;
|
||||
@ -75,8 +75,8 @@ class Matrix4Impl {
|
||||
// SIZE 0x48
|
||||
class Matrix4Data : public Matrix4Impl {
|
||||
public:
|
||||
inline Matrix4Data() : Matrix4Impl(m) {}
|
||||
inline Matrix4Data(Matrix4Data& p_other) : Matrix4Impl(m) { m = *p_other.m_data; }
|
||||
inline Matrix4Data() : Matrix4Impl(m_matrix) {}
|
||||
inline Matrix4Data(Matrix4Data& p_other) : Matrix4Impl(m_matrix) { m_matrix = *p_other.m_data; }
|
||||
inline Matrix4& GetMatrix() { return *m_data; }
|
||||
|
||||
// No idea why there's another equals. Maybe to some other type like the
|
||||
@ -84,7 +84,7 @@ class Matrix4Data : public Matrix4Impl {
|
||||
// vtable + 0x44
|
||||
virtual void operator=(const Matrix4Data& p_other);
|
||||
|
||||
Matrix4 m;
|
||||
Matrix4 m_matrix;
|
||||
};
|
||||
|
||||
#endif // MATRIX_H
|
||||
|
||||
@ -186,43 +186,31 @@ class Vector4Impl : public Vector3Impl {
|
||||
// SIZE 0x14
|
||||
class Vector3Data : public Vector3Impl {
|
||||
public:
|
||||
inline Vector3Data() : Vector3Impl(storage) {}
|
||||
inline Vector3Data(float p_x, float p_y, float p_z) : Vector3Impl(storage), x(p_x), y(p_y), z(p_z) {}
|
||||
|
||||
union {
|
||||
float storage[3];
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
};
|
||||
};
|
||||
inline Vector3Data() : Vector3Impl(m_vector.elements) {}
|
||||
inline Vector3Data(float p_x, float p_y, float p_z) : Vector3Impl(m_vector.elements), m_vector(p_x, p_y, p_z) {}
|
||||
|
||||
void CopyFrom(Vector3Data& p_other)
|
||||
{
|
||||
EqualsImpl(p_other.m_data);
|
||||
|
||||
float* dest = this->storage;
|
||||
float* src = p_other.storage;
|
||||
for (size_t i = sizeof(storage) / sizeof(float); i > 0; --i)
|
||||
float* dest = m_vector.elements;
|
||||
float* src = p_other.m_vector.elements;
|
||||
for (size_t i = sizeof(m_vector) / sizeof(float); i > 0; --i)
|
||||
*dest++ = *src++;
|
||||
}
|
||||
|
||||
private:
|
||||
Vector3 m_vector;
|
||||
};
|
||||
|
||||
// VTABLE 0x100d41e8
|
||||
// SIZE 0x18
|
||||
class Vector4Data : public Vector4Impl {
|
||||
public:
|
||||
inline Vector4Data() : Vector4Impl(storage) {}
|
||||
union {
|
||||
float storage[4];
|
||||
struct {
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
};
|
||||
inline Vector4Data() : Vector4Impl(m_vector.elements) {}
|
||||
|
||||
private:
|
||||
Vector4 m_vector;
|
||||
};
|
||||
|
||||
#endif // VECTOR_H
|
||||
|
||||
Loading…
Reference in New Issue
Block a user