Revert "Partially fix vector interface"

This reverts commit 6e7a1e2b08.
This commit is contained in:
Christian Semmler 2024-06-06 11:30:25 -04:00
parent 6e7a1e2b08
commit e3860e3c9f
15 changed files with 46 additions and 46 deletions

View File

@ -227,7 +227,7 @@ MxU32 Helicopter::HandleControl(LegoControlManagerEvent& p_param)
lookat = dir;
float scale = 3;
lookat.Mul(scale);
lookat.Add(loc);
lookat.Add(&loc);
Mx3DPointFloat v68, v7c, v90(0, 1, 0), va4;
v68 = m_world->GetCamera()->GetWorldUp();
va4.EqualsCross(&v68, &dir);
@ -379,9 +379,9 @@ void Helicopter::VTable0x70(float p_float)
mat.SetIdentity();
m_unk0x1f4.Unknown6(mat, f2);
v2.SetVector(loc);
v2.Sub(v);
v2.Sub(&v);
v2.Mul(f2);
v2.Add(v);
v2.Add(&v);
m_world->GetCamera()->FUN_100123e0(mat, 0);
}
else {

View File

@ -125,7 +125,7 @@ void IslePathActor::Exit()
e->FUN_1002ddc0(*m_boundary, local20);
((Vector3&) local20).Mul(m_roi->GetWorldBoundingSphere().Radius());
((Vector3&) local20).Add(GetWorldPosition());
((Vector3&) local20).Add(&GetWorldPosition());
MxS32 j;
for (j = 0; j < m_boundary->GetNumEdges(); j++) {

View File

@ -1573,7 +1573,7 @@ MxU16 LegoAnimationManager::FUN_10062110(
Mx3DPointFloat position(p_roi->GetWorldPosition());
// TODO: Fix call
((Vector3&) position).Sub(p_position);
((Vector3&) position).Sub(&p_position);
float len = position.LenSquared();
float min, max;
@ -2466,9 +2466,9 @@ MxBool LegoAnimationManager::FUN_10064010(LegoPathBoundary* p_boundary, LegoUnkn
Mx3DPointFloat vec(1.0f, 1.0f, 1.0f);
boundingBox.Min() = p1;
boundingBox.Min().Sub(vec);
boundingBox.Min().Sub(&vec);
boundingBox.Max() = p1;
boundingBox.Max().Add(vec);
boundingBox.Max().Add(&vec);
return GetViewManager()->FUN_100a6150(boundingBox) == FALSE;
}

View File

@ -97,7 +97,7 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
else {
m_state = 0;
m_scheduledTime = 0.0f;
((Vector3&) positionRef).Sub(g_unk0x10104c18); // TODO: Fix call
((Vector3&) positionRef).Sub(&g_unk0x10104c18); // TODO: Fix call
m_roi->FUN_100a58f0(p_transform);
return TRUE;
}
@ -218,7 +218,7 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
// TODO: Fix calls
((Mx3DPointFloat&) dir).Mul(2.0f);
((Vector3&) positionRef).Add(dir);
((Vector3&) positionRef).Add(&dir);
for (MxS32 i = 0; i < m_boundary->GetNumEdges(); i++) {
Mx4DPointFloat* normal = m_boundary->GetEdgeNormal(i);
@ -251,7 +251,7 @@ MxResult LegoExtraActor::VTable0x94(LegoPathActor* p_actor, MxBool p_bool)
Mx3DPointFloat dir = p_actor->GetWorldDirection();
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
Vector3 positionRef(matrix3[3]);
((Vector3&) positionRef).Add(g_unk0x10104c18);
((Vector3&) positionRef).Add(&g_unk0x10104c18);
roi->FUN_100a58f0(matrix3);
#ifdef COMPAT_MODE
@ -463,7 +463,7 @@ MxU32 LegoExtraActor::VTable0x6c(
Vector3 local60(local2world[3]);
Mx3DPointFloat local54(p_v1);
((Vector3&) local54).Sub(local60);
((Vector3&) local54).Sub(&local60);
float local1c = p_v2.Dot(&p_v2, &p_v2);
float local24 = p_v2.Dot(&p_v2, &local54) * 2.0f;
float local20 = local54.Dot(&local54, &local54);

View File

@ -68,7 +68,7 @@ MxResult LegoPathActor::VTable0x80(Vector3& p_point1, Vector3& p_point2, Vector3
Mx3DPointFloat p1, p2, p3;
p1 = p_point3;
((Vector3&) p1).Sub(p_point1);
((Vector3&) p1).Sub(&p_point1);
m_BADuration = p1.LenSquared();
if (m_BADuration > 0.0f) {
@ -120,7 +120,7 @@ MxResult LegoPathActor::VTable0x88(
p_destEdge.FUN_1002ddc0(*p_boundary, p3);
p4 = p2;
((Vector3&) p4).Sub(p1);
((Vector3&) p4).Sub(&p1);
p4.Unitize();
MxMatrix matrix;
@ -285,12 +285,12 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
m_worldSpeed *= m_unk0x144;
nav->SetLinearVel(m_worldSpeed);
Mx3DPointFloat p7(p2);
((Vector3&) p7).Sub(p6);
((Vector3&) p7).Sub(&p6);
if (p7.Unitize() == 0) {
float f = sqrt(p1.LenSquared()) * m_unk0x140;
((Vector3&) p7).Mul(f);
((Vector3&) p1).Add(p7);
((Vector3&) p1).Add(&p7);
}
}
}
@ -474,7 +474,7 @@ MxU32 LegoPathActor::VTable0x6c(
MxS32 LegoPathActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
{
Mx3DPointFloat v2(p_v2);
((Vector3&) v2).Sub(p_v1);
((Vector3&) v2).Sub(&p_v1);
float len = v2.LenSquared();
@ -650,7 +650,7 @@ MxResult LegoPathActor::VTable0x9c()
Mx3DPointFloat local84(m_unk0xec[2]);
Mx3DPointFloat local70(local34);
((Vector3&) local70).Sub(localc0);
((Vector3&) local70).Sub(&localc0);
float len = local70.LenSquared();
if (len >= 0.0f) {
len = sqrt(len);

View File

@ -201,7 +201,7 @@ MxU32 LegoPathBoundary::Intersect(
if (local10 == 0) {
local10 = 1;
vec = p_point2;
((Vector3&) vec).Sub(p_point1);
((Vector3&) vec).Sub(&p_point1);
len = vec.LenSquared();
if (len <= 0.0f) {
@ -235,7 +235,7 @@ MxU32 LegoPathBoundary::Intersect(
p_point3 = vec;
p_point3.Mul(localc);
p_point3.Add(p_point1);
p_point3.Add(&p_point1);
local50 = p_point2;
((Vector3&) local50).Sub(local5c);
@ -345,7 +345,7 @@ MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter)
Mx3DPointFloat unk0x30;
unk0x30 = m_unk0x30;
((Vector3&) unk0x30).Sub(p_presenter->m_unk0xa8);
((Vector3&) unk0x30).Sub(&p_presenter->m_unk0xa8);
float len = unk0x30.LenSquared();
float local20 = p_presenter->m_unk0xa4 + m_unk0x44;

View File

@ -94,7 +94,7 @@ MxResult LegoPathController::Create(MxU8* p_data, const Vector3& p_location, con
for (i = 0; i < m_numN; i++) {
// TODO: Fix call
((Vector3&) m_unk0x10[i]).Add(p_location);
((Vector3&) m_unk0x10[i]).Add(&p_location);
}
for (i = 0; i < m_numL; i++) {

View File

@ -650,9 +650,9 @@ void LegoAnimPresenter::PutFrame()
#ifdef COMPAT_MODE
Mx3DPointFloat location = m_currentWorld->GetCamera()->GetWorldLocation();
((Vector3&) up).Sub(location);
((Vector3&) up).Sub(&location);
#else
((Vector3&) up).Sub(m_currentWorld->GetCamera()->GetWorldLocation());
((Vector3&) up).Sub(&m_currentWorld->GetCamera()->GetWorldLocation());
#endif
((Vector3&) dir).Div(dirsqr);
pos.EqualsCross(&dir, &up);
@ -1119,7 +1119,7 @@ void LegoAnimPresenter::VTable0x8c()
m_unk0xa8.Add((*m_unk0x78)[3]);
}
else {
m_unk0xa8.Add(m_action->GetLocation());
m_unk0xa8.Add(&m_action->GetLocation());
}
if (m_currentWorld == NULL) {
@ -1176,10 +1176,10 @@ MxU32 LegoAnimPresenter::VTable0x94(Vector3& p_v1, Vector3& p_v2, float p_f1, fl
b = p_v2;
((Vector3&) b).Mul(p_f1);
((Vector3&) b).Add(p_v1);
((Vector3&) b).Add(&p_v1);
a = b;
((Vector3&) a).Sub(m_unk0xa8);
((Vector3&) a).Sub(&m_unk0xa8);
float len = a.LenSquared();
if (len <= 0.0f) {

View File

@ -68,9 +68,9 @@ void LegoLoopingAnimPresenter::PutFrame()
#ifdef COMPAT_MODE
Mx3DPointFloat location = m_currentWorld->GetCamera()->GetWorldLocation();
((Vector3&) up).Sub(location);
((Vector3&) up).Sub(&location);
#else
((Vector3&) up).Sub(m_currentWorld->GetCamera()->GetWorldLocation());
((Vector3&) up).Sub(&m_currentWorld->GetCamera()->GetWorldLocation());
#endif
((Vector3&) dir).Div(dirsqr);
pos.EqualsCross(&dir, &up);

View File

@ -717,13 +717,13 @@ void Isle::Enable(MxBool p_enable)
Mx3DPointFloat position(CurrentActor()->GetROI()->GetWorldPosition());
Mx3DPointFloat sub(-21.375f, 0.0f, -41.75f);
((Vector3&) sub).Sub(position);
((Vector3&) sub).Sub(&position);
if (sub.LenSquared() < 1024.0f) {
AnimationManager()->FUN_10064740(NULL);
}
Mx3DPointFloat sub2(98.874992f, 0.0f, -46.156292f);
((Vector3&) sub2).Sub(position);
((Vector3&) sub2).Sub(&position);
if (sub2.LenSquared() < 1024.0f) {
AnimationManager()->FUN_10064670(NULL);
}

View File

@ -42,9 +42,9 @@ LegoResult LegoUnknown::FUN_1009a1e0(float p_f1, Matrix4& p_mat, Vector3& p_v, L
}
else if (p_f1 >= 0.999) {
v1 = m_unk0x00[0];
((Vector3&) v1).Add(m_unk0x00[1]);
((Vector3&) v1).Add(m_unk0x00[2]);
((Vector3&) v1).Add(m_unk0x00[3]);
((Vector3&) v1).Add(&m_unk0x00[1]);
((Vector3&) v1).Add(&m_unk0x00[2]);
((Vector3&) v1).Add(&m_unk0x00[3]);
for (LegoS32 i = 0; i < 3; i++) {
v4[i] = m_unk0x00[1][i] + m_unk0x00[2][i] * 2.0f + m_unk0x00[3][i] * 3.0f;

View File

@ -565,7 +565,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (p_collideBox) {
Mx3DPointFloat v2(p_v2);
((Vector3&) v2).Mul(p_f1);
((Vector3&) v2).Add(p_v1);
((Vector3&) v2).Add(&p_v1);
Mx4DPointFloat localc0;
Mx4DPointFloat local9c;
@ -585,7 +585,7 @@ LegoU32 LegoROI::FUN_100a9410(
localc0[3] = local9c[3] = local168[3] = 1.0f;
local38 = local58;
((Vector3&) local38).Add(locala8);
((Vector3&) local38).Add(&locala8);
((Vector3&) local38).Mul(0.5f);
local70 = localc0;
@ -624,7 +624,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (local50 >= 0.0f && local50 <= p_f1) {
Mx3DPointFloat local17c(p_v2);
((Vector3&) local17c).Mul(local50);
((Vector3&) local17c).Add(local4c);
((Vector3&) local17c).Add(&local4c);
LegoS32 j;
for (j = 0; j < 6; j++) {
@ -644,7 +644,7 @@ LegoU32 LegoROI::FUN_100a9410(
}
else {
Mx3DPointFloat v1(p_v1);
((Vector3&) v1).Sub(GetWorldBoundingSphere().Center());
((Vector3&) v1).Sub(&GetWorldBoundingSphere().Center());
float local10 = GetWorldBoundingSphere().Radius();
float local8 = p_v2.Dot(&p_v2, &p_v2);
@ -681,7 +681,7 @@ LegoU32 LegoROI::FUN_100a9410(
if (local1c >= 0.0f && p_f1 >= local1c) {
p_v3 = p_v2;
p_v3.Mul(local1c);
p_v3.Add(p_v1);
p_v3.Add(&p_v1);
return 1;
}
}
@ -711,9 +711,9 @@ void TimeROI::FUN_100a9b40(Matrix4& p_matrix, LegoTime p_time)
// TODO: Fix constness of vector/matrix functions
#ifdef COMPAT_MODE
Vector3 worldPosition(m_local2world[3]);
((Vector3&) targetPosition).Sub(worldPosition);
((Vector3&) targetPosition).Sub(&worldPosition);
#else
((Vector3&) targetPosition).Sub(Vector3(m_local2world[3]));
((Vector3&) targetPosition).Sub(&Vector3(m_local2world[3]));
#endif
float division = time * 0.001;

View File

@ -149,10 +149,10 @@ inline void UnknownMx4DPointFloat::Unknown7()
Mx4DPointFloat v2;
v1 = m_unk0x00;
((Vector4&) v1).Add(m_unk0x18);
((Vector4&) v1).Add(&m_unk0x18);
v2 = m_unk0x00;
((Vector4&) v2).Sub(m_unk0x18);
((Vector4&) v2).Sub(&m_unk0x18);
if (v1.Dot(&v1, &v1) < v2.Dot(&v2, &v2)) {
((Vector4&) m_unk0x18).Mul(-1.0f);

View File

@ -120,13 +120,13 @@ public:
virtual void Add(float* p_other) { AddImpl(p_other); } // vtable+0x4c
// FUNCTION: LEGO1 0x100021e0
virtual void Add(const Vector2& p_other) { AddImpl((float*) p_other.m_data); } // vtable+0x48
virtual void Add(const Vector2* p_other) { AddImpl((float*) p_other->m_data); } // vtable+0x48
// FUNCTION: LEGO1 0x100021f0
virtual void Sub(const float* p_other) { SubImpl((float*) p_other); } // vtable+0x58
// FUNCTION: LEGO1 0x10002200
virtual void Sub(const Vector2& p_other) { SubImpl((float*) p_other.m_data); } // vtable+0x54
virtual void Sub(const Vector2* p_other) { SubImpl((float*) p_other->m_data); } // vtable+0x54
// FUNCTION: LEGO1 0x10002210
virtual void Mul(float* p_other) { MulVectorImpl(p_other); } // vtable+0x64

View File

@ -428,10 +428,10 @@ void ViewManager::UpdateViewTransformations()
Vector3 u(unk0x150[i]);
x = c;
((Vector3&) x).Sub(b); // TODO: Fix call
((Vector3&) x).Sub(&b); // TODO: Fix call
y = a;
((Vector3&) y).Sub(b); // TODO: Fix call
((Vector3&) y).Sub(&b); // TODO: Fix call
u.EqualsCross(&x, &y);
u.Unitize();