Isle
Loading...
Searching...
No Matches
legoloopinganimpresenter.cpp
Go to the documentation of this file.
2
3#include "anim/legoanim.h"
5#include "legoworld.h"
7#include "mxdsaction.h"
8#include "mxdssubscriber.h"
9
11
12// FUNCTION: LEGO1 0x1006caa0
13// FUNCTION: BETA10 0x1005223d
14void LegoLoopingAnimPresenter::StreamingTickle()
15{
16 if (m_subscriber->PeekData()) {
17 MxStreamChunk* chunk = m_subscriber->PopData();
18 m_subscriber->FreeDataChunk(chunk);
19 }
20
21 if (m_unk0x95) {
22 ProgressTickleState(e_done);
23 if (m_compositePresenter) {
24 if (m_compositePresenter->IsA("LegoAnimMMPresenter")) {
25 m_compositePresenter->VTable0x60(this);
26 }
27 }
28 }
29 else {
30 if (m_action->GetDuration() != -1) {
31 if (m_action->GetElapsedTime() > m_action->GetDuration() + m_action->GetStartTime()) {
32 m_unk0x95 = TRUE;
33 }
34 }
35 }
36}
37
38// FUNCTION: LEGO1 0x1006cb40
39// FUNCTION: BETA10 0x1005239a
41{
42 MxLong time;
43
46 }
47 else {
48 time = 0;
49 }
50
52
54 for (MxS32 i = 0; i < m_unk0x94; i++) {
55 if (m_unk0x8c[i] != NULL) {
56 MxMatrix mat(m_unk0x8c[i]->GetLocal2World());
57
58 Vector3 pos(mat[0]);
59 Vector3 dir(mat[1]);
60 Vector3 up(mat[2]);
61 Vector3 und(mat[3]);
62
63 float possqr = sqrt(pos.LenSquared());
64 float dirsqr = sqrt(dir.LenSquared());
65 float upsqr = sqrt(up.LenSquared());
66
67 up = und;
68
70 dir /= dirsqr;
71 pos.EqualsCross(dir, up);
72 pos.Unitize();
73 up.EqualsCross(pos, dir);
74 pos *= possqr;
75 dir *= dirsqr;
76 up *= upsqr;
77
78 m_unk0x8c[i]->FUN_100a58f0(mat);
80 }
81 }
82 }
83}
LegoROI ** m_unk0x8c
[AI] Lookup array for secondary ROI objects (used for e.g.
LegoAnim * m_anim
[AI] Animation resource currently being played back.
MxU8 m_unk0x94
[AI] Count of valid camera attached ROI names in m_unk0x90 / m_unk0x8c.
void FUN_1006b9a0(LegoAnim *p_anim, MxLong p_time, Matrix4 *p_matrix)
[AI] Like FUN_1006b900, but also processes associated camera animation if present.
Matrix4 * m_unk0x78
[AI] Pointer to root/offset MxMatrix used for transform computations.
LegoWorld * m_currentWorld
[AI] Reference to the world in which this presenter is currently placed/active.
LegoTime GetDuration()
[AI] Duration (in time units) of the animation.
Definition: legoanim.h:361
Mx3DPointFloat GetWorldLocation()
Gets the camera's current world-space location.
[AI] Presenter for looping animated sequences in the LEGO Island engine.
void PutFrame() override
[AI] Advances animation to the correct frame, applying looping time logic.
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
Definition: legoworld.h:277
MxLong GetStartTime() const
[AI] Gets the nominal start time for the action, as loaded or scheduled.
Definition: mxdsaction.h:198
virtual MxLong GetElapsedTime()
[AI] Gets elapsed time for this action since the last time field 0x90 was set.
Definition: mxdsaction.cpp:159
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for no...
Definition: mxstreamchunk.h:19
virtual void VTable0x14()
[AI] Calls VTable0x1c().
Definition: orientableroi.h:64
void FUN_100a58f0(const Matrix4 &p_transform)
Assigns the given matrix as the local-to-world transformation and enables some internal flags.
virtual int Unitize()
[AI] Scales the vector so its norm is 1 (unit vector).
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
float LenSquared() const override
[AI] Computes the squared magnitude (x^2 + y^2 + z^2) of this vector.
virtual void EqualsCross(const Vector3 &p_a, const Vector3 &p_b)
[AI] Sets this vector to be the cross product of p_a and p_b.
#define TRUE
Definition: d3drmdef.h:28
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
int MxLong
[AI]
Definition: mxtypes.h:83
signed int MxS32
[AI]
Definition: mxtypes.h:38