mirror of
https://github.com/isledecomp/isle.git
synced 2026-02-02 18:38:57 +00:00
Clear unknowns in LegoPathActor (#1731)
Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
@@ -29,18 +29,18 @@ public:
|
|||||||
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1001a180
|
// FUNCTION: LEGO1 0x1001a180
|
||||||
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override
|
MxS32 CheckIntersections(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override
|
||||||
{
|
{
|
||||||
if (m_animatingHit) {
|
if (m_animatingHit) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return LegoAnimActor::VTable0x68(p_v1, p_v2, p_v3);
|
return LegoAnimActor::CheckIntersections(p_v1, p_v2, p_v3);
|
||||||
} // vtable+0x68
|
} // vtable+0x68
|
||||||
|
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94
|
MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
MxS32 NextTargetLocation() override; // vtable+0xa0
|
MxS32 NextTargetLocation() override; // vtable+0xa0
|
||||||
|
|
||||||
void InitializeNextShot();
|
void InitializeNextShot();
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class Act3Actor : public LegoAnimActor {
|
|||||||
public:
|
public:
|
||||||
Act3Actor();
|
Act3Actor();
|
||||||
|
|
||||||
MxU32 VTable0x90(float p_time, Matrix4& p_transform) override; // vtable+0x90
|
MxU32 StepState(float p_time, Matrix4& p_transform) override; // vtable+0x90
|
||||||
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100431b0
|
// FUNCTION: LEGO1 0x100431b0
|
||||||
@@ -105,7 +105,7 @@ public:
|
|||||||
void ParseAction(char* p_extra) override; // vtable+0x20
|
void ParseAction(char* p_extra) override; // vtable+0x20
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94
|
MxResult HitActor(LegoPathActor*, MxBool) override; // vtable+0x94
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
|
|
||||||
MxFloat GetUnknown0x20() { return m_unk0x20; }
|
MxFloat GetUnknown0x20() { return m_unk0x20; }
|
||||||
|
|
||||||
@@ -142,8 +142,8 @@ public:
|
|||||||
LegoPathBoundary*& p_boundary,
|
LegoPathBoundary*& p_boundary,
|
||||||
LegoOrientedEdge*& p_edge,
|
LegoOrientedEdge*& p_edge,
|
||||||
float& p_unk0xe4
|
float& p_unk0xe4
|
||||||
) override; // vtable+0x98
|
) override; // vtable+0x98
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
|
|
||||||
MxFloat GetUnknown0x20() { return m_unk0x20; }
|
MxFloat GetUnknown0x20() { return m_unk0x20; }
|
||||||
MxFloat GetUnknown0x24() { return m_unk0x24; }
|
MxFloat GetUnknown0x24() { return m_unk0x24; }
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
// Act3Ammo::`scalar deleting destructor'
|
// Act3Ammo::`scalar deleting destructor'
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MxResult CalculateTransform(float p_curveParameter, Matrix4& p_transform);
|
MxResult CalculateTransformOnCurve(float p_curveParameter, Matrix4& p_transform);
|
||||||
|
|
||||||
static Mx3DPointFloat g_hitTranslation;
|
static Mx3DPointFloat g_hitTranslation;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
MxResult Create(MxDSAction& p_dsAction) override; // vtable+0x18
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
|
void ApplyTransform(Matrix4& p_transform) override; // vtable+0x74
|
||||||
MxLong HandleClick() override; // vtable+0xcc
|
MxLong HandleClick() override; // vtable+0xcc
|
||||||
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
MxLong HandleControl(LegoControlManagerNotificationParam& p_param) override; // vtable+0xd4
|
||||||
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
MxLong HandleEndAnim(LegoEndAnimNotificationParam& p_param) override; // vtable+0xd8
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ public:
|
|||||||
|
|
||||||
~LegoAnimActor() override;
|
~LegoAnimActor() override;
|
||||||
|
|
||||||
void ParseAction(char* p_extra) override; // vtable+0x20
|
void ParseAction(char* p_extra) override; // vtable+0x20
|
||||||
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
|
void ApplyTransform(Matrix4& p_transform) override; // vtable+0x74
|
||||||
|
|
||||||
virtual MxResult GetTimeInCycle(float& p_timeInCycle);
|
virtual MxResult GetTimeInCycle(float& p_timeInCycle);
|
||||||
virtual MxResult AnimateWithTransform(float p_time, Matrix4& p_transform);
|
virtual MxResult AnimateWithTransform(float p_time, Matrix4& p_transform);
|
||||||
|
|||||||
@@ -36,30 +36,31 @@ public:
|
|||||||
return !strcmp(p_name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(p_name);
|
return !strcmp(p_name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
||||||
MxS32 VTable0x68(Vector3& p_point1, Vector3& p_point2, Vector3& p_point3) override; // vtable+0x68
|
MxS32 CheckIntersections(Vector3& p_rayOrigin, Vector3& p_rayEnd, Vector3& p_intersectionPoint)
|
||||||
inline MxU32 VTable0x6c(
|
override; // vtable+0x68
|
||||||
|
inline MxU32 CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
) override; // vtable+0x6c
|
) override; // vtable+0x6c
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
void VTable0x74(Matrix4& p_transform) override; // vtable+0x74
|
void ApplyTransform(Matrix4& p_transform) override; // vtable+0x74
|
||||||
MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90
|
MxU32 StepState(float p_time, Matrix4& p_matrix) override; // vtable+0x90
|
||||||
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
void VTable0xa4(MxBool& p_und1, MxS32& p_und2) override; // vtable+0xa4
|
void GetWalkingBehavior(MxBool& p_countCounterclockWise, MxS32& p_selectedEdgeIndex) override; // vtable+0xa4
|
||||||
void VTable0xc4() override; // vtable+0xc4
|
void VTable0xc4() override; // vtable+0xc4
|
||||||
|
|
||||||
virtual MxResult SwitchDirection();
|
virtual MxResult SwitchDirection();
|
||||||
|
|
||||||
void Restart();
|
void Restart();
|
||||||
inline void InitializeReassemblyAnim();
|
inline void InitializeReassemblyAnim();
|
||||||
|
|
||||||
void SetUnknown0x0c(undefined p_unk0x0c) { m_unk0x0c = p_unk0x0c; }
|
void SetPathWalkingMode(MxU8 p_pathWalkingMode) { m_pathWalkingMode = p_pathWalkingMode; }
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1002b760
|
// SYNTHETIC: LEGO1 0x1002b760
|
||||||
// LegoExtraActor::`scalar deleting destructor'
|
// LegoExtraActor::`scalar deleting destructor'
|
||||||
@@ -72,7 +73,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
MxFloat m_scheduledTime; // 0x08
|
MxFloat m_scheduledTime; // 0x08
|
||||||
undefined m_unk0x0c; // 0x0c
|
MxU8 m_pathWalkingMode; // 0x0c
|
||||||
MxU8 m_axis; // 0x0d
|
MxU8 m_axis; // 0x0d
|
||||||
MxBool m_animationAtCurrentBoundary; // 0x0e
|
MxBool m_animationAtCurrentBoundary; // 0x0e
|
||||||
MxFloat m_prevWorldSpeed; // 0x10
|
MxFloat m_prevWorldSpeed; // 0x10
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ public:
|
|||||||
enum ActorState {
|
enum ActorState {
|
||||||
// States
|
// States
|
||||||
c_initial = 0,
|
c_initial = 0,
|
||||||
c_one = 1,
|
c_ready = 1,
|
||||||
c_two = 2,
|
c_hit = 2,
|
||||||
c_three = 3,
|
c_hitAnimation = 3,
|
||||||
c_disabled = 4,
|
c_disabled = 4,
|
||||||
c_maxState = 255,
|
c_maxState = 255,
|
||||||
|
|
||||||
@@ -37,18 +37,22 @@ public:
|
|||||||
LegoPathActor();
|
LegoPathActor();
|
||||||
~LegoPathActor() override;
|
~LegoPathActor() override;
|
||||||
|
|
||||||
void ParseAction(char* p_extra) override; // vtable+0x20
|
void ParseAction(char* p_extra) override; // vtable+0x20
|
||||||
virtual MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3); // vtable+0x68
|
virtual MxS32 CheckIntersections(
|
||||||
virtual MxU32 VTable0x6c(
|
Vector3& p_rayOrigin,
|
||||||
|
Vector3& p_rayEnd,
|
||||||
|
Vector3& p_intersectionPoint
|
||||||
|
); // vtable+0x68
|
||||||
|
virtual MxU32 CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
); // vtable+0x6c
|
); // vtable+0x6c
|
||||||
virtual void Animate(float p_time); // vtable+0x70
|
virtual void Animate(float p_time); // vtable+0x70
|
||||||
virtual void VTable0x74(Matrix4& p_transform); // vtable+0x74
|
virtual void ApplyTransform(Matrix4& p_transform); // vtable+0x74
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d20
|
// FUNCTION: LEGO1 0x10002d20
|
||||||
// FUNCTION: BETA10 0x1000f500
|
// FUNCTION: BETA10 0x1000f500
|
||||||
@@ -58,33 +62,33 @@ public:
|
|||||||
// FUNCTION: BETA10 0x1000f530
|
// FUNCTION: BETA10 0x1000f530
|
||||||
virtual MxBool GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
|
virtual MxBool GetUserNavFlag() { return m_userNavFlag; } // vtable+0x7c
|
||||||
|
|
||||||
virtual MxResult VTable0x80(
|
virtual MxResult SetSpline(
|
||||||
const Vector3& p_point1,
|
const Vector3& p_start,
|
||||||
Vector3& p_point2,
|
Vector3& p_tangentAtStart,
|
||||||
Vector3& p_point3,
|
Vector3& p_end,
|
||||||
Vector3& p_point4
|
Vector3& p_tangentAtEnd
|
||||||
); // vtable+0x80
|
); // vtable+0x80
|
||||||
virtual MxResult VTable0x84(
|
virtual MxResult SetTransformAndDestinationFromPoints(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
float p_time,
|
float p_time,
|
||||||
Vector3& p_p1,
|
Vector3& p_start,
|
||||||
Vector3& p_p4,
|
Vector3& p_direction,
|
||||||
LegoOrientedEdge* p_destEdge,
|
LegoOrientedEdge* p_destEdge,
|
||||||
float p_destScale
|
float p_destScale
|
||||||
); // vtable+0x84
|
); // vtable+0x84
|
||||||
virtual MxResult VTable0x88(
|
virtual MxResult SetTransformAndDestinationFromEdge(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
float p_time,
|
float p_time,
|
||||||
LegoEdge& p_srcEdge,
|
LegoEdge& p_srcEdge,
|
||||||
float p_srcScale,
|
float p_srcScale,
|
||||||
LegoOrientedEdge& p_destEdge,
|
LegoOrientedEdge& p_destEdge,
|
||||||
float p_destScale
|
float p_destScale
|
||||||
); // vtable+0x88
|
); // vtable+0x88
|
||||||
virtual MxS32 VTable0x8c(float p_time, Matrix4& p_transform); // vtable+0x8c
|
virtual MxS32 CalculateTransform(float p_time, Matrix4& p_transform); // vtable+0x8c
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d40
|
// FUNCTION: LEGO1 0x10002d40
|
||||||
// FUNCTION: BETA10 0x1000f560
|
// FUNCTION: BETA10 0x1000f560
|
||||||
virtual MxU32 VTable0x90(float, Matrix4&) { return FALSE; } // vtable+0x90
|
virtual MxU32 StepState(float, Matrix4&) { return FALSE; } // vtable+0x90
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d50
|
// FUNCTION: LEGO1 0x10002d50
|
||||||
// FUNCTION: BETA10 0x1000f800
|
// FUNCTION: BETA10 0x1000f800
|
||||||
@@ -93,16 +97,16 @@ public:
|
|||||||
virtual void SwitchBoundary(
|
virtual void SwitchBoundary(
|
||||||
LegoPathBoundary*& p_boundary,
|
LegoPathBoundary*& p_boundary,
|
||||||
LegoOrientedEdge*& p_edge,
|
LegoOrientedEdge*& p_edge,
|
||||||
float& p_unk0xe4
|
float& p_scale
|
||||||
); // vtable+0x98
|
); // vtable+0x98
|
||||||
virtual MxResult VTable0x9c(); // vtable+0x9c
|
virtual MxResult CalculateSpline(); // vtable+0x9c
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d60
|
// FUNCTION: LEGO1 0x10002d60
|
||||||
// FUNCTION: BETA10 0x1000f820
|
// FUNCTION: BETA10 0x1000f820
|
||||||
virtual MxS32 NextTargetLocation() { return 0; } // vtable+0xa0
|
virtual MxS32 NextTargetLocation() { return 0; } // vtable+0xa0
|
||||||
|
|
||||||
virtual void VTable0xa4(MxBool& p_und1, MxS32& p_und2); // vtable+0xa4
|
virtual void GetWalkingBehavior(MxBool& p_countCounterclockWise, MxS32& p_selectedEdgeIndex); // vtable+0xa4
|
||||||
virtual void VTable0xa8(); // vtable+0xa8
|
virtual void ApplyLocal2World(); // vtable+0xa8
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d70
|
// FUNCTION: LEGO1 0x10002d70
|
||||||
// FUNCTION: BETA10 0x1000f580
|
// FUNCTION: BETA10 0x1000f580
|
||||||
@@ -114,26 +118,32 @@ public:
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002d90
|
// FUNCTION: LEGO1 0x10002d90
|
||||||
// FUNCTION: BETA10 0x1000f5e0
|
// FUNCTION: BETA10 0x1000f5e0
|
||||||
virtual MxFloat VTable0xb4() { return m_unk0x140; } // vtable+0xb4
|
virtual MxFloat GetWallHitDirectionFactor() { return m_wallHitDirectionFactor; } // vtable+0xb4
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002da0
|
// FUNCTION: LEGO1 0x10002da0
|
||||||
// FUNCTION: BETA10 0x1000f610
|
// FUNCTION: BETA10 0x1000f610
|
||||||
virtual MxFloat VTable0xb8() { return m_unk0x144; } // vtable+0xb8
|
virtual MxFloat GetWallHitDampening() { return m_wallHitDampening; } // vtable+0xb8
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002db0
|
// FUNCTION: LEGO1 0x10002db0
|
||||||
// FUNCTION: BETA10 0x1000f640
|
// FUNCTION: BETA10 0x1000f640
|
||||||
virtual void VTable0xbc(MxFloat p_unk0x140) { m_unk0x140 = p_unk0x140; } // vtable+0xbc
|
virtual void SetWallHitDirectionFactor(MxFloat p_wallHitDirectionFactor)
|
||||||
|
{
|
||||||
|
m_wallHitDirectionFactor = p_wallHitDirectionFactor;
|
||||||
|
} // vtable+0xbc
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002dc0
|
// FUNCTION: LEGO1 0x10002dc0
|
||||||
// FUNCTION: BETA10 0x1000f670
|
// FUNCTION: BETA10 0x1000f670
|
||||||
virtual void VTable0xc0(MxFloat p_unk0x144) { m_unk0x144 = p_unk0x144; } // vtable+0xc0
|
virtual void SetWallHitDampening(MxFloat p_wallHitDampening)
|
||||||
|
{
|
||||||
|
m_wallHitDampening = p_wallHitDampening;
|
||||||
|
} // vtable+0xc0
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002dd0
|
// FUNCTION: LEGO1 0x10002dd0
|
||||||
// FUNCTION: BETA10 0x1000f6a0
|
// FUNCTION: BETA10 0x1000f6a0
|
||||||
virtual void VTable0xc4() {} // vtable+0xc4
|
virtual void VTable0xc4() {} // vtable+0xc4
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10002de0
|
// FUNCTION: LEGO1 0x10002de0
|
||||||
virtual void VTable0xc8(MxU8 p_unk0x148) { m_unk0x148 = p_unk0x148; } // vtable+0xc8
|
virtual void SetCanRotate(MxU8 p_canRotate) { m_canRotate = p_canRotate; } // vtable+0xc8
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1000c430
|
// FUNCTION: LEGO1 0x1000c430
|
||||||
// FUNCTION: BETA10 0x10012790
|
// FUNCTION: BETA10 0x10012790
|
||||||
@@ -158,7 +168,7 @@ public:
|
|||||||
|
|
||||||
LegoPathController* GetController() { return m_pathController; }
|
LegoPathController* GetController() { return m_pathController; }
|
||||||
MxBool GetCollideBox() { return m_collideBox; }
|
MxBool GetCollideBox() { return m_collideBox; }
|
||||||
MxFloat GetLastTime() { return m_lastTime; }
|
MxFloat GetTransformTime() { return m_transformTime; }
|
||||||
MxFloat GetActorTime() { return m_actorTime; }
|
MxFloat GetActorTime() { return m_actorTime; }
|
||||||
|
|
||||||
void SetBoundary(LegoPathBoundary* p_boundary) { m_boundary = p_boundary; }
|
void SetBoundary(LegoPathBoundary* p_boundary) { m_boundary = p_boundary; }
|
||||||
@@ -167,7 +177,7 @@ public:
|
|||||||
void SetActorState(MxU32 p_actorState) { m_actorState = p_actorState; }
|
void SetActorState(MxU32 p_actorState) { m_actorState = p_actorState; }
|
||||||
|
|
||||||
void SetController(LegoPathController* p_pathController) { m_pathController = p_pathController; }
|
void SetController(LegoPathController* p_pathController) { m_pathController = p_pathController; }
|
||||||
void SetLastTime(MxFloat p_lastTime) { m_lastTime = p_lastTime; }
|
void SetTransformTime(MxFloat p_transformTime) { m_transformTime = p_transformTime; }
|
||||||
void SetActorTime(MxFloat p_actorTime) { m_actorTime = p_actorTime; }
|
void SetActorTime(MxFloat p_actorTime) { m_actorTime = p_actorTime; }
|
||||||
|
|
||||||
void UpdatePlane(LegoNamedPlane& p_namedPlane);
|
void UpdatePlane(LegoNamedPlane& p_namedPlane);
|
||||||
@@ -178,42 +188,42 @@ public:
|
|||||||
// LegoPathActor::`scalar deleting destructor'
|
// LegoPathActor::`scalar deleting destructor'
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline MxU32 FUN_1002edd0(
|
inline MxU32 CheckIntersectionBothFaces(
|
||||||
list<LegoPathBoundary*>& p_boundaries,
|
list<LegoPathBoundary*>& p_checkedBoundaries,
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3,
|
Vector3& p_intersectionPoint,
|
||||||
MxS32 p_und
|
MxS32 p_depth
|
||||||
);
|
);
|
||||||
|
|
||||||
MxFloat m_BADuration; // 0x78
|
MxFloat m_BADuration; // 0x78
|
||||||
MxFloat m_unk0x7c; // 0x7c
|
MxFloat m_traveledDistance; // 0x7c
|
||||||
MxFloat m_actorTime; // 0x80
|
MxFloat m_actorTime; // 0x80
|
||||||
MxFloat m_lastTime; // 0x84
|
MxFloat m_transformTime; // 0x84
|
||||||
LegoPathBoundary* m_boundary; // 0x88
|
LegoPathBoundary* m_boundary; // 0x88
|
||||||
LegoSpline m_spline; // 0x8c
|
LegoSpline m_spline; // 0x8c
|
||||||
MxU32 m_actorState; // 0xdc
|
MxU32 m_actorState; // 0xdc
|
||||||
LegoOrientedEdge* m_destEdge; // 0xe0
|
LegoOrientedEdge* m_destEdge; // 0xe0
|
||||||
MxFloat m_unk0xe4; // 0xe4
|
MxFloat m_destScale; // 0xe4
|
||||||
MxBool m_collideBox; // 0xe8
|
MxBool m_collideBox; // 0xe8
|
||||||
MxBool m_unk0xe9; // 0xe9
|
MxBool m_finishedTravel; // 0xe9
|
||||||
MxBool m_userNavFlag; // 0xea
|
MxBool m_userNavFlag; // 0xea
|
||||||
MxMatrix m_unk0xec; // 0xec
|
MxMatrix m_local2World; // 0xec
|
||||||
LegoPathEdgeContainer* m_grec; // 0x134
|
LegoPathEdgeContainer* m_grec; // 0x134
|
||||||
LegoPathController* m_pathController; // 0x138
|
LegoPathController* m_pathController; // 0x138
|
||||||
MxFloat m_maxLinearVel; // 0x13c
|
MxFloat m_maxLinearVel; // 0x13c
|
||||||
MxFloat m_unk0x140; // 0x140
|
MxFloat m_wallHitDirectionFactor; // 0x140
|
||||||
MxFloat m_unk0x144; // 0x144
|
MxFloat m_wallHitDampening; // 0x144
|
||||||
MxU8 m_unk0x148; // 0x148
|
MxU8 m_canRotate; // 0x148
|
||||||
MxS32 m_unk0x14c; // 0x14c
|
MxS32 m_lastRotationAngle; // 0x14c
|
||||||
MxFloat m_unk0x150; // 0x150
|
MxFloat m_linearRotationRatio; // 0x150
|
||||||
};
|
};
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002edd0
|
// FUNCTION: LEGO1 0x1002edd0
|
||||||
// LegoPathActor::FUN_1002edd0
|
// LegoPathActor::CheckIntersectionBothFaces
|
||||||
|
|
||||||
// TEMPLATE: LEGO1 0x10018b70
|
// TEMPLATE: LEGO1 0x10018b70
|
||||||
// List<LegoBoundaryEdge>::~List<LegoBoundaryEdge>
|
// List<LegoBoundaryEdge>::~List<LegoBoundaryEdge>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
|
|
||||||
MxResult AddActor(LegoPathActor* p_actor);
|
MxResult AddActor(LegoPathActor* p_actor);
|
||||||
MxResult RemoveActor(LegoPathActor* p_actor);
|
MxResult RemoveActor(LegoPathActor* p_actor);
|
||||||
void CheckAndCallPathTriggers(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor);
|
void CheckAndCallPathTriggers(Vector3& p_from, Vector3& p_to, LegoPathActor* p_actor);
|
||||||
void SwitchBoundary(
|
void SwitchBoundary(
|
||||||
LegoPathActor* p_actor,
|
LegoPathActor* p_actor,
|
||||||
LegoPathBoundary*& p_boundary,
|
LegoPathBoundary*& p_boundary,
|
||||||
|
|||||||
@@ -30,9 +30,13 @@ public:
|
|||||||
return !strcmp(p_name, LegoRaceActor::ClassName()) || LegoAnimActor::IsA(p_name);
|
return !strcmp(p_name, LegoRaceActor::ClassName()) || LegoAnimActor::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
MxS32 VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3) override; // vtable+0x68
|
MxS32 CheckIntersections(
|
||||||
MxU32 VTable0x90(float p_time, Matrix4& p_matrix) override; // vtable+0x90
|
Vector3& p_rayOrigin,
|
||||||
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
Vector3& p_rayEnd,
|
||||||
|
Vector3& p_intersectionPoint
|
||||||
|
) override; // vtable+0x68
|
||||||
|
MxU32 StepState(float p_time, Matrix4& p_matrix) override; // vtable+0x90
|
||||||
|
MxResult HitActor(LegoPathActor* p_actor, MxBool p_bool) override; // vtable+0x94
|
||||||
|
|
||||||
virtual MxResult FUN_10014aa0();
|
virtual MxResult FUN_10014aa0();
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,23 @@ public:
|
|||||||
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
void SetWorldSpeed(MxFloat p_worldSpeed) override; // vtable+0x30
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10014150
|
// FUNCTION: LEGO1 0x10014150
|
||||||
MxU32 VTable0x6c(LegoPathBoundary* p_boundary, Vector3& p_v1, Vector3& p_v2, float p_f1, float p_f2, Vector3& p_v3)
|
MxU32 CheckPresenterAndActorIntersections(
|
||||||
override
|
LegoPathBoundary* p_boundary,
|
||||||
|
Vector3& p_rayOrigin,
|
||||||
|
Vector3& p_rayDirection,
|
||||||
|
float p_rayLength,
|
||||||
|
float p_radius,
|
||||||
|
Vector3& p_intersectionPoint
|
||||||
|
) override
|
||||||
{
|
{
|
||||||
return LegoJetskiRaceActor::VTable0x6c(p_boundary, p_v1, p_v2, p_f1, p_f2, p_v3);
|
return LegoJetskiRaceActor::CheckPresenterAndActorIntersections(
|
||||||
|
p_boundary,
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint
|
||||||
|
);
|
||||||
} // vtable+0x6c
|
} // vtable+0x6c
|
||||||
|
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
@@ -80,7 +93,7 @@ public:
|
|||||||
} // vtable+0x98
|
} // vtable+0x98
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10014210
|
// FUNCTION: LEGO1 0x10014210
|
||||||
MxResult VTable0x9c() override { return LegoJetskiRaceActor::VTable0x9c(); } // vtable+0x9c
|
MxResult CalculateSpline() override { return LegoJetskiRaceActor::CalculateSpline(); } // vtable+0x9c
|
||||||
|
|
||||||
virtual void SetMaxLinearVelocity(float p_worldSpeed);
|
virtual void SetMaxLinearVelocity(float p_worldSpeed);
|
||||||
|
|
||||||
@@ -127,10 +140,23 @@ public:
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10014500
|
// FUNCTION: LEGO1 0x10014500
|
||||||
// FUNCTION: BETA10 0x100cd5e0
|
// FUNCTION: BETA10 0x100cd5e0
|
||||||
MxU32 VTable0x6c(LegoPathBoundary* p_boundary, Vector3& p_v1, Vector3& p_v2, float p_f1, float p_f2, Vector3& p_v3)
|
MxU32 CheckPresenterAndActorIntersections(
|
||||||
override
|
LegoPathBoundary* p_boundary,
|
||||||
|
Vector3& p_rayOrigin,
|
||||||
|
Vector3& p_rayDirection,
|
||||||
|
float p_rayLength,
|
||||||
|
float p_radius,
|
||||||
|
Vector3& p_intersectionPoint
|
||||||
|
) override
|
||||||
{
|
{
|
||||||
return LegoCarRaceActor::VTable0x6c(p_boundary, p_v1, p_v2, p_f1, p_f2, p_v3);
|
return LegoCarRaceActor::CheckPresenterAndActorIntersections(
|
||||||
|
p_boundary,
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint
|
||||||
|
);
|
||||||
} // vtable+0x6c
|
} // vtable+0x6c
|
||||||
|
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
@@ -143,7 +169,7 @@ public:
|
|||||||
LegoCarRaceActor::SwitchBoundary(p_boundary, p_edge, p_unk0xe4);
|
LegoCarRaceActor::SwitchBoundary(p_boundary, p_edge, p_unk0xe4);
|
||||||
} // vtable+0x98
|
} // vtable+0x98
|
||||||
|
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
|
|
||||||
virtual void SetMaxLinearVelocity(float p_maxLinearVelocity);
|
virtual void SetMaxLinearVelocity(float p_maxLinearVelocity);
|
||||||
virtual void KickCamera(float p_param);
|
virtual void KickCamera(float p_param);
|
||||||
|
|||||||
@@ -35,21 +35,21 @@ public:
|
|||||||
return !strcmp(p_name, LegoCarRaceActor::ClassName()) || LegoRaceActor::IsA(p_name);
|
return !strcmp(p_name, LegoCarRaceActor::ClassName()) || LegoRaceActor::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MxU32 VTable0x6c(
|
inline MxU32 CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
) override; // vtable+0x6c
|
) override; // vtable+0x6c
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
void SwitchBoundary(
|
void SwitchBoundary(
|
||||||
LegoPathBoundary*& p_boundary,
|
LegoPathBoundary*& p_boundary,
|
||||||
LegoOrientedEdge*& p_edge,
|
LegoOrientedEdge*& p_edge,
|
||||||
float& p_unk0xe4
|
float& p_unk0xe4
|
||||||
) override; // vtable+0x98
|
) override; // vtable+0x98
|
||||||
MxResult VTable0x9c() override; // vtable+0x9c
|
MxResult CalculateSpline() override; // vtable+0x9c
|
||||||
|
|
||||||
// LegoCarRaceActor vtable
|
// LegoCarRaceActor vtable
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ public:
|
|||||||
return !strcmp(p_name, LegoJetskiRaceActor::ClassName()) || LegoCarRaceActor::IsA(p_name);
|
return !strcmp(p_name, LegoJetskiRaceActor::ClassName()) || LegoCarRaceActor::IsA(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MxU32 VTable0x6c(
|
inline MxU32 CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
) override; // vtable+0x6c
|
) override; // vtable+0x6c
|
||||||
void Animate(float p_time) override; // vtable+0x70
|
void Animate(float p_time) override; // vtable+0x70
|
||||||
MxS32 VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edge) override; // vtable+0x1c
|
MxS32 VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edge) override; // vtable+0x1c
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ MxResult Act2Actor::HitActor(LegoPathActor*, MxBool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10018a20
|
// FUNCTION: LEGO1 0x10018a20
|
||||||
MxResult Act2Actor::VTable0x9c()
|
MxResult Act2Actor::CalculateSpline()
|
||||||
{
|
{
|
||||||
if (m_grec && !m_grec->HasPath()) {
|
if (m_grec && !m_grec->HasPath()) {
|
||||||
delete m_grec;
|
delete m_grec;
|
||||||
@@ -198,7 +198,7 @@ MxResult Act2Actor::VTable0x9c()
|
|||||||
brickstrROI->UpdateTransformationRelativeToParent(brickstrMatrix);
|
brickstrROI->UpdateTransformationRelativeToParent(brickstrMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
return LegoPathActor::VTable0x9c();
|
return LegoPathActor::CalculateSpline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +607,7 @@ MxU32 Act2Actor::UpdateShot(MxFloat p_time)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
LegoROI* brickstrROI = FindROI("brickstr");
|
LegoROI* brickstrROI = FindROI("brickstr");
|
||||||
|
|
||||||
MxMatrix initialTransform = m_roi->GetLocal2World();
|
MxMatrix initialTransform = m_roi->GetLocal2World();
|
||||||
|
|||||||
@@ -100,20 +100,20 @@ Act3Actor::Act3Actor()
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1003fb70
|
// FUNCTION: LEGO1 0x1003fb70
|
||||||
// FUNCTION: BETA10 0x100180ab
|
// FUNCTION: BETA10 0x100180ab
|
||||||
MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform)
|
MxU32 Act3Actor::StepState(float p_time, Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
// Note: Code duplication with LegoExtraActor::VTable0x90
|
// Note: Code duplication with LegoExtraActor::StepState
|
||||||
switch (m_actorState & c_maxState) {
|
switch (m_actorState & c_maxState) {
|
||||||
case c_initial:
|
case c_initial:
|
||||||
case c_one:
|
case c_ready:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case c_two:
|
case c_hit:
|
||||||
m_unk0x1c = p_time + 2000.0f;
|
m_unk0x1c = p_time + 2000.0f;
|
||||||
m_actorState = c_three;
|
m_actorState = c_hitAnimation;
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case c_three:
|
case c_hitAnimation:
|
||||||
assert(!m_userNavFlag);
|
assert(!m_userNavFlag);
|
||||||
Vector3 positionRef(p_transform[3]);
|
Vector3 positionRef(p_transform[3]);
|
||||||
|
|
||||||
@@ -127,10 +127,10 @@ MxU32 Act3Actor::VTable0x90(float p_time, Matrix4& p_transform)
|
|||||||
p_transform.RotateX(0.6);
|
p_transform.RotateX(0.6);
|
||||||
positionRef = position;
|
positionRef = position;
|
||||||
|
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
|
|
||||||
VTable0x74(p_transform);
|
ApplyTransform(p_transform);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -166,7 +166,7 @@ MxResult Act3Actor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
roi->SetLocal2World(local2world);
|
roi->SetLocal2World(local2world);
|
||||||
roi->WrappedUpdateWorldData();
|
roi->WrappedUpdateWorldData();
|
||||||
|
|
||||||
p_actor->SetActorState(c_two | c_noCollide);
|
p_actor->SetActorState(c_hit | c_noCollide);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
@@ -195,7 +195,7 @@ MxResult Act3Cop::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
|
|
||||||
assert(m_world);
|
assert(m_world);
|
||||||
((Act3*) m_world)->EatDonut(index);
|
((Act3*) m_world)->EatDonut(index);
|
||||||
m_unk0x20 = m_lastTime + 2000;
|
m_unk0x20 = m_transformTime + 2000;
|
||||||
SetWorldSpeed(6.0);
|
SetWorldSpeed(6.0);
|
||||||
|
|
||||||
assert(SoundManager()->GetCacheSoundManager());
|
assert(SoundManager()->GetCacheSoundManager());
|
||||||
@@ -284,7 +284,7 @@ void Act3Cop::Animate(float p_time)
|
|||||||
{
|
{
|
||||||
Act3Actor::Animate(p_time);
|
Act3Actor::Animate(p_time);
|
||||||
|
|
||||||
if (m_unk0x20 > 0.0f && m_unk0x20 < m_lastTime) {
|
if (m_unk0x20 > 0.0f && m_unk0x20 < m_transformTime) {
|
||||||
SetWorldSpeed(2.0f);
|
SetWorldSpeed(2.0f);
|
||||||
m_unk0x20 = -1.0f;
|
m_unk0x20 = -1.0f;
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
LegoPathEdgeContainer* grec = NULL;
|
LegoPathEdgeContainer* grec = NULL;
|
||||||
Act3* a3 = (Act3*) m_world;
|
Act3* a3 = (Act3*) m_world;
|
||||||
|
|
||||||
MxMatrix local74(m_unk0xec);
|
MxMatrix local74(m_local2World);
|
||||||
Vector3 local2c(local74[3]);
|
Vector3 local2c(local74[3]);
|
||||||
Vector3 local20(local74[2]);
|
Vector3 local20(local74[2]);
|
||||||
|
|
||||||
@@ -456,7 +456,7 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
vecUnk = m_grec->m_position;
|
vecUnk = m_grec->m_position;
|
||||||
m_boundary = m_grec->m_boundary;
|
m_boundary = m_grec->m_boundary;
|
||||||
|
|
||||||
m_grec->m_direction = m_unk0xec[3];
|
m_grec->m_direction = m_local2World[3];
|
||||||
m_grec->m_direction -= vecUnk;
|
m_grec->m_direction -= vecUnk;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -469,7 +469,7 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
|
|
||||||
local128 = *v2;
|
local128 = *v2;
|
||||||
local128 -= *v1;
|
local128 -= *v1;
|
||||||
local128 *= m_unk0xe4;
|
local128 *= m_destScale;
|
||||||
local128 += *v1;
|
local128 += *v1;
|
||||||
local128 *= -1.0f;
|
local128 *= -1.0f;
|
||||||
local128 += m_grec->m_position;
|
local128 += m_grec->m_position;
|
||||||
@@ -484,14 +484,14 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
|
|
||||||
vecUnk = *v2;
|
vecUnk = *v2;
|
||||||
vecUnk -= *v1;
|
vecUnk -= *v1;
|
||||||
vecUnk *= m_unk0xe4;
|
vecUnk *= m_destScale;
|
||||||
vecUnk += *v1;
|
vecUnk += *v1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 v1(m_unk0xec[0]);
|
Vector3 v1(m_local2World[0]);
|
||||||
Vector3 v2(m_unk0xec[1]);
|
Vector3 v2(m_local2World[1]);
|
||||||
Vector3 v3(m_unk0xec[2]);
|
Vector3 v3(m_local2World[2]);
|
||||||
Vector3 v4(m_unk0xec[3]);
|
Vector3 v4(m_local2World[3]);
|
||||||
|
|
||||||
v3 = v4;
|
v3 = v4;
|
||||||
v3 -= vecUnk;
|
v3 -= vecUnk;
|
||||||
@@ -500,7 +500,7 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
v1.Unitize();
|
v1.Unitize();
|
||||||
v2.EqualsCross(v3, v1);
|
v2.EqualsCross(v3, v1);
|
||||||
|
|
||||||
VTable0x9c();
|
CalculateSpline();
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
@@ -508,17 +508,17 @@ MxResult Act3Cop::FUN_10040360()
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10040d20
|
// FUNCTION: LEGO1 0x10040d20
|
||||||
// FUNCTION: BETA10 0x1001942c
|
// FUNCTION: BETA10 0x1001942c
|
||||||
MxResult Act3Cop::VTable0x9c()
|
MxResult Act3Cop::CalculateSpline()
|
||||||
{
|
{
|
||||||
if (m_grec && !m_grec->HasPath()) {
|
if (m_grec && !m_grec->HasPath()) {
|
||||||
delete m_grec;
|
delete m_grec;
|
||||||
m_grec = NULL;
|
m_grec = NULL;
|
||||||
m_lastTime = Timer()->GetTime();
|
m_transformTime = Timer()->GetTime();
|
||||||
FUN_10040360();
|
FUN_10040360();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Act3Actor::VTable0x9c();
|
return Act3Actor::CalculateSpline();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10040e10
|
// FUNCTION: LEGO1 0x10040e10
|
||||||
@@ -570,7 +570,7 @@ void Act3Brickster::ParseAction(char* p_extra)
|
|||||||
// FUNCTION: BETA10 0x100197d7
|
// FUNCTION: BETA10 0x100197d7
|
||||||
void Act3Brickster::Animate(float p_time)
|
void Act3Brickster::Animate(float p_time)
|
||||||
{
|
{
|
||||||
if (m_lastTime <= m_unk0x20 && m_unk0x20 <= p_time) {
|
if (m_transformTime <= m_unk0x20 && m_unk0x20 <= p_time) {
|
||||||
SetWorldSpeed(5.0f);
|
SetWorldSpeed(5.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -618,7 +618,7 @@ void Act3Brickster::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MxMatrix local70;
|
MxMatrix local70;
|
||||||
local70 = m_unk0xec;
|
local70 = m_local2World;
|
||||||
|
|
||||||
Vector3 local14(local70[0]);
|
Vector3 local14(local70[0]);
|
||||||
Vector3 local28(local70[1]);
|
Vector3 local28(local70[1]);
|
||||||
@@ -642,7 +642,7 @@ void Act3Brickster::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
assert(m_shootAnim && m_bInfo);
|
assert(m_shootAnim && m_bInfo);
|
||||||
@@ -663,7 +663,7 @@ void Act3Brickster::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MxMatrix locale4;
|
MxMatrix locale4;
|
||||||
locale4 = m_unk0xec;
|
locale4 = m_local2World;
|
||||||
|
|
||||||
Vector3 local88(locale4[0]);
|
Vector3 local88(locale4[0]);
|
||||||
Vector3 local9c(locale4[1]);
|
Vector3 local9c(locale4[1]);
|
||||||
@@ -689,7 +689,7 @@ void Act3Brickster::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
if (m_grec == NULL) {
|
if (m_grec == NULL) {
|
||||||
@@ -793,11 +793,11 @@ MxResult Act3Brickster::FUN_100417c0()
|
|||||||
LegoPathEdgeContainer* grec = NULL;
|
LegoPathEdgeContainer* grec = NULL;
|
||||||
Act3* a3 = (Act3*) m_world;
|
Act3* a3 = (Act3*) m_world;
|
||||||
|
|
||||||
MxMatrix local70(m_unk0xec);
|
MxMatrix local70(m_local2World);
|
||||||
Vector3 local28(local70[3]);
|
Vector3 local28(local70[3]);
|
||||||
Vector3 local20(local70[2]);
|
Vector3 local20(local70[2]);
|
||||||
|
|
||||||
if (m_unk0x58 < 8 && m_unk0x24 + 5000.0f < m_lastTime) {
|
if (m_unk0x58 < 8 && m_unk0x24 + 5000.0f < m_transformTime) {
|
||||||
float local18;
|
float local18;
|
||||||
|
|
||||||
for (MxS32 i = 0; i < MAX_PIZZAS; i++) {
|
for (MxS32 i = 0; i < MAX_PIZZAS; i++) {
|
||||||
@@ -950,7 +950,7 @@ MxResult Act3Brickster::FUN_100417c0()
|
|||||||
vecUnk = m_grec->m_position;
|
vecUnk = m_grec->m_position;
|
||||||
m_boundary = m_grec->m_boundary;
|
m_boundary = m_grec->m_boundary;
|
||||||
|
|
||||||
m_grec->m_direction = m_unk0xec[3];
|
m_grec->m_direction = m_local2World[3];
|
||||||
m_grec->m_direction -= vecUnk;
|
m_grec->m_direction -= vecUnk;
|
||||||
|
|
||||||
local150 = m_grec->m_direction;
|
local150 = m_grec->m_direction;
|
||||||
@@ -964,7 +964,7 @@ MxResult Act3Brickster::FUN_100417c0()
|
|||||||
|
|
||||||
local150 = *v2;
|
local150 = *v2;
|
||||||
local150 -= *v1;
|
local150 -= *v1;
|
||||||
local150 *= m_unk0xe4;
|
local150 *= m_destScale;
|
||||||
local150 += *v1;
|
local150 += *v1;
|
||||||
local150 *= -1.0f;
|
local150 *= -1.0f;
|
||||||
local150 += m_grec->m_position;
|
local150 += m_grec->m_position;
|
||||||
@@ -979,14 +979,14 @@ MxResult Act3Brickster::FUN_100417c0()
|
|||||||
|
|
||||||
vecUnk = *v2;
|
vecUnk = *v2;
|
||||||
vecUnk -= *v1;
|
vecUnk -= *v1;
|
||||||
vecUnk *= m_unk0xe4;
|
vecUnk *= m_destScale;
|
||||||
vecUnk += *v1;
|
vecUnk += *v1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 v1(m_unk0xec[0]);
|
Vector3 v1(m_local2World[0]);
|
||||||
Vector3 v2(m_unk0xec[1]);
|
Vector3 v2(m_local2World[1]);
|
||||||
Vector3 v3(m_unk0xec[2]);
|
Vector3 v3(m_local2World[2]);
|
||||||
Vector3 v4(m_unk0xec[3]);
|
Vector3 v4(m_local2World[3]);
|
||||||
|
|
||||||
v3 = v4;
|
v3 = v4;
|
||||||
v3 -= vecUnk;
|
v3 -= vecUnk;
|
||||||
@@ -995,7 +995,7 @@ MxResult Act3Brickster::FUN_100417c0()
|
|||||||
v1.Unitize();
|
v1.Unitize();
|
||||||
v2.EqualsCross(v3, v1);
|
v2.EqualsCross(v3, v1);
|
||||||
|
|
||||||
VTable0x9c();
|
CalculateSpline();
|
||||||
|
|
||||||
if (m_pInfo != NULL) {
|
if (m_pInfo != NULL) {
|
||||||
m_unk0x38 = 5;
|
m_unk0x38 = 5;
|
||||||
@@ -1098,10 +1098,10 @@ MxS32 Act3Brickster::FUN_10042300()
|
|||||||
m_destEdge = maxE;
|
m_destEdge = maxE;
|
||||||
|
|
||||||
if (m_boundary != boundaries[0]) {
|
if (m_boundary != boundaries[0]) {
|
||||||
m_unk0xe4 = 1.0 - m_unk0xe4;
|
m_destScale = 1.0 - m_destScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
VTable0x9c();
|
CalculateSpline();
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -1118,16 +1118,16 @@ void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEd
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x100429d0
|
// FUNCTION: LEGO1 0x100429d0
|
||||||
// FUNCTION: BETA10 0x1001b75b
|
// FUNCTION: BETA10 0x1001b75b
|
||||||
MxResult Act3Brickster::VTable0x9c()
|
MxResult Act3Brickster::CalculateSpline()
|
||||||
{
|
{
|
||||||
if (m_grec && !m_grec->HasPath()) {
|
if (m_grec && !m_grec->HasPath()) {
|
||||||
delete m_grec;
|
delete m_grec;
|
||||||
m_grec = NULL;
|
m_grec = NULL;
|
||||||
m_lastTime = Timer()->GetTime();
|
m_transformTime = Timer()->GetTime();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Act3Actor::VTable0x9c();
|
return Act3Actor::CalculateSpline();
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10042ab0
|
// FUNCTION: LEGO1 0x10042ab0
|
||||||
|
|||||||
@@ -166,9 +166,9 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, LegoPathBoundary* p_boundary,
|
|||||||
m_boundary = p_boundary;
|
m_boundary = p_boundary;
|
||||||
m_BADuration = 10000.0f;
|
m_BADuration = 10000.0f;
|
||||||
m_apexParameter = p_apexParameter;
|
m_apexParameter = p_apexParameter;
|
||||||
m_unk0x7c = 0.0f;
|
m_traveledDistance = 0.0f;
|
||||||
m_lastTime = -1.0f;
|
m_transformTime = -1.0f;
|
||||||
m_actorState = c_one;
|
m_actorState = c_ready;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,15 +193,15 @@ MxResult Act3Ammo::Shoot(LegoPathController* p_p, MxFloat p_apexParameter)
|
|||||||
m_pathController = p_p;
|
m_pathController = p_p;
|
||||||
m_BADuration = 10000.0f;
|
m_BADuration = 10000.0f;
|
||||||
m_apexParameter = p_apexParameter;
|
m_apexParameter = p_apexParameter;
|
||||||
m_unk0x7c = 0.0f;
|
m_traveledDistance = 0.0f;
|
||||||
m_lastTime = -1.0f;
|
m_transformTime = -1.0f;
|
||||||
m_actorState = c_one;
|
m_actorState = c_ready;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10053db0
|
// FUNCTION: LEGO1 0x10053db0
|
||||||
// FUNCTION: BETA10 0x1001e0f0
|
// FUNCTION: BETA10 0x1001e0f0
|
||||||
MxResult Act3Ammo::CalculateTransform(float p_curveParameter, Matrix4& p_transform)
|
MxResult Act3Ammo::CalculateTransformOnCurve(float p_curveParameter, Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
float curveParameterSquare = p_curveParameter * p_curveParameter;
|
float curveParameterSquare = p_curveParameter * p_curveParameter;
|
||||||
|
|
||||||
@@ -255,13 +255,13 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
|
|
||||||
switch (m_actorState & c_maxState) {
|
switch (m_actorState & c_maxState) {
|
||||||
case c_initial:
|
case c_initial:
|
||||||
case c_one:
|
case c_ready:
|
||||||
break;
|
break;
|
||||||
case c_two:
|
case c_hit:
|
||||||
m_rotateTimeout = p_time + 2000.0f;
|
m_rotateTimeout = p_time + 2000.0f;
|
||||||
m_actorState = c_three;
|
m_actorState = c_hitAnimation;
|
||||||
return;
|
return;
|
||||||
case c_three:
|
case c_hitAnimation:
|
||||||
MxMatrix transform;
|
MxMatrix transform;
|
||||||
Vector3 positionRef(transform[3]);
|
Vector3 positionRef(transform[3]);
|
||||||
|
|
||||||
@@ -293,15 +293,15 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_lastTime < 0.0f) {
|
if (m_transformTime < 0.0f) {
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
m_unk0x7c = 0.0f;
|
m_traveledDistance = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
MxMatrix transform;
|
MxMatrix transform;
|
||||||
MxMatrix additionalTransform;
|
MxMatrix additionalTransform;
|
||||||
|
|
||||||
float f = (m_BADuration - m_unk0x7c) / m_worldSpeed + m_lastTime;
|
float f = (m_BADuration - m_traveledDistance) / m_worldSpeed + m_transformTime;
|
||||||
|
|
||||||
undefined4 unused1 = 0;
|
undefined4 unused1 = 0;
|
||||||
undefined4 unused2 = 0;
|
undefined4 unused2 = 0;
|
||||||
@@ -309,19 +309,19 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
MxU32 reachedTarget = FALSE;
|
MxU32 reachedTarget = FALSE;
|
||||||
|
|
||||||
if (f >= p_time) {
|
if (f >= p_time) {
|
||||||
m_actorTime = (p_time - m_lastTime) * m_worldSpeed + m_actorTime;
|
m_actorTime = (p_time - m_transformTime) * m_worldSpeed + m_actorTime;
|
||||||
m_unk0x7c = (p_time - m_lastTime) * m_worldSpeed + m_unk0x7c;
|
m_traveledDistance = (p_time - m_transformTime) * m_worldSpeed + m_traveledDistance;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reachedTarget = TRUE;
|
reachedTarget = TRUE;
|
||||||
m_unk0x7c = m_BADuration;
|
m_traveledDistance = m_BADuration;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
transform.SetIdentity();
|
transform.SetIdentity();
|
||||||
|
|
||||||
MxResult r = CalculateTransform((m_unk0x7c / m_BADuration) * m_apexParameter, transform);
|
MxResult r = CalculateTransformOnCurve((m_traveledDistance / m_BADuration) * m_apexParameter, transform);
|
||||||
assert(r == 0); // SUCCESS
|
assert(r == 0); // SUCCESS
|
||||||
|
|
||||||
additionalTransform.SetIdentity();
|
additionalTransform.SetIdentity();
|
||||||
@@ -369,7 +369,7 @@ void Act3Ammo::Animate(float p_time)
|
|||||||
m_roi->SetLocal2World(transform);
|
m_roi->SetLocal2World(transform);
|
||||||
m_roi->WrappedUpdateWorldData();
|
m_roi->WrappedUpdateWorldData();
|
||||||
|
|
||||||
if (m_BADuration <= m_unk0x7c) {
|
if (m_BADuration <= m_traveledDistance) {
|
||||||
m_worldSpeed = 0.0f;
|
m_worldSpeed = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ DECOMP_SIZE_ASSERT(Bike, 0x164)
|
|||||||
Bike::Bike()
|
Bike::Bike()
|
||||||
{
|
{
|
||||||
m_maxLinearVel = 20.0;
|
m_maxLinearVel = 20.0;
|
||||||
m_unk0x150 = 3.0;
|
m_linearRotationRatio = 3.0;
|
||||||
m_unk0x148 = 1;
|
m_canRotate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100768f0
|
// FUNCTION: LEGO1 0x100768f0
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ MxLong Helicopter::HandleEndAnim(LegoEndAnimNotificationParam& p_param)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10003e90
|
// FUNCTION: LEGO1 0x10003e90
|
||||||
void Helicopter::VTable0x74(Matrix4& p_transform)
|
void Helicopter::ApplyTransform(Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_roi->UpdateTransformationRelativeToParent(p_transform);
|
m_roi->UpdateTransformationRelativeToParent(p_transform);
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ const char* g_varJSWNSHY5 = "c_jswnshy5";
|
|||||||
Jetski::Jetski()
|
Jetski::Jetski()
|
||||||
{
|
{
|
||||||
m_maxLinearVel = 25.0;
|
m_maxLinearVel = 25.0;
|
||||||
m_unk0x150 = 2.0;
|
m_linearRotationRatio = 2.0;
|
||||||
m_unk0x148 = 1;
|
m_canRotate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1007e630
|
// FUNCTION: LEGO1 0x1007e630
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ DECOMP_SIZE_ASSERT(Motocycle, 0x16c)
|
|||||||
Motocycle::Motocycle()
|
Motocycle::Motocycle()
|
||||||
{
|
{
|
||||||
m_maxLinearVel = 40.0;
|
m_maxLinearVel = 40.0;
|
||||||
m_unk0x150 = 1.75;
|
m_linearRotationRatio = 1.75;
|
||||||
m_unk0x148 = 1;
|
m_canRotate = 1;
|
||||||
m_fuel = 1.0;
|
m_fuel = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ SkateBoard::SkateBoard()
|
|||||||
{
|
{
|
||||||
m_pizzaVisible = FALSE;
|
m_pizzaVisible = FALSE;
|
||||||
m_maxLinearVel = 15.0;
|
m_maxLinearVel = 15.0;
|
||||||
m_unk0x150 = 3.5;
|
m_linearRotationRatio = 3.5;
|
||||||
m_unk0x148 = 1;
|
m_canRotate = 1;
|
||||||
|
|
||||||
NotificationManager()->Register(this);
|
NotificationManager()->Register(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ MxS32 g_legoAnimationManagerConfig = 1;
|
|||||||
float g_unk0x100f7500 = 0.1f;
|
float g_unk0x100f7500 = 0.1f;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f7504
|
// GLOBAL: LEGO1 0x100f7504
|
||||||
MxS32 g_unk0x100f7504 = 0;
|
MxS32 g_pathWalkingModeSelector = 0;
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1005eb50
|
// FUNCTION: LEGO1 0x1005eb50
|
||||||
void LegoAnimationManager::configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig)
|
void LegoAnimationManager::configureLegoAnimationManager(MxS32 p_legoAnimationManagerConfig)
|
||||||
@@ -1927,10 +1927,10 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i != m_numAllowedExtras) {
|
if (i != m_numAllowedExtras) {
|
||||||
MxU8 und = rand() % 2 != 0 ? 1 : 2;
|
MxU8 pathWalkingMode = rand() % 2 != 0 ? 1 : 2;
|
||||||
MxBool bool1, bool2;
|
MxBool bool1, bool2;
|
||||||
|
|
||||||
switch (g_unk0x100f7504 % 4) {
|
switch (g_pathWalkingModeSelector % 4) {
|
||||||
case 0:
|
case 0:
|
||||||
bool1 = FALSE;
|
bool1 = FALSE;
|
||||||
bool2 = FALSE;
|
bool2 = FALSE;
|
||||||
@@ -1948,7 +1948,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||||||
if (p_location < 0) {
|
if (p_location < 0) {
|
||||||
boundary = new LegoLocation::Boundary;
|
boundary = new LegoLocation::Boundary;
|
||||||
|
|
||||||
if (!FUN_10064120(boundary, und == 2, bool2)) {
|
if (!FUN_10064120(boundary, pathWalkingMode == 2, bool2)) {
|
||||||
delete boundary;
|
delete boundary;
|
||||||
boundary = NULL;
|
boundary = NULL;
|
||||||
}
|
}
|
||||||
@@ -2002,19 +2002,19 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||||||
g_characters[m_lastExtraCharacterId].m_name
|
g_characters[m_lastExtraCharacterId].m_name
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (g_unk0x100f7504++ % 4) {
|
switch (g_pathWalkingModeSelector++ % 4) {
|
||||||
case 0:
|
case 0:
|
||||||
actor->SetUnknown0x0c(und != 1 ? 1 : 2);
|
actor->SetPathWalkingMode(pathWalkingMode != 1 ? 1 : 2);
|
||||||
break;
|
break;
|
||||||
case 1: {
|
case 1: {
|
||||||
actor->SetUnknown0x0c(und);
|
actor->SetPathWalkingMode(pathWalkingMode);
|
||||||
MxS32 src = boundary->m_src;
|
MxS32 src = boundary->m_src;
|
||||||
boundary->m_src = boundary->m_dest;
|
boundary->m_src = boundary->m_dest;
|
||||||
boundary->m_dest = src;
|
boundary->m_dest = src;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
actor->SetUnknown0x0c(und);
|
actor->SetPathWalkingMode(pathWalkingMode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2184,21 +2184,21 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p
|
|||||||
MxResult result = 1; // Not a valid MxResult value
|
MxResult result = 1; // Not a valid MxResult value
|
||||||
|
|
||||||
if (!local24) {
|
if (!local24) {
|
||||||
MxU8 unk0x0c;
|
MxU8 pathWalkingMode;
|
||||||
|
|
||||||
switch (rand() % 3) {
|
switch (rand() % 3) {
|
||||||
case 0:
|
case 0:
|
||||||
unk0x0c = 1;
|
pathWalkingMode = 1;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
unk0x0c = 2;
|
pathWalkingMode = 2;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
unk0x0c = 0;
|
pathWalkingMode = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
actor->SetUnknown0x0c(unk0x0c);
|
actor->SetPathWalkingMode(pathWalkingMode);
|
||||||
|
|
||||||
Mx3DPointFloat position;
|
Mx3DPointFloat position;
|
||||||
Mx3DPointFloat direction;
|
Mx3DPointFloat direction;
|
||||||
@@ -2695,8 +2695,8 @@ MxResult LegoAnimationManager::FUN_10064380(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
MxU8 unk0x0c = rand() % 2 != 0 ? 1 : 2;
|
MxU8 pathWalkingMode = rand() % 2 != 0 ? 1 : 2;
|
||||||
actor->SetUnknown0x0c(unk0x0c);
|
actor->SetPathWalkingMode(pathWalkingMode);
|
||||||
actor->SetWorldSpeed(0.0f);
|
actor->SetWorldSpeed(0.0f);
|
||||||
|
|
||||||
if (world->PlaceActor(actor, p_boundaryName, p_src, p_srcScale, p_dest, p_destScale) != SUCCESS) {
|
if (world->PlaceActor(actor, p_boundaryName, p_src, p_srcScale, p_dest, p_destScale) != SUCCESS) {
|
||||||
|
|||||||
@@ -471,10 +471,10 @@ MxBool LegoAnimMMPresenter::FUN_1004b6d0(MxLong p_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BETA10
|
#ifdef BETA10
|
||||||
actor->VTable0xa8();
|
actor->ApplyLocal2World();
|
||||||
#else
|
#else
|
||||||
if (m_tranInfo->m_unk0x29) {
|
if (m_tranInfo->m_unk0x29) {
|
||||||
actor->VTable0xa8();
|
actor->ApplyLocal2World();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ MxResult LegoAnimActor::GetTimeInCycle(float& p_timeInCycle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1001c240
|
// FUNCTION: LEGO1 0x1001c240
|
||||||
void LegoAnimActor::VTable0x74(Matrix4& p_transform)
|
void LegoAnimActor::ApplyTransform(Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
float timeInCycle;
|
float timeInCycle;
|
||||||
LegoPathActor::VTable0x74(p_transform);
|
LegoPathActor::ApplyTransform(p_transform);
|
||||||
|
|
||||||
if (m_curAnim >= 0) {
|
if (m_curAnim >= 0) {
|
||||||
GetTimeInCycle(timeInCycle);
|
GetTimeInCycle(timeInCycle);
|
||||||
@@ -80,19 +80,19 @@ void LegoAnimActor::Animate(float p_time)
|
|||||||
{
|
{
|
||||||
assert(m_roi);
|
assert(m_roi);
|
||||||
|
|
||||||
if (m_lastTime == 0) {
|
if (m_transformTime == 0) {
|
||||||
m_lastTime = p_time - 1.0f;
|
m_transformTime = p_time - 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_actorState == c_initial && !m_userNavFlag && m_worldSpeed <= 0) {
|
if (m_actorState == c_initial && !m_userNavFlag && m_worldSpeed <= 0) {
|
||||||
if (m_curAnim >= 0) {
|
if (m_curAnim >= 0) {
|
||||||
MxMatrix transform(m_unk0xec);
|
MxMatrix transform(m_local2World);
|
||||||
float timeInCycle;
|
float timeInCycle;
|
||||||
GetTimeInCycle(timeInCycle);
|
GetTimeInCycle(timeInCycle);
|
||||||
AnimateWithTransform(timeInCycle, transform);
|
AnimateWithTransform(timeInCycle, transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastTime = m_actorTime = p_time;
|
m_transformTime = m_actorTime = p_time;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LegoPathActor::Animate(p_time);
|
LegoPathActor::Animate(p_time);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ LegoExtraActor::LegoExtraActor()
|
|||||||
{
|
{
|
||||||
m_lastPathStruct = 0.0f;
|
m_lastPathStruct = 0.0f;
|
||||||
m_scheduledTime = 0;
|
m_scheduledTime = 0;
|
||||||
m_unk0x0c = 0;
|
m_pathWalkingMode = 0;
|
||||||
m_animationAtCurrentBoundary = FALSE;
|
m_animationAtCurrentBoundary = FALSE;
|
||||||
m_reassemblyAnimation = e_none;
|
m_reassemblyAnimation = e_none;
|
||||||
m_assAnim = NULL;
|
m_assAnim = NULL;
|
||||||
@@ -48,19 +48,19 @@ LegoExtraActor::~LegoExtraActor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002a720
|
// FUNCTION: LEGO1 0x1002a720
|
||||||
MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
|
MxU32 LegoExtraActor::StepState(float p_time, Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
switch (m_actorState & c_maxState) {
|
switch (m_actorState & c_maxState) {
|
||||||
case c_initial:
|
case c_initial:
|
||||||
case c_one:
|
case c_ready:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case c_two:
|
case c_hit:
|
||||||
m_scheduledTime = p_time + 2000.0f;
|
m_scheduledTime = p_time + 2000.0f;
|
||||||
m_actorState = c_three;
|
m_actorState = c_hitAnimation;
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case c_three: {
|
case c_hitAnimation: {
|
||||||
Vector3 positionRef(p_transform[3]);
|
Vector3 positionRef(p_transform[3]);
|
||||||
p_transform = m_roi->GetLocal2World();
|
p_transform = m_roi->GetLocal2World();
|
||||||
|
|
||||||
@@ -89,9 +89,9 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
|
|||||||
}
|
}
|
||||||
|
|
||||||
positionRef = position;
|
positionRef = position;
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
VTable0x74(p_transform);
|
ApplyTransform(p_transform);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -109,20 +109,20 @@ MxU32 LegoExtraActor::VTable0x90(float p_time, Matrix4& p_transform)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002aa90
|
// FUNCTION: LEGO1 0x1002aa90
|
||||||
void LegoExtraActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
|
void LegoExtraActor::GetWalkingBehavior(MxBool& p_countCounterclockWise, MxS32& p_selectedEdgeIndex)
|
||||||
{
|
{
|
||||||
switch (m_unk0x0c) {
|
switch (m_pathWalkingMode) {
|
||||||
case 1:
|
case 1:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = 1;
|
p_selectedEdgeIndex = 1;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
p_und1 = FALSE;
|
p_countCounterclockWise = FALSE;
|
||||||
p_und2 = 1;
|
p_selectedEdgeIndex = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = rand() % p_und2 + 1;
|
p_selectedEdgeIndex = rand() % p_selectedEdgeIndex + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,10 +131,10 @@ void LegoExtraActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
|
|||||||
MxResult LegoExtraActor::SwitchDirection()
|
MxResult LegoExtraActor::SwitchDirection()
|
||||||
{
|
{
|
||||||
LegoPathBoundary* oldEdge = m_boundary;
|
LegoPathBoundary* oldEdge = m_boundary;
|
||||||
Vector3 rightRef(m_unk0xec[0]);
|
Vector3 rightRef(m_local2World[0]);
|
||||||
Vector3 upRef(m_unk0xec[1]);
|
Vector3 upRef(m_local2World[1]);
|
||||||
Vector3 dirRef(m_unk0xec[2]);
|
Vector3 dirRef(m_local2World[2]);
|
||||||
Vector3 positionRef(m_unk0xec[3]);
|
Vector3 positionRef(m_local2World[3]);
|
||||||
|
|
||||||
dirRef *= -1.0f;
|
dirRef *= -1.0f;
|
||||||
rightRef.EqualsCross(upRef, dirRef);
|
rightRef.EqualsCross(upRef, dirRef);
|
||||||
@@ -150,7 +150,7 @@ MxResult LegoExtraActor::SwitchDirection()
|
|||||||
m_boundary = oldEdge;
|
m_boundary = oldEdge;
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoPathActor::VTable0x9c();
|
LegoPathActor::CalculateSpline();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
VTable0xc4();
|
VTable0xc4();
|
||||||
SetWorldSpeed(0);
|
SetWorldSpeed(0);
|
||||||
m_reassemblyAnimation = e_disassemble;
|
m_reassemblyAnimation = e_disassemble;
|
||||||
SetActorState(c_one | c_noCollide);
|
SetActorState(c_ready | c_noCollide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
assert(roi);
|
assert(roi);
|
||||||
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
SoundManager()->GetCacheSoundManager()->Play("crash5", m_roi->GetName(), FALSE);
|
||||||
VTable0xc4();
|
VTable0xc4();
|
||||||
SetActorState(c_two | c_noCollide);
|
SetActorState(c_hit | c_noCollide);
|
||||||
Mx3DPointFloat dir = p_actor->GetWorldDirection();
|
Mx3DPointFloat dir = p_actor->GetWorldDirection();
|
||||||
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
|
MxMatrix matrix3 = MxMatrix(roi->GetLocal2World());
|
||||||
Vector3 positionRef(matrix3[3]);
|
Vector3 positionRef(matrix3[3]);
|
||||||
@@ -272,10 +272,10 @@ MxResult LegoExtraActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002b290
|
// FUNCTION: LEGO1 0x1002b290
|
||||||
MxResult LegoExtraActor::VTable0x9c()
|
MxResult LegoExtraActor::CalculateSpline()
|
||||||
{
|
{
|
||||||
LegoPathBoundary* oldBoundary = m_boundary;
|
LegoPathBoundary* oldBoundary = m_boundary;
|
||||||
MxResult result = LegoPathActor::VTable0x9c();
|
MxResult result = LegoPathActor::CalculateSpline();
|
||||||
|
|
||||||
if (m_boundary != oldBoundary) {
|
if (m_boundary != oldBoundary) {
|
||||||
MxU32 foundAnimation = FALSE;
|
MxU32 foundAnimation = FALSE;
|
||||||
@@ -333,7 +333,7 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
case e_disassemble:
|
case e_disassemble:
|
||||||
if (m_scheduledTime < p_time) {
|
if (m_scheduledTime < p_time) {
|
||||||
m_reassemblyAnimation = e_assemble;
|
m_reassemblyAnimation = e_assemble;
|
||||||
m_actorState = c_one | c_noCollide;
|
m_actorState = c_ready | c_noCollide;
|
||||||
m_scheduledTime = m_assAnim->GetDuration() + p_time;
|
m_scheduledTime = m_assAnim->GetDuration() + p_time;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -347,7 +347,7 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
m_actorState = c_initial;
|
m_actorState = c_initial;
|
||||||
SetWorldSpeed(m_prevWorldSpeed);
|
SetWorldSpeed(m_prevWorldSpeed);
|
||||||
m_roi->SetLocal2World(m_localBeforeHit);
|
m_roi->SetLocal2World(m_localBeforeHit);
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -379,10 +379,10 @@ void LegoExtraActor::Animate(float p_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002b5d0
|
// FUNCTION: LEGO1 0x1002b5d0
|
||||||
void LegoExtraActor::VTable0x74(Matrix4& p_transform)
|
void LegoExtraActor::ApplyTransform(Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
if (m_reassemblyAnimation == e_none) {
|
if (m_reassemblyAnimation == e_none) {
|
||||||
LegoAnimActor::VTable0x74(p_transform);
|
LegoAnimActor::ApplyTransform(p_transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,32 +409,32 @@ void LegoExtraActor::VTable0xc4()
|
|||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
float duration = m_animMaps[m_curAnim]->GetDuration();
|
float duration = m_animMaps[m_curAnim]->GetDuration();
|
||||||
MxMatrix matrix(m_unk0xec);
|
MxMatrix matrix(m_local2World);
|
||||||
LegoAnimActor::AnimateWithTransform(duration, matrix);
|
LegoAnimActor::AnimateWithTransform(duration, matrix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002b6f0
|
// FUNCTION: LEGO1 0x1002b6f0
|
||||||
MxS32 LegoExtraActor::VTable0x68(Vector3& p_point1, Vector3& p_point2, Vector3& p_point3)
|
MxS32 LegoExtraActor::CheckIntersections(Vector3& p_rayOrigin, Vector3& p_rayEnd, Vector3& p_intersectionPoint)
|
||||||
{
|
{
|
||||||
return LegoPathActor::VTable0x68(p_point1, p_point2, p_point3);
|
return LegoPathActor::CheckIntersections(p_rayOrigin, p_rayEnd, p_intersectionPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002b980
|
// FUNCTION: LEGO1 0x1002b980
|
||||||
inline MxU32 LegoExtraActor::VTable0x6c(
|
inline MxU32 LegoExtraActor::CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
||||||
if ((*itap)->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3)) {
|
if ((*itap)->Intersect(p_rayOrigin, p_rayDirection, p_rayLength, p_radius, p_intersectionPoint)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -453,11 +453,11 @@ inline MxU32 LegoExtraActor::VTable0x6c(
|
|||||||
if (actor->GetUserNavFlag()) {
|
if (actor->GetUserNavFlag()) {
|
||||||
MxMatrix local2world = roi->GetLocal2World();
|
MxMatrix local2world = roi->GetLocal2World();
|
||||||
Vector3 local60(local2world[3]);
|
Vector3 local60(local2world[3]);
|
||||||
Mx3DPointFloat local54(p_v1);
|
Mx3DPointFloat local54(p_rayOrigin);
|
||||||
|
|
||||||
local54 -= local60;
|
local54 -= local60;
|
||||||
float local1c = p_v2.Dot(p_v2, p_v2);
|
float local1c = p_rayDirection.Dot(p_rayDirection, p_rayDirection);
|
||||||
float local24 = p_v2.Dot(p_v2, local54) * 2.0f;
|
float local24 = p_rayDirection.Dot(p_rayDirection, local54) * 2.0f;
|
||||||
float local20 = local54.Dot(local54, local54);
|
float local20 = local54.Dot(local54, local54);
|
||||||
|
|
||||||
if (m_hitBlockCounter != 0 && local20 < 10.0f) {
|
if (m_hitBlockCounter != 0 && local20 < 10.0f) {
|
||||||
@@ -487,9 +487,10 @@ inline MxU32 LegoExtraActor::VTable0x6c(
|
|||||||
local1cX = local40;
|
local1cX = local40;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((local20X >= 0.0f && local20X <= p_f1) || (local1cX >= 0.0f && local1cX <= p_f1) ||
|
if ((local20X >= 0.0f && local20X <= p_rayLength) ||
|
||||||
(local20X <= -0.01 && p_f1 + 0.01 <= local1cX)) {
|
(local1cX >= 0.0f && local1cX <= p_rayLength) ||
|
||||||
p_v3 = p_v1;
|
(local20X <= -0.01 && p_rayLength + 0.01 <= local1cX)) {
|
||||||
|
p_intersectionPoint = p_rayOrigin;
|
||||||
|
|
||||||
if (HitActor(actor, TRUE) < 0) {
|
if (HitActor(actor, TRUE) < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -502,7 +503,14 @@ inline MxU32 LegoExtraActor::VTable0x6c(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (roi->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
if (roi->Intersect(
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
if (HitActor(actor, TRUE) < 0) {
|
if (HitActor(actor, TRUE) < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,18 +44,18 @@ LegoPathActor::LegoPathActor()
|
|||||||
{
|
{
|
||||||
m_boundary = NULL;
|
m_boundary = NULL;
|
||||||
m_actorTime = 0;
|
m_actorTime = 0;
|
||||||
m_lastTime = 0;
|
m_transformTime = 0;
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
m_userNavFlag = FALSE;
|
m_userNavFlag = FALSE;
|
||||||
m_actorState = c_initial;
|
m_actorState = c_initial;
|
||||||
m_grec = NULL;
|
m_grec = NULL;
|
||||||
m_pathController = NULL;
|
m_pathController = NULL;
|
||||||
m_collideBox = FALSE;
|
m_collideBox = FALSE;
|
||||||
m_unk0x148 = 0;
|
m_canRotate = 0;
|
||||||
m_unk0x14c = 0;
|
m_lastRotationAngle = 0;
|
||||||
m_unk0x140 = 0.0099999999f;
|
m_wallHitDirectionFactor = 0.0099999999f;
|
||||||
m_unk0x144 = 0.8f;
|
m_wallHitDampening = 0.8f;
|
||||||
m_unk0x150 = 2.0f;
|
m_linearRotationRatio = 2.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002d820
|
// FUNCTION: LEGO1 0x1002d820
|
||||||
@@ -69,19 +69,24 @@ LegoPathActor::~LegoPathActor()
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002d8d0
|
// FUNCTION: LEGO1 0x1002d8d0
|
||||||
// FUNCTION: BETA10 0x100ae8cd
|
// FUNCTION: BETA10 0x100ae8cd
|
||||||
MxResult LegoPathActor::VTable0x80(const Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, Vector3& p_point4)
|
MxResult LegoPathActor::SetSpline(
|
||||||
|
const Vector3& p_start,
|
||||||
|
Vector3& p_tangentAtStart,
|
||||||
|
Vector3& p_end,
|
||||||
|
Vector3& p_tangentAtEnd
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Mx3DPointFloat p1, p2, p3;
|
Mx3DPointFloat length, tangentAtStart, tangentAtEnd;
|
||||||
|
|
||||||
p1 = p_point3;
|
length = p_end;
|
||||||
p1 -= p_point1;
|
length -= p_start;
|
||||||
m_BADuration = p1.LenSquared();
|
m_BADuration = length.LenSquared();
|
||||||
|
|
||||||
if (m_BADuration > 0.0f) {
|
if (m_BADuration > 0.0f) {
|
||||||
m_BADuration = sqrtf(m_BADuration);
|
m_BADuration = sqrtf(m_BADuration);
|
||||||
p2 = p_point2;
|
tangentAtStart = p_tangentAtStart;
|
||||||
p3 = p_point4;
|
tangentAtEnd = p_tangentAtEnd;
|
||||||
m_spline.SetSpline(p_point1, p2, p_point3, p3);
|
m_spline.SetSpline(p_start, tangentAtStart, p_end, tangentAtEnd);
|
||||||
m_BADuration /= 0.001;
|
m_BADuration /= 0.001;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -93,7 +98,7 @@ MxResult LegoPathActor::VTable0x80(const Vector3& p_point1, Vector3& p_point2, V
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002d9c0
|
// FUNCTION: LEGO1 0x1002d9c0
|
||||||
// FUNCTION: BETA10 0x100ae9da
|
// FUNCTION: BETA10 0x100ae9da
|
||||||
MxResult LegoPathActor::VTable0x88(
|
MxResult LegoPathActor::SetTransformAndDestinationFromEdge(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
float p_time,
|
float p_time,
|
||||||
LegoEdge& p_srcEdge,
|
LegoEdge& p_srcEdge,
|
||||||
@@ -107,29 +112,29 @@ MxResult LegoPathActor::VTable0x88(
|
|||||||
Vector3* v3 = p_destEdge.CWVertex(*p_boundary);
|
Vector3* v3 = p_destEdge.CWVertex(*p_boundary);
|
||||||
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
|
Vector3* v4 = p_destEdge.CCWVertex(*p_boundary);
|
||||||
|
|
||||||
Mx3DPointFloat p1, p2, p3, p4, p5;
|
Mx3DPointFloat start, end, destNormal, startDirection, endDirection;
|
||||||
|
|
||||||
p1 = *v2;
|
start = *v2;
|
||||||
p1 -= *v1;
|
start -= *v1;
|
||||||
p1 *= p_srcScale;
|
start *= p_srcScale;
|
||||||
p1 += *v1;
|
start += *v1;
|
||||||
|
|
||||||
p2 = *v4;
|
end = *v4;
|
||||||
p2 -= *v3;
|
end -= *v3;
|
||||||
p2 *= p_destScale;
|
end *= p_destScale;
|
||||||
p2 += *v3;
|
end += *v3;
|
||||||
|
|
||||||
m_boundary = p_boundary;
|
m_boundary = p_boundary;
|
||||||
m_destEdge = &p_destEdge;
|
m_destEdge = &p_destEdge;
|
||||||
m_unk0xe4 = p_destScale;
|
m_destScale = p_destScale;
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
m_actorTime = p_time;
|
m_actorTime = p_time;
|
||||||
p_destEdge.GetFaceNormal(*p_boundary, p3);
|
p_destEdge.GetFaceNormal(*p_boundary, destNormal);
|
||||||
|
|
||||||
p4 = p2;
|
startDirection = end;
|
||||||
p4 -= p1;
|
startDirection -= start;
|
||||||
p4.Unitize();
|
startDirection.Unitize();
|
||||||
|
|
||||||
MxMatrix matrix;
|
MxMatrix matrix;
|
||||||
Vector3 pos(matrix[3]);
|
Vector3 pos(matrix[3]);
|
||||||
@@ -138,8 +143,8 @@ MxResult LegoPathActor::VTable0x88(
|
|||||||
Vector3 right(matrix[0]);
|
Vector3 right(matrix[0]);
|
||||||
|
|
||||||
matrix.SetIdentity();
|
matrix.SetIdentity();
|
||||||
pos = p1;
|
pos = start;
|
||||||
dir = p4;
|
dir = startDirection;
|
||||||
up = *m_boundary->GetUp();
|
up = *m_boundary->GetUp();
|
||||||
|
|
||||||
if (!m_cameraFlag || !m_userNavFlag) {
|
if (!m_cameraFlag || !m_userNavFlag) {
|
||||||
@@ -150,10 +155,10 @@ MxResult LegoPathActor::VTable0x88(
|
|||||||
m_roi->UpdateTransformationRelativeToParent(matrix);
|
m_roi->UpdateTransformationRelativeToParent(matrix);
|
||||||
|
|
||||||
if (!m_cameraFlag || !m_userNavFlag) {
|
if (!m_cameraFlag || !m_userNavFlag) {
|
||||||
p5.EqualsCross(*p_boundary->GetUp(), p3);
|
endDirection.EqualsCross(*p_boundary->GetUp(), destNormal);
|
||||||
p5.Unitize();
|
endDirection.Unitize();
|
||||||
|
|
||||||
if (VTable0x80(p1, p4, p2, p5) == SUCCESS) {
|
if (SetSpline(start, startDirection, end, endDirection) == SUCCESS) {
|
||||||
m_boundary->AddActor(this);
|
m_boundary->AddActor(this);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -165,17 +170,17 @@ MxResult LegoPathActor::VTable0x88(
|
|||||||
TransformPointOfView();
|
TransformPointOfView();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0xec = m_roi->GetLocal2World();
|
m_local2World = m_roi->GetLocal2World();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002de10
|
// FUNCTION: LEGO1 0x1002de10
|
||||||
// FUNCTION: BETA10 0x100aee61
|
// FUNCTION: BETA10 0x100aee61
|
||||||
MxResult LegoPathActor::VTable0x84(
|
MxResult LegoPathActor::SetTransformAndDestinationFromPoints(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
float p_time,
|
float p_time,
|
||||||
Vector3& p_p1,
|
Vector3& p_start,
|
||||||
Vector3& p_p4,
|
Vector3& p_direction,
|
||||||
LegoOrientedEdge* p_destEdge,
|
LegoOrientedEdge* p_destEdge,
|
||||||
float p_destScale
|
float p_destScale
|
||||||
)
|
)
|
||||||
@@ -187,20 +192,20 @@ MxResult LegoPathActor::VTable0x84(
|
|||||||
|
|
||||||
assert(v3 && v4);
|
assert(v3 && v4);
|
||||||
|
|
||||||
Mx3DPointFloat p2, p3, p5;
|
Mx3DPointFloat end, destNormal, endDirection;
|
||||||
|
|
||||||
p2 = *v4;
|
end = *v4;
|
||||||
p2 -= *v3;
|
end -= *v3;
|
||||||
p2 *= p_destScale;
|
end *= p_destScale;
|
||||||
p2 += *v3;
|
end += *v3;
|
||||||
|
|
||||||
m_boundary = p_boundary;
|
m_boundary = p_boundary;
|
||||||
m_destEdge = p_destEdge;
|
m_destEdge = p_destEdge;
|
||||||
m_unk0xe4 = p_destScale;
|
m_destScale = p_destScale;
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
m_actorTime = p_time;
|
m_actorTime = p_time;
|
||||||
p_destEdge->GetFaceNormal(*p_boundary, p3);
|
p_destEdge->GetFaceNormal(*p_boundary, destNormal);
|
||||||
|
|
||||||
MxMatrix matrix;
|
MxMatrix matrix;
|
||||||
Vector3 pos(matrix[3]);
|
Vector3 pos(matrix[3]);
|
||||||
@@ -209,8 +214,8 @@ MxResult LegoPathActor::VTable0x84(
|
|||||||
Vector3 right(matrix[0]);
|
Vector3 right(matrix[0]);
|
||||||
|
|
||||||
matrix.SetIdentity();
|
matrix.SetIdentity();
|
||||||
pos = p_p1;
|
pos = p_start;
|
||||||
dir = p_p4;
|
dir = p_direction;
|
||||||
up = *m_boundary->GetUp();
|
up = *m_boundary->GetUp();
|
||||||
|
|
||||||
if (!m_cameraFlag || !m_userNavFlag) {
|
if (!m_cameraFlag || !m_userNavFlag) {
|
||||||
@@ -225,10 +230,10 @@ MxResult LegoPathActor::VTable0x84(
|
|||||||
TransformPointOfView();
|
TransformPointOfView();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p5.EqualsCross(*p_boundary->GetUp(), p3);
|
endDirection.EqualsCross(*p_boundary->GetUp(), destNormal);
|
||||||
p5.Unitize();
|
endDirection.Unitize();
|
||||||
|
|
||||||
if (VTable0x80(p_p1, p_p4, p2, p5) != SUCCESS) {
|
if (SetSpline(p_start, p_direction, end, endDirection) != SUCCESS) {
|
||||||
MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName());
|
MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName());
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
@@ -236,57 +241,59 @@ MxResult LegoPathActor::VTable0x84(
|
|||||||
m_boundary->AddActor(this);
|
m_boundary->AddActor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0xec = m_roi->GetLocal2World();
|
m_local2World = m_roi->GetLocal2World();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e100
|
// FUNCTION: LEGO1 0x1002e100
|
||||||
// FUNCTION: BETA10 0x100b0520
|
// FUNCTION: BETA10 0x100b0520
|
||||||
MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
MxS32 LegoPathActor::CalculateTransform(float p_time, Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
if (m_userNavFlag && m_actorState == c_initial) {
|
if (m_userNavFlag && m_actorState == c_initial) {
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
|
|
||||||
Mx3DPointFloat p1, p2, p3, p4, p5;
|
Mx3DPointFloat newDir, newPos, intersectionPoint, pos, dir;
|
||||||
p5 = Vector3(m_roi->GetWorldDirection());
|
dir = Vector3(m_roi->GetWorldDirection());
|
||||||
p4 = Vector3(m_roi->GetWorldPosition());
|
pos = Vector3(m_roi->GetWorldPosition());
|
||||||
|
|
||||||
LegoNavController* nav = NavController();
|
LegoNavController* nav = NavController();
|
||||||
assert(nav);
|
assert(nav);
|
||||||
|
|
||||||
m_worldSpeed = nav->GetLinearVel();
|
m_worldSpeed = nav->GetLinearVel();
|
||||||
|
|
||||||
if (nav->CalculateNewPosDir(p4, p5, p2, p1, m_boundary->GetUp())) {
|
if (nav->CalculateNewPosDir(pos, dir, newPos, newDir, m_boundary->GetUp())) {
|
||||||
Mx3DPointFloat p6;
|
Mx3DPointFloat newPosCopy;
|
||||||
p6 = p2;
|
newPosCopy = newPos;
|
||||||
MxS32 result = 0;
|
MxS32 result = 0;
|
||||||
|
|
||||||
m_unk0xe9 = m_boundary->Intersect(m_roi->GetWorldBoundingSphere().Radius(), p4, p2, p3, m_destEdge);
|
m_finishedTravel =
|
||||||
if (m_unk0xe9 == -1) {
|
m_boundary
|
||||||
|
->Intersect(m_roi->GetWorldBoundingSphere().Radius(), pos, newPos, intersectionPoint, m_destEdge);
|
||||||
|
if (m_finishedTravel == -1) {
|
||||||
MxTrace("Intersect returned -1\n");
|
MxTrace("Intersect returned -1\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_finishedTravel != FALSE) {
|
||||||
p2 = p3;
|
newPos = intersectionPoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result = VTable0x68(p4, p2, p3);
|
result = CheckIntersections(pos, newPos, intersectionPoint);
|
||||||
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
p2 = p4;
|
newPos = pos;
|
||||||
m_unk0xe9 = 0;
|
m_finishedTravel = FALSE;
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_boundary->CheckAndCallPathTriggers(p4, p2, this);
|
m_boundary->CheckAndCallPathTriggers(pos, newPos, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoPathBoundary* oldBoundary = m_boundary;
|
LegoPathBoundary* oldBoundary = m_boundary;
|
||||||
|
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_finishedTravel != FALSE) {
|
||||||
VTable0x9c();
|
CalculateSpline();
|
||||||
|
|
||||||
if (m_boundary == oldBoundary) {
|
if (m_boundary == oldBoundary) {
|
||||||
MxLong time = Timer()->GetTime();
|
MxLong time = Timer()->GetTime();
|
||||||
@@ -300,15 +307,15 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_worldSpeed *= m_unk0x144;
|
m_worldSpeed *= m_wallHitDampening;
|
||||||
nav->SetLinearVel(m_worldSpeed);
|
nav->SetLinearVel(m_worldSpeed);
|
||||||
Mx3DPointFloat p7(p2);
|
Mx3DPointFloat newPosDelta(newPos);
|
||||||
p7 -= p6;
|
newPosDelta -= newPosCopy;
|
||||||
|
|
||||||
if (p7.Unitize() == 0) {
|
if (newPosDelta.Unitize() == 0) {
|
||||||
float f = sqrt(p1.LenSquared()) * m_unk0x140;
|
float f = sqrt(newDir.LenSquared()) * m_wallHitDirectionFactor;
|
||||||
p7 *= f;
|
newPosDelta *= f;
|
||||||
p1 += p7;
|
newDir += newPosDelta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -320,7 +327,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
Vector3 dir(p_transform[2]);
|
Vector3 dir(p_transform[2]);
|
||||||
Vector3 pos(p_transform[3]);
|
Vector3 pos(p_transform[3]);
|
||||||
|
|
||||||
dir = p1;
|
dir = newDir;
|
||||||
up = *m_boundary->GetUp();
|
up = *m_boundary->GetUp();
|
||||||
right.EqualsCross(up, dir);
|
right.EqualsCross(up, dir);
|
||||||
|
|
||||||
@@ -328,7 +335,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
assert(res == 0);
|
assert(res == 0);
|
||||||
|
|
||||||
dir.EqualsCross(right, up);
|
dir.EqualsCross(right, up);
|
||||||
pos = p2;
|
pos = newPos;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -336,47 +343,47 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p_time >= 0 && m_worldSpeed > 0) {
|
else if (p_time >= 0 && m_worldSpeed > 0) {
|
||||||
float f = (m_BADuration - m_unk0x7c) / m_worldSpeed + m_lastTime;
|
float endTime = (m_BADuration - m_traveledDistance) / m_worldSpeed + m_transformTime;
|
||||||
|
|
||||||
if (f < p_time) {
|
if (endTime < p_time) {
|
||||||
m_unk0x7c = m_BADuration;
|
m_traveledDistance = m_BADuration;
|
||||||
m_unk0xe9 = 1;
|
m_finishedTravel = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
f = p_time;
|
endTime = p_time;
|
||||||
m_unk0x7c += (f - m_lastTime) * m_worldSpeed;
|
m_traveledDistance += (endTime - m_transformTime) * m_worldSpeed;
|
||||||
m_unk0xe9 = 0;
|
m_finishedTravel = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_actorTime += (f - m_lastTime) * m_worldSpeed;
|
m_actorTime += (endTime - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = f;
|
m_transformTime = endTime;
|
||||||
p_transform.SetIdentity();
|
p_transform.SetIdentity();
|
||||||
|
|
||||||
LegoResult r;
|
LegoResult r;
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
r = m_spline.Evaluate(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUp(), FALSE);
|
r = m_spline.Evaluate(m_traveledDistance / m_BADuration, p_transform, *m_boundary->GetUp(), FALSE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
r = m_spline.Evaluate(m_unk0x7c / m_BADuration, p_transform, *m_boundary->GetUp(), TRUE);
|
r = m_spline.Evaluate(m_traveledDistance / m_BADuration, p_transform, *m_boundary->GetUp(), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(r == 0); // SUCCESS
|
assert(r == 0); // SUCCESS
|
||||||
|
|
||||||
Vector3 pos1(p_transform[3]);
|
Vector3 end(p_transform[3]);
|
||||||
Vector3 pos2(m_unk0xec[3]);
|
Vector3 origin(m_local2World[3]);
|
||||||
Mx3DPointFloat p1;
|
Mx3DPointFloat p1;
|
||||||
|
|
||||||
if (VTable0x68(pos2, pos1, p1) > 0) {
|
if (CheckIntersections(origin, end, p1) > 0) {
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_boundary->CheckAndCallPathTriggers(pos2, pos1, this);
|
m_boundary->CheckAndCallPathTriggers(origin, end, this);
|
||||||
pos2 = pos1;
|
origin = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_finishedTravel != FALSE) {
|
||||||
VTable0x9c();
|
CalculateSpline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -388,7 +395,7 @@ MxS32 LegoPathActor::VTable0x8c(float p_time, Matrix4& p_transform)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e740
|
// FUNCTION: LEGO1 0x1002e740
|
||||||
// FUNCTION: BETA10 0x100b0f70
|
// FUNCTION: BETA10 0x100b0f70
|
||||||
void LegoPathActor::VTable0x74(Matrix4& p_transform)
|
void LegoPathActor::ApplyTransform(Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(p_transform);
|
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(p_transform);
|
||||||
@@ -409,69 +416,70 @@ void LegoPathActor::VTable0x74(Matrix4& p_transform)
|
|||||||
void LegoPathActor::Animate(float p_time)
|
void LegoPathActor::Animate(float p_time)
|
||||||
{
|
{
|
||||||
MxMatrix transform;
|
MxMatrix transform;
|
||||||
MxU32 b = FALSE;
|
MxU32 applyTransform = FALSE;
|
||||||
|
|
||||||
while (m_lastTime < p_time) {
|
while (m_transformTime < p_time) {
|
||||||
if (m_actorState != c_initial && !VTable0x90(p_time, transform)) {
|
if (m_actorState != c_initial && !StepState(p_time, transform)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VTable0x8c(p_time, transform) != 0) {
|
if (CalculateTransform(p_time, transform) != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0xec = transform;
|
m_local2World = transform;
|
||||||
b = TRUE;
|
applyTransform = TRUE;
|
||||||
|
|
||||||
if (m_unk0xe9 != 0) {
|
if (m_finishedTravel != FALSE) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_userNavFlag && m_unk0x148) {
|
if (m_userNavFlag && m_canRotate) {
|
||||||
LegoNavController* nav = NavController();
|
LegoNavController* nav = NavController();
|
||||||
float vel = (nav->GetLinearVel() > 0)
|
float vel =
|
||||||
? -(nav->GetRotationalVel() / (nav->GetMaxLinearVel() * m_unk0x150) * nav->GetLinearVel())
|
(nav->GetLinearVel() > 0)
|
||||||
: 0;
|
? -(nav->GetRotationalVel() / (nav->GetMaxLinearVel() * m_linearRotationRatio) * nav->GetLinearVel())
|
||||||
|
: 0;
|
||||||
|
|
||||||
if ((MxS32) vel != m_unk0x14c) {
|
if ((MxS32) vel != m_lastRotationAngle) {
|
||||||
m_unk0x14c = vel;
|
m_lastRotationAngle = vel;
|
||||||
LegoWorld* world = CurrentWorld();
|
LegoWorld* world = CurrentWorld();
|
||||||
|
|
||||||
if (world) {
|
if (world) {
|
||||||
world->GetCameraController()->RotateZ(DTOR(m_unk0x14c));
|
world->GetCameraController()->RotateZ(DTOR(m_lastRotationAngle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (applyTransform) {
|
||||||
VTable0x74(transform);
|
ApplyTransform(transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e8b0
|
// FUNCTION: LEGO1 0x1002e8b0
|
||||||
// FUNCTION: BETA10 0x100af2f7
|
// FUNCTION: BETA10 0x100af2f7
|
||||||
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
|
void LegoPathActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_scale)
|
||||||
{
|
{
|
||||||
assert(m_boundary);
|
assert(m_boundary);
|
||||||
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_unk0xe4);
|
m_boundary->SwitchBoundary(this, p_boundary, p_edge, p_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002e8d0
|
// FUNCTION: LEGO1 0x1002e8d0
|
||||||
// FUNCTION: BETA10 0x100b1010
|
// FUNCTION: BETA10 0x100b1010
|
||||||
MxU32 LegoPathActor::VTable0x6c(
|
MxU32 LegoPathActor::CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
||||||
if ((*itap)->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3)) {
|
if ((*itap)->Intersect(p_rayOrigin, p_rayDirection, p_rayLength, p_radius, p_intersectionPoint)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -487,7 +495,14 @@ MxU32 LegoPathActor::VTable0x6c(
|
|||||||
LegoROI* roi = actor->GetROI();
|
LegoROI* roi = actor->GetROI();
|
||||||
|
|
||||||
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) {
|
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) {
|
||||||
if (roi->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->m_collideBox)) {
|
if (roi->Intersect(
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->m_collideBox
|
||||||
|
)) {
|
||||||
HitActor(actor, TRUE);
|
HitActor(actor, TRUE);
|
||||||
actor->HitActor(this, FALSE);
|
actor->HitActor(this, FALSE);
|
||||||
return 2;
|
return 2;
|
||||||
@@ -500,26 +515,33 @@ MxU32 LegoPathActor::VTable0x6c(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MxU32 LegoPathActor::FUN_1002edd0(
|
inline MxU32 LegoPathActor::CheckIntersectionBothFaces(
|
||||||
list<LegoPathBoundary*>& p_boundaries,
|
list<LegoPathBoundary*>& p_checkedBoundaries,
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3,
|
Vector3& p_intersectionPoint,
|
||||||
MxS32 p_und
|
MxS32 p_depth
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
MxU32 result = VTable0x6c(p_boundary, p_v1, p_v2, p_f1, p_f2, p_v3);
|
MxU32 result = CheckPresenterAndActorIntersections(
|
||||||
|
p_boundary,
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint
|
||||||
|
);
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_boundaries.push_back(p_boundary);
|
p_checkedBoundaries.push_back(p_boundary);
|
||||||
|
|
||||||
if (p_und >= 2) {
|
if (p_depth >= 2) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -531,14 +553,23 @@ inline MxU32 LegoPathActor::FUN_1002edd0(
|
|||||||
if (boundary != NULL) {
|
if (boundary != NULL) {
|
||||||
list<LegoPathBoundary*>::const_iterator it;
|
list<LegoPathBoundary*>::const_iterator it;
|
||||||
|
|
||||||
for (it = p_boundaries.begin(); !(it == p_boundaries.end()); it++) {
|
for (it = p_checkedBoundaries.begin(); !(it == p_checkedBoundaries.end()); it++) {
|
||||||
if ((*it) == boundary) {
|
if ((*it) == boundary) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it == p_boundaries.end()) {
|
if (it == p_checkedBoundaries.end()) {
|
||||||
result = FUN_1002edd0(p_boundaries, boundary, p_v1, p_v2, p_f1, p_f2, p_v3, p_und + 1);
|
result = CheckIntersectionBothFaces(
|
||||||
|
p_checkedBoundaries,
|
||||||
|
boundary,
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
p_depth + 1
|
||||||
|
);
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return result;
|
return result;
|
||||||
@@ -552,26 +583,35 @@ inline MxU32 LegoPathActor::FUN_1002edd0(
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002ebe0
|
// FUNCTION: LEGO1 0x1002ebe0
|
||||||
// FUNCTION: BETA10 0x100af35e
|
// FUNCTION: BETA10 0x100af35e
|
||||||
MxS32 LegoPathActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
|
MxS32 LegoPathActor::CheckIntersections(Vector3& p_rayOrigin, Vector3& p_rayEnd, Vector3& p_intersectionPoint)
|
||||||
{
|
{
|
||||||
assert(m_boundary && m_roi);
|
assert(m_boundary && m_roi);
|
||||||
|
|
||||||
Mx3DPointFloat v2(p_v2);
|
Mx3DPointFloat rayDirection(p_rayEnd);
|
||||||
v2 -= p_v1;
|
rayDirection -= p_rayOrigin;
|
||||||
|
|
||||||
float len = v2.LenSquared();
|
float len = rayDirection.LenSquared();
|
||||||
|
|
||||||
if (len <= 0.001) {
|
if (len <= 0.001) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = sqrt((double) len);
|
len = sqrt((double) len);
|
||||||
v2 /= len;
|
rayDirection /= len;
|
||||||
|
|
||||||
float radius = m_roi->GetWorldBoundingSphere().Radius();
|
float radius = m_roi->GetWorldBoundingSphere().Radius();
|
||||||
list<LegoPathBoundary*> boundaries;
|
list<LegoPathBoundary*> boundaries;
|
||||||
|
|
||||||
return FUN_1002edd0(boundaries, m_boundary, p_v1, v2, len, radius, p_v3, 0);
|
return CheckIntersectionBothFaces(
|
||||||
|
boundaries,
|
||||||
|
m_boundary,
|
||||||
|
p_rayOrigin,
|
||||||
|
rayDirection,
|
||||||
|
len,
|
||||||
|
radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002f020
|
// FUNCTION: LEGO1 0x1002f020
|
||||||
@@ -622,20 +662,21 @@ void LegoPathActor::ParseAction(char* p_extra)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002f1b0
|
// FUNCTION: LEGO1 0x1002f1b0
|
||||||
// FUNCTION: BETA10 0x100af899
|
// FUNCTION: BETA10 0x100af899
|
||||||
MxResult LegoPathActor::VTable0x9c()
|
MxResult LegoPathActor::CalculateSpline()
|
||||||
{
|
{
|
||||||
Mx3DPointFloat local34;
|
Mx3DPointFloat targetPosition;
|
||||||
Mx3DPointFloat local48;
|
Mx3DPointFloat endDirection;
|
||||||
MxU32 local1c = 1;
|
MxU32 noPath1 = TRUE;
|
||||||
MxU32 local20 = 1;
|
MxU32 noPath2 = TRUE;
|
||||||
|
|
||||||
if (m_grec != NULL) {
|
if (m_grec != NULL) {
|
||||||
if (m_grec->HasPath()) {
|
if (m_grec->HasPath()) {
|
||||||
local1c = 0;
|
noPath1 = FALSE;
|
||||||
local20 = 0;
|
noPath2 = FALSE;
|
||||||
|
|
||||||
Mx3DPointFloat vec;
|
Mx3DPointFloat vec;
|
||||||
switch (m_pathController->GetNextPathEdge(*m_grec, local34, local48, m_unk0xe4, m_destEdge, m_boundary)) {
|
switch (m_pathController
|
||||||
|
->GetNextPathEdge(*m_grec, targetPosition, endDirection, m_destScale, m_destEdge, m_boundary)) {
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
@@ -650,30 +691,30 @@ MxResult LegoPathActor::VTable0x9c()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (local1c != 0) {
|
if (noPath1 != FALSE) {
|
||||||
SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
|
SwitchBoundary(m_boundary, m_destEdge, m_destScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (local20 != 0) {
|
if (noPath2 != FALSE) {
|
||||||
Mx3DPointFloat local78;
|
Mx3DPointFloat normal;
|
||||||
|
|
||||||
assert(m_boundary && m_destEdge);
|
assert(m_boundary && m_destEdge);
|
||||||
|
|
||||||
Vector3* v1 = m_destEdge->CWVertex(*m_boundary);
|
Vector3* cw = m_destEdge->CWVertex(*m_boundary);
|
||||||
Vector3* v2 = m_destEdge->CCWVertex(*m_boundary);
|
Vector3* ccw = m_destEdge->CCWVertex(*m_boundary);
|
||||||
|
|
||||||
assert(v1 && v2);
|
assert(cw && ccw);
|
||||||
|
|
||||||
LERP3(local34, *v1, *v2, m_unk0xe4);
|
LERP3(targetPosition, *cw, *ccw, m_destScale);
|
||||||
|
|
||||||
m_destEdge->GetFaceNormal(*m_boundary, local78);
|
m_destEdge->GetFaceNormal(*m_boundary, normal);
|
||||||
local48.EqualsCross(*m_boundary->GetUp(), local78);
|
endDirection.EqualsCross(*m_boundary->GetUp(), normal);
|
||||||
local48.Unitize();
|
endDirection.Unitize();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector3 rightRef(m_unk0xec[0]);
|
Vector3 rightRef(m_local2World[0]);
|
||||||
Vector3 upRef(m_unk0xec[1]);
|
Vector3 upRef(m_local2World[1]);
|
||||||
Vector3 dirRef(m_unk0xec[2]);
|
Vector3 dirRef(m_local2World[2]);
|
||||||
|
|
||||||
upRef = *m_boundary->GetUp();
|
upRef = *m_boundary->GetUp();
|
||||||
|
|
||||||
@@ -683,74 +724,74 @@ MxResult LegoPathActor::VTable0x9c()
|
|||||||
dirRef.EqualsCross(rightRef, upRef);
|
dirRef.EqualsCross(rightRef, upRef);
|
||||||
dirRef.Unitize();
|
dirRef.Unitize();
|
||||||
|
|
||||||
Mx3DPointFloat localc0(m_unk0xec[3]);
|
Mx3DPointFloat start(m_local2World[3]);
|
||||||
Mx3DPointFloat local84(m_unk0xec[2]);
|
Mx3DPointFloat direction(m_local2World[2]);
|
||||||
Mx3DPointFloat local70(local34);
|
Mx3DPointFloat startToTarget(targetPosition);
|
||||||
|
|
||||||
local70 -= localc0;
|
startToTarget -= start;
|
||||||
float len = local70.LenSquared();
|
float len = startToTarget.LenSquared();
|
||||||
if (len >= 0.0f) {
|
if (len >= 0.0f) {
|
||||||
len = sqrt(len);
|
len = sqrt(len);
|
||||||
local84 *= len;
|
direction *= len;
|
||||||
local48 *= len;
|
endDirection *= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_userNavFlag) {
|
if (!m_userNavFlag) {
|
||||||
local84 *= -1.0f;
|
direction *= -1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VTable0x80(localc0, local84, local34, local48) != SUCCESS) {
|
if (SetSpline(start, direction, targetPosition, endDirection) != SUCCESS) {
|
||||||
MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName());
|
MxTrace("Warning: m_BADuration = %g, roi = %s\n", m_BADuration, m_roi->GetName());
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x7c = 0.0f;
|
m_traveledDistance = 0.0f;
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002f650
|
// FUNCTION: LEGO1 0x1002f650
|
||||||
// FUNCTION: BETA10 0x100afd67
|
// FUNCTION: BETA10 0x100afd67
|
||||||
void LegoPathActor::VTable0xa4(MxBool& p_und1, MxS32& p_und2)
|
void LegoPathActor::GetWalkingBehavior(MxBool& p_countCounterclockWise, MxS32& p_selectedEdgeIndex)
|
||||||
{
|
{
|
||||||
switch (GetActorId()) {
|
switch (GetActorId()) {
|
||||||
case c_pepper:
|
case c_pepper:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = 2;
|
p_selectedEdgeIndex = 2;
|
||||||
break;
|
break;
|
||||||
case c_mama:
|
case c_mama:
|
||||||
p_und1 = FALSE;
|
p_countCounterclockWise = FALSE;
|
||||||
p_und2 = 1;
|
p_selectedEdgeIndex = 1;
|
||||||
break;
|
break;
|
||||||
case c_papa:
|
case c_papa:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = 1;
|
p_selectedEdgeIndex = 1;
|
||||||
break;
|
break;
|
||||||
case c_nick:
|
case c_nick:
|
||||||
case c_brickster:
|
case c_brickster:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = rand() % p_und2 + 1;
|
p_selectedEdgeIndex = rand() % p_selectedEdgeIndex + 1;
|
||||||
break;
|
break;
|
||||||
case c_laura:
|
case c_laura:
|
||||||
p_und1 = FALSE;
|
p_countCounterclockWise = FALSE;
|
||||||
p_und2 = 2;
|
p_selectedEdgeIndex = 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
p_und1 = TRUE;
|
p_countCounterclockWise = TRUE;
|
||||||
p_und2 = 1;
|
p_selectedEdgeIndex = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002f700
|
// FUNCTION: LEGO1 0x1002f700
|
||||||
// FUNCTION: BETA10 0x100afe4c
|
// FUNCTION: BETA10 0x100afe4c
|
||||||
void LegoPathActor::VTable0xa8()
|
void LegoPathActor::ApplyLocal2World()
|
||||||
{
|
{
|
||||||
m_lastTime = Timer()->GetTime();
|
m_transformTime = Timer()->GetTime();
|
||||||
m_roi->SetLocal2World(m_unk0xec);
|
m_roi->SetLocal2World(m_local2World);
|
||||||
m_roi->WrappedUpdateWorldData();
|
m_roi->WrappedUpdateWorldData();
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(m_unk0xec);
|
m_roi->WrappedSetLocal2WorldWithWorldDataUpdate(m_local2World);
|
||||||
TransformPointOfView();
|
TransformPointOfView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void LegoPathBoundary::SwitchBoundary(
|
|||||||
selectedEdgeIndex = 1;
|
selectedEdgeIndex = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p_actor->VTable0xa4(countCounterclockwise, selectedEdgeIndex);
|
p_actor->GetWalkingBehavior(countCounterclockwise, selectedEdgeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (selectedEdgeIndex > 0) {
|
while (selectedEdgeIndex > 0) {
|
||||||
|
|||||||
@@ -223,8 +223,14 @@ MxResult LegoPathController::PlaceActor(
|
|||||||
assert(pSrcE && pDestE);
|
assert(pSrcE && pDestE);
|
||||||
|
|
||||||
float time = Timer()->GetTime();
|
float time = Timer()->GetTime();
|
||||||
MxResult result =
|
MxResult result = p_actor->SetTransformAndDestinationFromEdge(
|
||||||
p_actor->VTable0x88(pBoundary, time, *pSrcE, p_srcScale, (LegoOrientedEdge&) *pDestE, p_destScale);
|
pBoundary,
|
||||||
|
time,
|
||||||
|
*pSrcE,
|
||||||
|
p_srcScale,
|
||||||
|
(LegoOrientedEdge&) *pDestE,
|
||||||
|
p_destScale
|
||||||
|
);
|
||||||
|
|
||||||
if (result != SUCCESS) {
|
if (result != SUCCESS) {
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -298,7 +304,8 @@ MxResult LegoPathController::PlaceActor(
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_actor->VTable0x84(boundary, time, p_position, p_direction, edge, 0.5f) == SUCCESS) {
|
if (p_actor->SetTransformAndDestinationFromPoints(boundary, time, p_position, p_direction, edge, 0.5f) ==
|
||||||
|
SUCCESS) {
|
||||||
p_actor->SetController(this);
|
p_actor->SetController(this);
|
||||||
m_actors.insert(p_actor);
|
m_actors.insert(p_actor);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ LegoRaceActor::LegoRaceActor()
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10014750
|
// FUNCTION: LEGO1 0x10014750
|
||||||
// FUNCTION: BETA10 0x100c9bba
|
// FUNCTION: BETA10 0x100c9bba
|
||||||
MxS32 LegoRaceActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
|
MxS32 LegoRaceActor::CheckIntersections(Vector3& p_rayOrigin, Vector3& p_rayEnd, Vector3& p_intersectionPoint)
|
||||||
{
|
{
|
||||||
MxS32 result = LegoPathActor::VTable0x68(p_v1, p_v2, p_v3);
|
MxS32 result = LegoPathActor::CheckIntersections(p_rayOrigin, p_rayEnd, p_intersectionPoint);
|
||||||
|
|
||||||
if (m_userNavFlag && result) {
|
if (m_userNavFlag && result) {
|
||||||
MxLong time = Timer()->GetTime();
|
MxLong time = Timer()->GetTime();
|
||||||
@@ -46,20 +46,20 @@ MxS32 LegoRaceActor::VTable0x68(Vector3& p_v1, Vector3& p_v2, Vector3& p_v3)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x100147f0
|
// FUNCTION: LEGO1 0x100147f0
|
||||||
// FUNCTION: BETA10 0x100c9c93
|
// FUNCTION: BETA10 0x100c9c93
|
||||||
MxU32 LegoRaceActor::VTable0x90(float p_time, Matrix4& p_transform)
|
MxU32 LegoRaceActor::StepState(float p_time, Matrix4& p_transform)
|
||||||
{
|
{
|
||||||
// Note: Code duplication with LegoExtraActor::VTable0x90
|
// Note: Code duplication with LegoExtraActor::StepState
|
||||||
switch (m_actorState) {
|
switch (m_actorState) {
|
||||||
case c_initial:
|
case c_initial:
|
||||||
case c_one:
|
case c_ready:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case c_two:
|
case c_hit:
|
||||||
m_unk0x08 = p_time + 2000.0f;
|
m_unk0x08 = p_time + 2000.0f;
|
||||||
m_actorState = c_three;
|
m_actorState = c_hitAnimation;
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
case c_three:
|
case c_hitAnimation:
|
||||||
assert(!m_userNavFlag);
|
assert(!m_userNavFlag);
|
||||||
Vector3 positionRef(p_transform[3]);
|
Vector3 positionRef(p_transform[3]);
|
||||||
|
|
||||||
@@ -73,10 +73,10 @@ MxU32 LegoRaceActor::VTable0x90(float p_time, Matrix4& p_transform)
|
|||||||
p_transform.RotateX(0.6);
|
p_transform.RotateX(0.6);
|
||||||
positionRef = position;
|
positionRef = position;
|
||||||
|
|
||||||
m_actorTime += (p_time - m_lastTime) * m_worldSpeed;
|
m_actorTime += (p_time - m_transformTime) * m_worldSpeed;
|
||||||
m_lastTime = p_time;
|
m_transformTime = p_time;
|
||||||
|
|
||||||
VTable0x74(p_transform);
|
ApplyTransform(p_transform);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -111,7 +111,7 @@ MxResult LegoRaceActor::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
|
|
||||||
roi->SetLocal2World(matr);
|
roi->SetLocal2World(matr);
|
||||||
|
|
||||||
p_actor->SetActorState(c_two);
|
p_actor->SetActorState(c_hit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
Vector3(matr[3]) += g_hitOffset;
|
Vector3(matr[3]) += g_hitOffset;
|
||||||
roi->SetLocal2World(matr);
|
roi->SetLocal2World(matr);
|
||||||
|
|
||||||
p_actor->SetActorState(c_two);
|
p_actor->SetActorState(c_hit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
@@ -531,12 +531,12 @@ MxResult LegoRaceCar::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10013600
|
// FUNCTION: LEGO1 0x10013600
|
||||||
// FUNCTION: BETA10 0x100cbe60
|
// FUNCTION: BETA10 0x100cbe60
|
||||||
MxResult LegoRaceCar::VTable0x9c()
|
MxResult LegoRaceCar::CalculateSpline()
|
||||||
{
|
{
|
||||||
MxResult result;
|
MxResult result;
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
result = LegoCarRaceActor::VTable0x9c();
|
result = LegoCarRaceActor::CalculateSpline();
|
||||||
|
|
||||||
if (m_boundary) {
|
if (m_boundary) {
|
||||||
MxS32 onSkeletonBoundary = FALSE;
|
MxS32 onSkeletonBoundary = FALSE;
|
||||||
@@ -560,7 +560,7 @@ MxResult LegoRaceCar::VTable0x9c()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
result = LegoCarRaceActor::VTable0x9c();
|
result = LegoCarRaceActor::CalculateSpline();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -685,7 +685,7 @@ MxResult LegoJetski::HitActor(LegoPathActor* p_actor, MxBool p_bool)
|
|||||||
Vector3(matr[3]) += g_hitOffset;
|
Vector3(matr[3]) += g_hitOffset;
|
||||||
roi->SetLocal2World(matr);
|
roi->SetLocal2World(matr);
|
||||||
|
|
||||||
p_actor->SetActorState(c_two);
|
p_actor->SetActorState(c_hit);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ LegoCarRaceActor::LegoCarRaceActor()
|
|||||||
m_unk0x10 = 0.65f;
|
m_unk0x10 = 0.65f;
|
||||||
m_unk0x14 = 0.03f;
|
m_unk0x14 = 0.03f;
|
||||||
m_unk0x18 = 0.6f;
|
m_unk0x18 = 0.6f;
|
||||||
m_unk0x140 = 0.1f;
|
m_wallHitDirectionFactor = 0.1f;
|
||||||
m_unk0x150 = -5.0f;
|
m_linearRotationRatio = -5.0f;
|
||||||
m_unk0x148 = 1;
|
m_canRotate = 1;
|
||||||
VariableTable()->SetVariable(g_fuel, "0.8");
|
VariableTable()->SetVariable(g_fuel, "0.8");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
Mx3DPointFloat destEdgeUnknownVector;
|
Mx3DPointFloat destEdgeUnknownVector;
|
||||||
Mx3DPointFloat crossProduct;
|
Mx3DPointFloat crossProduct;
|
||||||
|
|
||||||
if (m_actorState == c_one) {
|
if (m_actorState == c_ready) {
|
||||||
m_boundary = NULL;
|
m_boundary = NULL;
|
||||||
|
|
||||||
// Not sure where the upper bound of 11 comes from, the underlying array has a size of 16
|
// Not sure where the upper bound of 11 comes from, the underlying array has a size of 16
|
||||||
@@ -132,7 +132,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
assert(m_boundary);
|
assert(m_boundary);
|
||||||
|
|
||||||
m_actorState = c_initial;
|
m_actorState = c_initial;
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
NavController()->SetLinearVel(m_worldSpeed);
|
NavController()->SetLinearVel(m_worldSpeed);
|
||||||
@@ -145,7 +145,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
else {
|
else {
|
||||||
for (MxS32 i = 0; i < 11; i += 2) {
|
for (MxS32 i = 0; i < 11; i += 2) {
|
||||||
if (LegoPathController::GetControlEdgeA(i) == p_edge) {
|
if (LegoPathController::GetControlEdgeA(i) == p_edge) {
|
||||||
m_actorState = c_one;
|
m_actorState = c_ready;
|
||||||
|
|
||||||
if (m_worldSpeed < g_unk0x100f7aec) {
|
if (m_worldSpeed < g_unk0x100f7aec) {
|
||||||
m_worldSpeed = g_unk0x100f7aec;
|
m_worldSpeed = g_unk0x100f7aec;
|
||||||
@@ -157,9 +157,9 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_actorState == c_one) {
|
if (m_actorState == c_ready) {
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_unk0xe4 = 0.5f;
|
m_destScale = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// variable names verified by BETA10
|
// variable names verified by BETA10
|
||||||
@@ -167,7 +167,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
Vector3* v2 = m_destEdge->CWVertex(*m_boundary);
|
Vector3* v2 = m_destEdge->CWVertex(*m_boundary);
|
||||||
assert(v1 && v2);
|
assert(v1 && v2);
|
||||||
|
|
||||||
LERP3(pointUnknown, *v1, *v2, m_unk0xe4);
|
LERP3(pointUnknown, *v1, *v2, m_destScale);
|
||||||
|
|
||||||
m_destEdge->GetFaceNormal(*m_boundary, destEdgeUnknownVector);
|
m_destEdge->GetFaceNormal(*m_boundary, destEdgeUnknownVector);
|
||||||
|
|
||||||
@@ -184,14 +184,14 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
crossProduct *= 5.0f;
|
crossProduct *= 5.0f;
|
||||||
|
|
||||||
MxResult callResult =
|
MxResult callResult =
|
||||||
VTable0x80(Vector3(m_roi->GetWorldPosition()), worldDirection, pointUnknown, crossProduct);
|
SetSpline(Vector3(m_roi->GetWorldPosition()), worldDirection, pointUnknown, crossProduct);
|
||||||
|
|
||||||
if (callResult) {
|
if (callResult) {
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
#ifdef BETA10
|
#ifdef BETA10
|
||||||
assert(0);
|
assert(0);
|
||||||
#endif
|
#endif
|
||||||
@@ -216,7 +216,7 @@ MxS32 LegoCarRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_edg
|
|||||||
// FUNCTION: BETA10 0x100cdb3c
|
// FUNCTION: BETA10 0x100cdb3c
|
||||||
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
|
void LegoCarRaceActor::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoOrientedEdge*& p_edge, float& p_unk0xe4)
|
||||||
{
|
{
|
||||||
LegoPathActor::SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
|
LegoPathActor::SwitchBoundary(m_boundary, m_destEdge, m_destScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10080b70
|
// FUNCTION: LEGO1 0x10080b70
|
||||||
@@ -229,7 +229,7 @@ void LegoCarRaceActor::Animate(float p_time)
|
|||||||
|
|
||||||
if (strcmpi(value, g_racing) == 0) {
|
if (strcmpi(value, g_racing) == 0) {
|
||||||
m_animState = 1;
|
m_animState = 1;
|
||||||
m_lastTime = p_time - 1.0f;
|
m_transformTime = p_time - 1.0f;
|
||||||
m_unk0x1c = p_time;
|
m_unk0x1c = p_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,14 +241,14 @@ void LegoCarRaceActor::Animate(float p_time)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10080be0
|
// FUNCTION: LEGO1 0x10080be0
|
||||||
// FUNCTION: BETA10 0x100cdc54
|
// FUNCTION: BETA10 0x100cdc54
|
||||||
MxResult LegoCarRaceActor::VTable0x9c()
|
MxResult LegoCarRaceActor::CalculateSpline()
|
||||||
{
|
{
|
||||||
LegoOrientedEdge* d = m_destEdge;
|
LegoOrientedEdge* d = m_destEdge;
|
||||||
|
|
||||||
if (VTable0x1c(m_boundary, m_destEdge)) {
|
if (VTable0x1c(m_boundary, m_destEdge)) {
|
||||||
LegoPathBoundary* b = m_boundary;
|
LegoPathBoundary* b = m_boundary;
|
||||||
|
|
||||||
SwitchBoundary(m_boundary, m_destEdge, m_unk0xe4);
|
SwitchBoundary(m_boundary, m_destEdge, m_destScale);
|
||||||
assert(m_boundary && m_destEdge);
|
assert(m_boundary && m_destEdge);
|
||||||
|
|
||||||
// variable names verified by BETA10
|
// variable names verified by BETA10
|
||||||
@@ -257,7 +257,7 @@ MxResult LegoCarRaceActor::VTable0x9c()
|
|||||||
assert(v1 && v2);
|
assert(v1 && v2);
|
||||||
|
|
||||||
Mx3DPointFloat point1;
|
Mx3DPointFloat point1;
|
||||||
LERP3(point1, *v1, *v2, m_unk0xe4);
|
LERP3(point1, *v1, *v2, m_destScale);
|
||||||
|
|
||||||
Mx3DPointFloat point2;
|
Mx3DPointFloat point2;
|
||||||
Mx3DPointFloat point3;
|
Mx3DPointFloat point3;
|
||||||
@@ -276,7 +276,7 @@ MxResult LegoCarRaceActor::VTable0x9c()
|
|||||||
point4 *= 5.0f;
|
point4 *= 5.0f;
|
||||||
point5 *= 5.0f;
|
point5 *= 5.0f;
|
||||||
|
|
||||||
MxResult res = VTable0x80(m_roi->GetWorldPosition(), point4, point1, point5);
|
MxResult res = SetSpline(m_roi->GetWorldPosition(), point4, point1, point5);
|
||||||
|
|
||||||
#ifdef BETA10
|
#ifdef BETA10
|
||||||
if (res) {
|
if (res) {
|
||||||
@@ -285,7 +285,7 @@ MxResult LegoCarRaceActor::VTable0x9c()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
@@ -298,7 +298,7 @@ LegoJetskiRaceActor::LegoJetskiRaceActor()
|
|||||||
m_unk0x10 = 0.95f;
|
m_unk0x10 = 0.95f;
|
||||||
m_unk0x14 = 0.04f;
|
m_unk0x14 = 0.04f;
|
||||||
m_unk0x18 = 0.5f;
|
m_unk0x18 = 0.5f;
|
||||||
m_unk0x150 = 1.5f;
|
m_linearRotationRatio = 1.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10081120
|
// FUNCTION: LEGO1 0x10081120
|
||||||
@@ -314,7 +314,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
Vector3* v1 = NULL;
|
Vector3* v1 = NULL;
|
||||||
Vector3* v2 = NULL;
|
Vector3* v2 = NULL;
|
||||||
|
|
||||||
if (m_actorState == c_one) {
|
if (m_actorState == c_ready) {
|
||||||
if (m_destEdge == LegoPathController::GetControlEdgeA(13)) {
|
if (m_destEdge == LegoPathController::GetControlEdgeA(13)) {
|
||||||
m_boundary = (LegoPathBoundary*) m_destEdge->OtherFace(LegoPathController::GetControlBoundaryA(13));
|
m_boundary = (LegoPathBoundary*) m_destEdge->OtherFace(LegoPathController::GetControlBoundaryA(13));
|
||||||
}
|
}
|
||||||
@@ -323,7 +323,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_actorState = c_initial;
|
m_actorState = c_initial;
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
|
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
NavController()->SetLinearVel(m_worldSpeed);
|
NavController()->SetLinearVel(m_worldSpeed);
|
||||||
@@ -335,7 +335,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (p_edge == LegoPathController::GetControlEdgeA(12)) {
|
if (p_edge == LegoPathController::GetControlEdgeA(12)) {
|
||||||
m_actorState = c_one;
|
m_actorState = c_ready;
|
||||||
|
|
||||||
if (m_worldSpeed < g_unk0x100da044) {
|
if (m_worldSpeed < g_unk0x100da044) {
|
||||||
m_worldSpeed = g_unk0x100da044;
|
m_worldSpeed = g_unk0x100da044;
|
||||||
@@ -345,7 +345,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
m_boundary = LegoPathController::GetControlBoundaryA(13);
|
m_boundary = LegoPathController::GetControlBoundaryA(13);
|
||||||
}
|
}
|
||||||
else if (p_edge == LegoPathController::GetControlEdgeA(14)) {
|
else if (p_edge == LegoPathController::GetControlEdgeA(14)) {
|
||||||
m_actorState = c_one;
|
m_actorState = c_ready;
|
||||||
|
|
||||||
if (m_worldSpeed < g_unk0x100da044) {
|
if (m_worldSpeed < g_unk0x100da044) {
|
||||||
m_worldSpeed = g_unk0x100da044;
|
m_worldSpeed = g_unk0x100da044;
|
||||||
@@ -355,16 +355,16 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
m_boundary = LegoPathController::GetControlBoundaryA(15);
|
m_boundary = LegoPathController::GetControlBoundaryA(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_actorState == c_one) {
|
if (m_actorState == c_ready) {
|
||||||
if (m_userNavFlag) {
|
if (m_userNavFlag) {
|
||||||
m_unk0xe4 = 0.5f;
|
m_destScale = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
v1 = m_destEdge->CCWVertex(*m_boundary);
|
v1 = m_destEdge->CCWVertex(*m_boundary);
|
||||||
v2 = m_destEdge->CWVertex(*m_boundary);
|
v2 = m_destEdge->CWVertex(*m_boundary);
|
||||||
assert(v1 && v2);
|
assert(v1 && v2);
|
||||||
|
|
||||||
LERP3(a, *v1, *v2, m_unk0xe4);
|
LERP3(a, *v1, *v2, m_destScale);
|
||||||
|
|
||||||
m_destEdge->GetFaceNormal(*m_boundary, bbb);
|
m_destEdge->GetFaceNormal(*m_boundary, bbb);
|
||||||
c.EqualsCross(bbb, *m_boundary->GetUp());
|
c.EqualsCross(bbb, *m_boundary->GetUp());
|
||||||
@@ -376,9 +376,9 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
worldDirection *= -1.0f;
|
worldDirection *= -1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VTable0x80(m_roi->GetWorldPosition(), worldDirection, a, c)) {
|
if (SetSpline(m_roi->GetWorldPosition(), worldDirection, a, c)) {
|
||||||
#ifndef BETA10
|
#ifndef BETA10
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -386,7 +386,7 @@ MxS32 LegoJetskiRaceActor::VTable0x1c(LegoPathBoundary* p_boundary, LegoEdge* p_
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x7c = 0;
|
m_traveledDistance = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -402,11 +402,11 @@ void LegoJetskiRaceActor::Animate(float p_time)
|
|||||||
const LegoChar* raceState = VariableTable()->GetVariable(g_raceState);
|
const LegoChar* raceState = VariableTable()->GetVariable(g_raceState);
|
||||||
if (!stricmp(raceState, g_racing)) {
|
if (!stricmp(raceState, g_racing)) {
|
||||||
m_animState = 1;
|
m_animState = 1;
|
||||||
m_lastTime = p_time - 1.0f;
|
m_transformTime = p_time - 1.0f;
|
||||||
m_unk0x1c = p_time;
|
m_unk0x1c = p_time;
|
||||||
}
|
}
|
||||||
else if (!m_userNavFlag) {
|
else if (!m_userNavFlag) {
|
||||||
LegoAnimActor::Animate(m_lastTime + 1.0f);
|
LegoAnimActor::Animate(m_transformTime + 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,13 +417,13 @@ void LegoJetskiRaceActor::Animate(float p_time)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10081840
|
// FUNCTION: LEGO1 0x10081840
|
||||||
// FUNCTION: BETA10 0x100cf680
|
// FUNCTION: BETA10 0x100cf680
|
||||||
inline MxU32 LegoCarRaceActor::VTable0x6c(
|
inline MxU32 LegoCarRaceActor::CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// STRING: LEGO1 0x100f7af4
|
// STRING: LEGO1 0x100f7af4
|
||||||
@@ -432,7 +432,7 @@ inline MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
||||||
if ((*itap)->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3)) {
|
if ((*itap)->Intersect(p_rayOrigin, p_rayDirection, p_rayLength, p_radius, p_intersectionPoint)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,8 +456,14 @@ inline MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
|
|
||||||
LegoROI* firstROI = (LegoROI*) co->front();
|
LegoROI* firstROI = (LegoROI*) co->front();
|
||||||
|
|
||||||
if (firstROI
|
if (firstROI->Intersect(
|
||||||
->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
HitActor(actor, TRUE);
|
HitActor(actor, TRUE);
|
||||||
|
|
||||||
if (actor->HitActor(this, FALSE) < 0) {
|
if (actor->HitActor(this, FALSE) < 0) {
|
||||||
@@ -470,8 +476,14 @@ inline MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
|
|
||||||
LegoROI* lastROI = (LegoROI*) co->back();
|
LegoROI* lastROI = (LegoROI*) co->back();
|
||||||
|
|
||||||
if (lastROI
|
if (lastROI->Intersect(
|
||||||
->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
HitActor(actor, TRUE);
|
HitActor(actor, TRUE);
|
||||||
|
|
||||||
if (actor->HitActor(this, FALSE) < 0) {
|
if (actor->HitActor(this, FALSE) < 0) {
|
||||||
@@ -484,7 +496,14 @@ inline MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (roi->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
if (roi->Intersect(
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
HitActor(actor, TRUE);
|
HitActor(actor, TRUE);
|
||||||
|
|
||||||
if (actor->HitActor(this, FALSE) < 0) {
|
if (actor->HitActor(this, FALSE) < 0) {
|
||||||
@@ -504,19 +523,19 @@ inline MxU32 LegoCarRaceActor::VTable0x6c(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10081fd0
|
// FUNCTION: LEGO1 0x10081fd0
|
||||||
inline MxU32 LegoJetskiRaceActor::VTable0x6c(
|
inline MxU32 LegoJetskiRaceActor::CheckPresenterAndActorIntersections(
|
||||||
LegoPathBoundary* p_boundary,
|
LegoPathBoundary* p_boundary,
|
||||||
Vector3& p_v1,
|
Vector3& p_rayOrigin,
|
||||||
Vector3& p_v2,
|
Vector3& p_rayDirection,
|
||||||
float p_f1,
|
float p_rayLength,
|
||||||
float p_f2,
|
float p_radius,
|
||||||
Vector3& p_v3
|
Vector3& p_intersectionPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
LegoAnimPresenterSet& presenters = p_boundary->GetPresenters();
|
||||||
|
|
||||||
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
for (LegoAnimPresenterSet::iterator itap = presenters.begin(); itap != presenters.end(); itap++) {
|
||||||
if ((*itap)->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3)) {
|
if ((*itap)->Intersect(p_rayOrigin, p_rayDirection, p_rayLength, p_radius, p_intersectionPoint)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -532,7 +551,14 @@ inline MxU32 LegoJetskiRaceActor::VTable0x6c(
|
|||||||
LegoROI* roi = actor->GetROI();
|
LegoROI* roi = actor->GetROI();
|
||||||
|
|
||||||
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) {
|
if (roi != NULL && (roi->GetVisibility() || actor->GetCameraFlag())) {
|
||||||
if (roi->Intersect(p_v1, p_v2, p_f1, p_f2, p_v3, m_collideBox && actor->GetCollideBox())) {
|
if (roi->Intersect(
|
||||||
|
p_rayOrigin,
|
||||||
|
p_rayDirection,
|
||||||
|
p_rayLength,
|
||||||
|
p_radius,
|
||||||
|
p_intersectionPoint,
|
||||||
|
m_collideBox && actor->GetCollideBox()
|
||||||
|
)) {
|
||||||
HitActor(actor, TRUE);
|
HitActor(actor, TRUE);
|
||||||
|
|
||||||
if (actor->HitActor(this, FALSE) < 0) {
|
if (actor->HitActor(this, FALSE) < 0) {
|
||||||
|
|||||||
@@ -582,13 +582,13 @@ MxLong Act3::Notify(MxParam& p_param)
|
|||||||
|
|
||||||
m_cop1->SetActorState(LegoPathActor::c_initial);
|
m_cop1->SetActorState(LegoPathActor::c_initial);
|
||||||
m_cop1->SetWorldSpeed(2.0f);
|
m_cop1->SetWorldSpeed(2.0f);
|
||||||
m_cop1->VTable0xa8();
|
m_cop1->ApplyLocal2World();
|
||||||
|
|
||||||
m_cop2->SetActorState(LegoPathActor::c_initial);
|
m_cop2->SetActorState(LegoPathActor::c_initial);
|
||||||
m_cop2->SetWorldSpeed(2.0f);
|
m_cop2->SetWorldSpeed(2.0f);
|
||||||
m_cop2->VTable0xa8();
|
m_cop2->ApplyLocal2World();
|
||||||
|
|
||||||
m_brickster->VTable0xa8();
|
m_brickster->ApplyLocal2World();
|
||||||
m_pizzaHitSound = 0;
|
m_pizzaHitSound = 0;
|
||||||
m_pizzaMissSound = 0;
|
m_pizzaMissSound = 0;
|
||||||
m_copDonutSound = 0;
|
m_copDonutSound = 0;
|
||||||
@@ -907,34 +907,34 @@ void Act3::Enable(MxBool p_enable)
|
|||||||
MxFloat delta = Timer()->GetTime() - m_time - 100.0f;
|
MxFloat delta = Timer()->GetTime() - m_time - 100.0f;
|
||||||
m_time = -1.0f;
|
m_time = -1.0f;
|
||||||
|
|
||||||
m_cop1->SetLastTime(m_cop1->GetLastTime() + delta);
|
m_cop1->SetTransformTime(m_cop1->GetTransformTime() + delta);
|
||||||
m_cop1->SetActorTime(m_cop1->GetActorTime() + delta);
|
m_cop1->SetActorTime(m_cop1->GetActorTime() + delta);
|
||||||
m_cop1->SetUnknown0x20(m_cop1->GetUnknown0x20() + delta);
|
m_cop1->SetUnknown0x20(m_cop1->GetUnknown0x20() + delta);
|
||||||
m_cop1->SetUnknown0x1c(m_cop1->GetUnknown0x1c() + delta);
|
m_cop1->SetUnknown0x1c(m_cop1->GetUnknown0x1c() + delta);
|
||||||
|
|
||||||
m_cop2->SetLastTime(m_cop2->GetLastTime() + delta);
|
m_cop2->SetTransformTime(m_cop2->GetTransformTime() + delta);
|
||||||
m_cop2->SetActorTime(m_cop2->GetActorTime() + delta);
|
m_cop2->SetActorTime(m_cop2->GetActorTime() + delta);
|
||||||
m_cop2->SetUnknown0x20(m_cop2->GetUnknown0x20() + delta);
|
m_cop2->SetUnknown0x20(m_cop2->GetUnknown0x20() + delta);
|
||||||
m_cop2->SetUnknown0x1c(m_cop2->GetUnknown0x1c() + delta);
|
m_cop2->SetUnknown0x1c(m_cop2->GetUnknown0x1c() + delta);
|
||||||
|
|
||||||
m_brickster->SetLastTime(m_brickster->GetLastTime() + delta);
|
m_brickster->SetTransformTime(m_brickster->GetTransformTime() + delta);
|
||||||
m_brickster->SetActorTime(m_brickster->GetActorTime() + delta);
|
m_brickster->SetActorTime(m_brickster->GetActorTime() + delta);
|
||||||
m_brickster->SetUnknown0x20(m_brickster->GetUnknown0x20() + delta);
|
m_brickster->SetUnknown0x20(m_brickster->GetUnknown0x20() + delta);
|
||||||
m_brickster->SetUnknown0x24(m_brickster->GetUnknown0x24() + delta);
|
m_brickster->SetUnknown0x24(m_brickster->GetUnknown0x24() + delta);
|
||||||
m_brickster->SetUnknown0x50(m_brickster->GetUnknown0x50() + delta);
|
m_brickster->SetUnknown0x50(m_brickster->GetUnknown0x50() + delta);
|
||||||
m_brickster->SetUnknown0x1c(m_brickster->GetUnknown0x1c() + delta);
|
m_brickster->SetUnknown0x1c(m_brickster->GetUnknown0x1c() + delta);
|
||||||
|
|
||||||
m_copter->SetLastTime(m_copter->GetLastTime() + delta);
|
m_copter->SetTransformTime(m_copter->GetTransformTime() + delta);
|
||||||
m_copter->SetActorTime(m_copter->GetActorTime() + delta);
|
m_copter->SetActorTime(m_copter->GetActorTime() + delta);
|
||||||
|
|
||||||
m_shark->SetLastTime(m_shark->GetLastTime() + delta);
|
m_shark->SetTransformTime(m_shark->GetTransformTime() + delta);
|
||||||
m_shark->SetActorTime(m_shark->GetActorTime() + delta);
|
m_shark->SetActorTime(m_shark->GetActorTime() + delta);
|
||||||
m_shark->SetUnknown0x2c(m_shark->GetUnknown0x2c() + delta);
|
m_shark->SetUnknown0x2c(m_shark->GetUnknown0x2c() + delta);
|
||||||
|
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
for (i = 0; i < (MxS32) sizeOfArray(m_pizzas); i++) {
|
for (i = 0; i < (MxS32) sizeOfArray(m_pizzas); i++) {
|
||||||
if (m_pizzas[i].IsValid()) {
|
if (m_pizzas[i].IsValid()) {
|
||||||
m_pizzas[i].SetLastTime(m_pizzas[i].GetLastTime() + delta);
|
m_pizzas[i].SetTransformTime(m_pizzas[i].GetTransformTime() + delta);
|
||||||
m_pizzas[i].SetActorTime(m_pizzas[i].GetActorTime() + delta);
|
m_pizzas[i].SetActorTime(m_pizzas[i].GetActorTime() + delta);
|
||||||
m_pizzas[i].SetRotateTimeout(m_pizzas[i].GetRotateTimeout() + delta);
|
m_pizzas[i].SetRotateTimeout(m_pizzas[i].GetRotateTimeout() + delta);
|
||||||
}
|
}
|
||||||
@@ -942,7 +942,7 @@ void Act3::Enable(MxBool p_enable)
|
|||||||
|
|
||||||
for (i = 0; i < (MxS32) sizeOfArray(m_donuts); i++) {
|
for (i = 0; i < (MxS32) sizeOfArray(m_donuts); i++) {
|
||||||
if (m_donuts[i].IsValid()) {
|
if (m_donuts[i].IsValid()) {
|
||||||
m_donuts[i].SetLastTime(m_donuts[i].GetLastTime() + delta);
|
m_donuts[i].SetTransformTime(m_donuts[i].GetTransformTime() + delta);
|
||||||
m_donuts[i].SetActorTime(m_donuts[i].GetActorTime() + delta);
|
m_donuts[i].SetActorTime(m_donuts[i].GetActorTime() + delta);
|
||||||
m_donuts[i].SetRotateTimeout(m_donuts[i].GetRotateTimeout() + delta);
|
m_donuts[i].SetRotateTimeout(m_donuts[i].GetRotateTimeout() + delta);
|
||||||
}
|
}
|
||||||
@@ -954,7 +954,7 @@ void Act3::Enable(MxBool p_enable)
|
|||||||
InputManager()->SetWorld(this);
|
InputManager()->SetWorld(this);
|
||||||
InputManager()->Register(this);
|
InputManager()->Register(this);
|
||||||
SetUserActor(m_copter);
|
SetUserActor(m_copter);
|
||||||
m_copter->VTable0xa8();
|
m_copter->ApplyLocal2World();
|
||||||
SetAppCursor(e_cursorArrow);
|
SetAppCursor(e_cursorArrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
Vector4(float* p_data) : Vector3(p_data) {}
|
Vector4(float* p_data) : Vector3(p_data) {}
|
||||||
|
|
||||||
// Some code initializes a Vector4 from a `const float*` source.
|
// Some code initializes a Vector4 from a `const float*` source.
|
||||||
// Example: `LegoCarBuild::VTable0x6c`
|
// Example: `LegoCarBuild::CheckIntersections`
|
||||||
// Vector4 however is a class that can mutate its underlying source, making
|
// Vector4 however is a class that can mutate its underlying source, making
|
||||||
// initialization with a const source fundamentally incompatible.
|
// initialization with a const source fundamentally incompatible.
|
||||||
// BETA10 appears to have two separate constructors for Vector4 as well,
|
// BETA10 appears to have two separate constructors for Vector4 as well,
|
||||||
|
|||||||
Reference in New Issue
Block a user