mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 18:04:06 +00:00
Partially fix vector interface
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user