Isle
Loading...
Searching...
No Matches
legonavcontroller.cpp
Go to the documentation of this file.
1#include "legonavcontroller.h"
2
4#include "act3.h"
5#include "infocenter.h"
9#include "legogamestate.h"
10#include "legoinputmanager.h"
11#include "legolocations.h"
12#include "legomain.h"
13#include "legoplantmanager.h"
14#include "legosoundmanager.h"
15#include "legoutils.h"
16#include "legovideomanager.h"
17#include "legoworld.h"
18#include "misc.h"
20#include "mxdebug.h"
21#include "mxmisc.h"
22#include "mxtimer.h"
23#include "mxtransitionmanager.h"
24#include "mxutilities.h"
25#include "realtime/realtime.h"
28
29#include <vec.h>
30
32
33// MSVC 4.20 didn't define a macro for this key
34#ifndef VK_OEM_MINUS
35#define VK_OEM_MINUS 0xBD
36#endif
37
39
40#ifndef M_PI
41#define M_PI 3.1416
42#endif
43#ifdef DTOR
44#undef DTOR
45#endif
46#define DTOR(angle) ((angle) * M_PI / 180.)
47
49
50// GLOBAL: LEGO1 0x100f4c28
52
53// GLOBAL: LEGO1 0x100f4c2c
55
56// GLOBAL: LEGO1 0x100f4c30
58
59// GLOBAL: LEGO1 0x100f4c34
61
62// GLOBAL: LEGO1 0x100f4c38
64
65// GLOBAL: LEGO1 0x100f4c3c
67
68// GLOBAL: LEGO1 0x100f4c40
70
71// GLOBAL: LEGO1 0x100f4c44
73
74// GLOBAL: LEGO1 0x100f4c48
76
77// GLOBAL: LEGO1 0x100f4c4c
79
80// GLOBAL: LEGO1 0x100f4c50
82
83// GLOBAL: LEGO1 0x100f4c54
85
86// GLOBAL: LEGO1 0x100f66a0
88
89// GLOBAL: LEGO1 0x100f66a4
91
92// GLOBAL: LEGO1 0x100f66a8
94
95// GLOBAL: LEGO1 0x100f66ac
97
98// GLOBAL: LEGO1 0x100f66b0
100
101// GLOBAL: LEGO1 0x100f66b4
103
104// GLOBAL: LEGO1 0x100f66b8
106
107// GLOBAL: LEGO1 0x100f66bc
109
110// GLOBAL: LEGO1 0x100f66c0
111char g_debugPassword[] = "OGEL";
112
113// GLOBAL: LEGO1 0x100f66c8
115
116// GLOBAL: LEGO1 0x100f66cc
118
119// GLOBAL: LEGO1 0x100f66d0
121
122// GLOBAL: LEGO1 0x100f66d4
124
125// FUNCTION: LEGO1 0x10054ac0
127{
129
130 m_linearVel = 0.0f;
131 m_rotationalVel = 0.0f;
132 m_targetLinearVel = 0.0f;
134 m_linearAccel = 0.0f;
135 m_rotationalAccel = 0.0f;
139 m_unk0x64 = 0.0f;
140 m_unk0x68 = 0.0f;
141 m_unk0x60 = 0.0f;
142
143 m_lastTime = Timer()->GetTime();
144
145 InputManager()->Register(this);
146}
147
148// FUNCTION: LEGO1 0x10054c30
150{
151 InputManager()->UnRegister(this);
152}
153
154// FUNCTION: LEGO1 0x10054ca0
155void LegoNavController::SetControlMax(int p_hMax, int p_vMax)
156{
157 m_hMax = p_hMax;
158 m_vMax = p_vMax;
159
160 if (VideoManager()->GetVideoParam().Flags().GetFullScreen()) {
161 m_hMax = 640;
162 m_vMax = 480;
163 }
164}
165
166// FUNCTION: LEGO1 0x10054cd0
167// FUNCTION: BETA10 0x1009ad76
169{
182}
183
184// FUNCTION: LEGO1 0x10054d40
186 int* p_dz,
187 float* p_lv,
188 float* p_rv,
189 float* p_la,
190 float* p_ra,
191 float* p_ld,
192 float* p_rd,
193 float* p_lmina,
194 float* p_rmina,
195 float* p_rs,
196 MxBool* p_urs
197)
198{
199 *p_dz = g_defdeadZone;
200 *p_lv = g_defmaxLinearVel;
201 *p_rv = g_defmaxRotationalVel;
202 *p_la = g_defmaxLinearAccel;
204 *p_ld = g_defmaxLinearDeccel;
206 *p_lmina = g_defminLinearAccel;
207 *p_rmina = g_defminRotationalAccel;
208 *p_rs = g_defrotSensitivity;
209 *p_urs = g_defuseRotationalVel;
210}
211
212// FUNCTION: LEGO1 0x10054dd0
214 int p_dz,
215 float p_lv,
216 float p_rv,
217 float p_la,
218 float p_ra,
219 float p_ld,
220 float p_rd,
221 float p_lmina,
222 float p_rmina,
223 float p_rs,
224 MxBool p_urs
225)
226{
227 g_defdeadZone = p_dz;
228 g_defmaxLinearVel = p_lv;
230 g_defmaxLinearAccel = p_la;
234 g_defminLinearAccel = p_lmina;
235 g_defminRotationalAccel = p_rmina;
236 g_defrotSensitivity = p_rs;
237 g_defuseRotationalVel = p_urs;
238}
239
240// FUNCTION: LEGO1 0x10054e40
241void LegoNavController::SetTargets(int p_hPos, int p_vPos, MxBool p_accel)
242{
243 if (m_trackDefault != FALSE) {
245 }
246
247 if (p_accel != FALSE) {
252 }
253 else {
258 }
259}
260
261// FUNCTION: LEGO1 0x10054f10
262float LegoNavController::CalculateNewTargetVel(int p_pos, int p_center, float p_max)
263{
264 float newVel;
265 int diff = p_pos - p_center;
266
267 if (diff > m_deadZone) {
268 newVel = (diff - m_deadZone) * p_max / (p_center - m_deadZone);
269 }
270 else if (diff < -m_deadZone) {
271 newVel = (diff + m_deadZone) * p_max / (p_center - m_deadZone);
272 }
273 else {
274 newVel = 0.0;
275 }
276
277 return newVel;
278}
279
280// FUNCTION: LEGO1 0x10054f90
281float LegoNavController::CalculateNewAccel(int p_pos, int p_center, float p_max, int p_min)
282{
283 float newAccel;
284 int diff = p_pos - p_center;
285
286 newAccel = Abs(diff) * p_max / p_center;
287
288 if (newAccel < p_min) {
289 newAccel = (float) p_min;
290 }
291
292 return newAccel;
293}
294
295// FUNCTION: LEGO1 0x10054fe0
296float LegoNavController::CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time)
297{
298 float newVel = p_currentVel;
299
300 float velDiff = p_targetVel - p_currentVel;
301 int vSign = velDiff > 0 ? 1 : -1;
302
303 if (Abs(velDiff) > m_zeroThreshold) {
304 float deltaVel = p_accel * p_time;
305 newVel = p_currentVel + (deltaVel * vSign);
306
307 if (vSign > 0) {
308 newVel = Min(newVel, p_targetVel);
309 }
310 else {
311 newVel = Max(newVel, p_targetVel);
312 }
313 }
314
315 return newVel;
316}
317
318// FUNCTION: LEGO1 0x10055080
319// FUNCTION: BETA10 0x1009b26b
321 const Vector3& p_curPos,
322 const Vector3& p_curDir,
323 Vector3& p_newPos,
324 Vector3& p_newDir,
325 const Vector3* p_und
326)
327{
328 if (!g_isWorldActive) {
329 return FALSE;
330 }
331
332 MxBool changed = FALSE;
333 MxBool und = FALSE;
334
335 MxTime currentTime = Timer()->GetTime();
336 float deltaTime = (currentTime - m_lastTime) / 1000.0;
337 m_lastTime = currentTime;
338
339 if (ProcessKeyboardInput() == FAILURE) {
341 }
342
343 if (m_useRotationalVel) {
345 }
346 else {
348 }
349
351
353 float rot_mat[3][3];
354 Mx3DPointFloat delta_pos, new_dir, new_pos;
355
356 if (m_linearVel < -(m_maxLinearVel * 0.4f)) {
357 m_linearVel = -(m_maxLinearVel * 0.4f);
358 }
359
360 VXS3(delta_pos, p_curDir, m_linearVel * deltaTime);
361 VPV3(p_newPos, p_curPos, delta_pos);
362
363 float delta_rad;
364 if (m_useRotationalVel) {
365 delta_rad = DTOR(m_rotationalVel * deltaTime);
366 }
367 else {
369 }
370
371 if (p_und != NULL && (*p_und)[1] < 0.0f) {
372 delta_rad = -delta_rad;
373 }
374
375 IDENTMAT3(rot_mat);
376 rot_mat[0][0] = rot_mat[2][2] = cos(delta_rad);
377 rot_mat[0][2] = rot_mat[2][0] = sin(delta_rad);
378 rot_mat[0][2] *= -1.0f;
379 VXM3(p_newDir, p_curDir, rot_mat);
380
381 changed = TRUE;
382 }
383
384 if (m_unk0x5d) {
385 float rot_mat[3][3];
386 Mx3DPointFloat delta_pos, new_pos, new_dir;
387
388 if (changed) {
389 SET3(new_pos, p_newPos);
390 SET3(new_dir, p_newDir);
391 }
392 else {
393 SET3(new_pos, p_curPos);
394 SET3(new_dir, p_curDir);
395 }
396
397 if (m_unk0x64 != 0.0f) {
398 delta_pos[0] = new_dir[0] * m_unk0x64;
399 delta_pos[1] = new_dir[1] * m_unk0x64;
400 delta_pos[2] = new_dir[2] * m_unk0x64;
401 }
402 else {
403 FILLVEC3(delta_pos, 0.0f);
404 }
405
406 delta_pos[1] += m_unk0x60;
407 VPV3(p_newPos, new_pos, delta_pos);
408
409 if (m_unk0x68 != 0.0f) {
410 float delta_rad = DTOR(m_unk0x68);
411 IDENTMAT3(rot_mat);
412 rot_mat[0][0] = rot_mat[2][2] = cos(delta_rad);
413 rot_mat[0][2] = rot_mat[2][0] = sin(delta_rad);
414 rot_mat[0][2] *= -1.0f;
415 VXM3(p_newDir, new_dir, rot_mat);
416 }
417 else {
418 SET3(p_newDir, new_dir);
419 }
420
421 m_unk0x60 = m_unk0x64 = m_unk0x68 = 0.0f;
423 changed = TRUE;
424 }
425
426 return changed;
427}
428
429// FUNCTION: LEGO1 0x10055500
430// FUNCTION: BETA10 0x1009bff8
432{
433 MxResult result = FAILURE;
434
435 for (MxS32 i = 0; i < (MxS32) sizeOfArray(g_locations); i++) {
436 if (!strcmpi(p_location, g_locations[i].m_name)) {
437 MxMatrix mat;
438 LegoROI* viewROI = VideoManager()->GetViewROI();
439
440 CalcLocalTransform(g_locations[i].m_position, g_locations[i].m_direction, g_locations[i].m_up, mat);
441
442 Mx3DPointFloat vec;
443 vec.Clear();
444
445 viewROI->FUN_100a5a30(vec);
446 viewROI->WrappedSetLocalTransform(mat);
447 VideoManager()->Get3DManager()->Moved(*viewROI);
448
450 viewROI->GetWorldPosition(),
451 viewROI->GetWorldDirection(),
452 viewROI->GetWorldUp(),
453 viewROI->GetWorldVelocity()
454 );
455
456 result = SUCCESS;
457 }
458 }
459
460 return result;
461}
462
463// FUNCTION: LEGO1 0x10055620
464// FUNCTION: BETA10 0x1009c145
466{
467 MxResult result = FAILURE;
468
469 if (p_location < sizeOfArray(g_locations)) {
470 MxMatrix mat;
471 LegoROI* viewROI = VideoManager()->GetViewROI();
472
474 g_locations[p_location].m_position,
475 g_locations[p_location].m_direction,
476 g_locations[p_location].m_up,
477 mat
478 );
479
480 Mx3DPointFloat vec;
481 vec.Clear();
482
483 viewROI->FUN_100a5a30(vec);
484 viewROI->WrappedSetLocalTransform(mat);
485 VideoManager()->Get3DManager()->Moved(*viewROI);
486
488 viewROI->GetWorldPosition(),
489 viewROI->GetWorldDirection(),
490 viewROI->GetWorldUp(),
491 viewROI->GetWorldVelocity()
492 );
493
494 result = SUCCESS;
495 }
496
497 return result;
498}
499
500// FUNCTION: LEGO1 0x10055720
501// FUNCTION: BETA10 0x1009c259
503{
504 if (p_location < sizeOfArray(g_locations)) {
505 return &g_locations[p_location];
506 }
507
508 return NULL;
509}
510
511// FUNCTION: LEGO1 0x10055740
513{
514 return sizeOfArray(g_locations);
515}
516
517// FUNCTION: LEGO1 0x10055750
519{
520 LegoOmni* instance = LegoOmni::GetInstance();
521
522 if (instance->GetInputManager()) {
523 MxS32 joystickX;
524 MxS32 joystickY;
525 DWORD buttonState;
526 MxS32 povPosition;
527
528 if (instance->GetInputManager()
529 ->GetJoystickState((MxU32*) &joystickX, (MxU32*) &joystickY, &buttonState, (MxU32*) &povPosition) !=
530 FAILURE) {
531 MxU32 yVal = (joystickY * m_vMax) / 100;
532 MxU32 xVal = (joystickX * m_hMax) / 100;
533
534 if (joystickX <= 45 || joystickX >= 55 || joystickY <= 45 || joystickY >= 55) {
540 }
541 else {
543 m_targetLinearVel = 0.0;
546 }
547
548 if (povPosition >= 0) {
549 LegoWorld* world = CurrentWorld();
550
551 if (world && world->GetCameraController()) {
552 world->GetCameraController()->FUN_10012320(DTOR(povPosition));
553 p_und = TRUE;
554 }
555 }
556
557 return SUCCESS;
558 }
559 }
560
561 return FAILURE;
562}
563
564// FUNCTION: LEGO1 0x100558b0
566{
567 MxBool skipRotationVelAndAccelCalc = FALSE;
568 MxBool skipLinearVelAndAccelCalc = FALSE;
570 MxU32 keyFlags;
571
572 if (inputManager == NULL || inputManager->GetNavigationKeyStates(keyFlags) == FAILURE) {
573 return FAILURE;
574 }
575
576 if (keyFlags == 0) {
577 if (m_isAccelerating) {
579 m_targetLinearVel = 0.0;
583 }
584
585 return FAILURE;
586 }
587
589
590 MxS32 hMax;
591 switch (keyFlags & LegoInputManager::c_leftOrRight) {
593 hMax = 0;
594 break;
596 hMax = m_hMax;
597 break;
598 default:
601 skipRotationVelAndAccelCalc = TRUE;
602 break;
603 }
604
605 MxS32 vMax;
606 switch (keyFlags & LegoInputManager::c_upOrDown) {
608 vMax = 0;
609 break;
611 vMax = m_vMax;
612 break;
613 default:
614 m_targetLinearVel = 0.0;
616 skipLinearVelAndAccelCalc = TRUE;
617 break;
618 }
619
620 MxFloat maxAccelDivisor = keyFlags & LegoInputManager::c_ctrl ? 1.0f : 4.0f;
621 MxFloat minAccelDivisor = keyFlags & LegoInputManager::c_ctrl ? 1.0f : 2.0f;
622
623 if (!skipRotationVelAndAccelCalc) {
626 hMax,
627 m_hMax / 2,
628 m_maxRotationalAccel / maxAccelDivisor,
629 (int) (m_minRotationalAccel / minAccelDivisor)
630 );
631 }
632
633 if (!skipLinearVelAndAccelCalc) {
636 m_vMax - vMax,
637 m_vMax / 2,
638 m_maxLinearAccel / maxAccelDivisor,
639 (int) (m_minLinearAccel / minAccelDivisor)
640 );
641 }
642
643 return SUCCESS;
644}
645
646// FUNCTION: LEGO1 0x10055a60
647// FUNCTION: BETA10 0x1009c712
649{
650 if (((MxNotificationParam&) p_param).GetNotification() == c_notificationKeyPress) {
651 m_unk0x5d = TRUE;
652 MxU8 key = ((LegoEventNotificationParam&) p_param).GetKey();
653
654 switch (key) {
655 case VK_PAUSE: // Pause game
656 if (Lego()->IsPaused()) {
657 Lego()->Resume();
658 }
659 else {
660 Lego()->Pause();
661 }
662 break;
663 case VK_ESCAPE: { // Return to infocenter
664 LegoWorld* currentWorld = CurrentWorld();
665 if (currentWorld != NULL) {
666 InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState");
667 assert(state);
668
669 if (state != NULL && state->m_unk0x74 != 8 && currentWorld->Escape()) {
672 state->m_unk0x74 = 8;
673 }
674 }
675 break;
676 }
677 case VK_SPACE: // Interrupt/end animations or free navigation
679 break;
680 case 'Z': { // Make nearby plants "dance"
681 LegoOmni* omni = Lego();
682
683 if (omni->GetCurrentWorld() != NULL && omni->GetCurrentWorld()->GetWorldId() == LegoOmni::e_act1) {
685 ViewROI* roi = videoMgr->GetViewROI();
686 ViewManager* view = videoMgr->Get3DManager()->GetLego3DView()->GetViewManager();
688 Mx3DPointFloat viewPosition(roi->GetWorldPosition());
689 MxS32 numPlants = plantMgr->GetNumPlants();
690
691 for (MxS32 i = 0; i < numPlants; i++) {
692 LegoEntity* entity = plantMgr->CreatePlant(i, NULL, LegoOmni::e_act1);
693
694 if (entity != NULL && !entity->GetUnknown0x10IsSet(LegoEntity::c_altBit1)) {
695 LegoROI* roi = entity->GetROI();
696
697 if (roi != NULL && roi->GetVisibility()) {
698 const BoundingBox& box = roi->GetWorldBoundingBox();
699
700 if (view->IsBoundingBoxInFrustum(box)) {
701 Mx3DPointFloat roiPosition(roi->GetWorldPosition());
702 roiPosition -= viewPosition;
703
704 if (roiPosition.LenSquared() < 2000.0 || roi->GetUnknown0xe0() > 0) {
705 entity->ClickAnimation();
706 }
707 }
708 }
709 }
710 }
711 }
712 break;
713 }
714 case VK_ADD:
715 case VK_SUBTRACT: { // Cycles through characters and puts them in front of you
716 if (g_nextCharacter == -1) {
717 g_nextCharacter = 0;
718 }
719 else {
721
722 if (key == VK_ADD) {
724 if (g_nextCharacter >= CharacterManager()->GetNumActors()) {
725 g_nextCharacter = 0;
726 }
727 }
728 else {
730 if (g_nextCharacter < 0) {
732 }
733 }
734 }
735
737 if (roi != NULL) {
738 MxMatrix mat;
740 const float* position = viewRoi->GetWorldPosition();
741 const float* direction = viewRoi->GetWorldDirection();
742 const float* up = viewRoi->GetWorldUp();
743 CalcLocalTransform(position, direction, up, mat);
744 mat.TranslateBy(direction[0] * 2.0f, direction[1] - 1.0, direction[2] * 2.0f);
746 }
747 break;
748 }
749 case VK_F12: { // Saves the game
750 InfocenterState* state = (InfocenterState*) GameState()->GetState("InfocenterState");
751 if (state && state->HasRegistered()) {
752 GameState()->Save(0);
753 }
754 break;
755 }
756 default:
757 // Check if the the key is part of the debug password
758 if (!*g_currentInput) {
759 // password "protected" debug shortcuts
760 switch (((LegoEventNotificationParam&) p_param).GetKey()) {
761 case VK_TAB:
763 if (g_fpsEnabled) {
765 }
766 else {
768 }
769 default:
771 break;
772 case '0':
773 case '1':
774 case '2':
775 case '3':
776 case '4':
777 case '5':
778 case '6':
779 case '7':
780 case '8':
781 case '9':
782 if (g_changeLight && key <= '1') {
783 LegoROI* roi = VideoManager()->GetViewROI();
784 Tgl::FloatMatrix4 matrix;
785 Matrix4 in(matrix);
786 roi->GetLocalTransform(in);
787 VideoManager()->Get3DManager()->GetLego3DView()->SetLightTransform(key - '0', matrix);
789 }
790 else if (g_locationCalcStep) {
791 if (g_locationCalcStep == 1) {
792 // Calculate base offset into g_locations
793 g_nextLocation = (key - '0') * 10;
795 }
796 else {
797 // Add to base g_locations offset
798 g_nextLocation += key - '0';
801 }
802 }
803 else if (g_animationCalcStep) {
804 if (g_animationCalcStep == 1) {
805 // Calculate base offset into possible animation object IDs (up to 999)
806 g_nextAnimation = (key - '0') * 100;
808 }
809 else if (g_animationCalcStep == 2) {
810 // Add to animation object ID offset
811 g_nextAnimation += (key - '0') * 10;
813 }
814 else {
815 // Add to animation object ID offset
816 g_nextAnimation += key - '0';
820 NULL,
821 TRUE,
823 NULL,
824 TRUE,
825 TRUE,
826 TRUE,
827 TRUE
828 );
829
831 }
832 }
833
834 if (g_switchAct && key >= '1' && key <= '5') {
835 switch (GameState()->GetCurrentAct()) {
838 break;
841 break;
844 break;
845 }
846
847 switch (key) {
848 case '1':
851 break;
852 case '2':
854 break;
855 case '3':
857 break;
858 case '4': {
859 Act3State* act3State = (Act3State*) GameState()->GetState("Act3State");
860 if (act3State == NULL) {
861 act3State = new Act3State();
862 assert(act3State);
863 GameState()->RegisterState(act3State);
864 }
865
867 act3State->m_unk0x08 = 2;
870 break;
871 }
872 case '5': {
873 Act3State* act3State = (Act3State*) GameState()->GetState("Act3State");
874 if (act3State == NULL) {
875 act3State = new Act3State();
876 assert(act3State);
877 GameState()->RegisterState(act3State);
878 }
879
881 act3State->m_unk0x08 = 3;
884 break;
885 }
886 }
887
889 }
890 else {
891 MxDSAction action;
892 action.SetObjectId(key - '0');
893 action.SetAtomId(MxAtomId("q:\\lego\\media\\model\\common\\common", e_lowerCase2));
894 LegoOmni::GetInstance()->Start(&action);
895 }
896 break;
897 case 'A':
898 if (g_animationCalcStep == 1) {
899 Lego()->m_unk0x13c = TRUE;
902 }
903 else {
904 LegoWorld* world = CurrentWorld();
905 if (world != NULL) {
906 MxDSAction action;
907 action.SetObjectId(1);
908 action.SetAtomId(world->GetAtomId());
909 LegoOmni::GetInstance()->Start(&action);
910 }
911 }
912 break;
913 case 'C':
915 break;
916 case 'D':
917 m_unk0x60 = -1.0;
918 break;
919 case 'F':
921 break;
922 case 'G':
924 break;
925 case 'H':
927 break;
928 case 'I': {
929 LegoROI* roi = VideoManager()->GetViewROI();
930 MxMatrix mat;
931 mat.SetIdentity();
932 mat.RotateX(0.2618f);
933 roi->WrappedVTable0x24(mat);
934 break;
935 }
936 case 'J': {
937 LegoROI* roi = VideoManager()->GetViewROI();
938 MxMatrix mat;
939 mat.SetIdentity();
940 mat.RotateZ(0.2618f);
941 roi->WrappedVTable0x24(mat);
942 break;
943 }
944 case 'K': {
945 MxMatrix mat;
947 mat.SetIdentity();
948 mat.RotateZ(-0.2618f);
949 roi->WrappedVTable0x24(mat);
950 break;
951 }
952 case 'L':
954 break;
955 case 'M': {
957 MxMatrix mat;
958 mat.SetIdentity();
959 mat.RotateX(-0.2618f);
960 roi->WrappedVTable0x24(mat);
961 break;
962 }
963 case 'N':
964 if (VideoManager()) {
965 VideoManager()->SetRender3D(!VideoManager()->GetRender3D());
966 }
967 break;
968 case 'P':
969 if (!g_resetPlants) {
972 }
973 else {
976 }
977 break;
978 case 'S':
981 break;
982 case 'U':
983 m_unk0x60 = 1.0;
984 break;
985 case 'V':
986 if (g_nextAnimation > 0 && g_animationCalcStep == 0) {
988 }
989
990 if (g_animationCalcStep != 0) {
992 }
993
994 g_nextAnimation = 0;
996 break;
997 case 'W': {
998 MxMatrix mat;
1000 const float* position = roi->GetWorldPosition();
1001 const float* direction = roi->GetWorldDirection();
1002 const float* up = roi->GetWorldUp();
1003
1004 MxTrace(
1005 "pos: %f, %f, %f\ndir: %f, %f, %f\nup: %f, %f, %f\n",
1006 EXPAND3(position),
1007 EXPAND3(direction),
1008 EXPAND3(up)
1009 );
1010 break;
1011 }
1012 case 'X':
1014 break;
1015 case VK_MULTIPLY: {
1016 MxU8 newActor = GameState()->GetActorId() + 1;
1017
1018 if (newActor > LegoActor::c_laura) {
1019 newActor = LegoActor::c_pepper;
1020 }
1021
1022 GameState()->SetActorId(newActor);
1023 break;
1024 }
1025 case VK_DIVIDE:
1027 break;
1028 case VK_F11:
1029 if (GameState()->m_isDirty) {
1031 }
1032 else {
1034 }
1035 break;
1036 case VK_OEM_MINUS:
1038 break;
1039 }
1040 }
1041 else {
1042 if (*g_currentInput == ((LegoEventNotificationParam&) p_param).GetKey()) {
1044 }
1045 else {
1047 }
1048 }
1049 }
1050 }
1051
1052 return 0;
1053}
[AI] Holds persistent state and status variables for Act 3 mission, saved between world reloads and p...
Definition: act3.h:126
undefined4 m_unk0x08
[AI] Unknown persistent field holding an instruction/state flag.
Definition: act3.h:170
[AI] Represents an axis-aligned bounding box in 3D space, using minimum and maximum points.
Definition: roi.h:20
[AI] Represents the state of the Infocenter area, storing scripts, dialogue playlists and UI letter p...
Definition: infocenter.h:23
MxBool HasRegistered()
[AI] True if any letter slot is filled (indicating the player has registered).
Definition: infocenter.h:83
MxU32 m_unk0x74
[AI] State machine variable tracking the Infocenter flow (e.g., 0=intro, 3=NA, 4=goto book,...
Definition: infocenter.h:149
BOOL Moved(ViewROI &rROI)
[AI] Notifies the manager that the ROI has moved and needs spatial update.
Lego3DView * GetLego3DView()
[AI] Returns the encapsulated Lego3DView instance.
ViewManager * GetViewManager()
[AI] Returns the ViewManager responsible for managing scene objects and transformations.
Definition: lego3dview.h:154
@ c_laura
Laura ([AI])
Definition: legoactor.h:21
@ c_brickster
The Brickster ([AI])
Definition: legoactor.h:22
@ c_pepper
Pepper Roni ([AI])
Definition: legoactor.h:17
MxResult FUN_10060dc0(MxU32 p_objectId, MxMatrix *p_matrix, MxBool p_param3, MxU8 p_param4, LegoROI *p_roi, MxBool p_param6, MxBool p_param7, MxBool p_param8, MxBool p_param9)
[AI] Helper for starting a specific animation, including world matrix and camera settings.
void FUN_10061010(MxBool p_und)
[AI] Cancels all camera/transition animations and resets camera after completion.
PlayMode
[AI] Animation play modes, possibly for controlling explicit or random playback.
@ e_unk1
[AI] Unknown/unspecified play mode
@ e_unk2
[AI] Unknown/unspecified play mode
void FUN_10060570(MxBool p_unk0x1a)
[AI] Sets whether the manager should immediately trigger camera transition animations in quick succes...
void FUN_10012320(float p_angle)
Rotates the current camera transformation by a given angle around the Y axis.
MxU32 GetNumActors()
[AI] Returns the number of actors registered in global g_actorInfo.
void ReleaseActor(const char *p_name)
[AI] Releases a character/ROI by name, decrementing its reference count and deleting if zero.
LegoROI * GetActorROI(const char *p_name, MxBool p_createEntity)
[AI] Returns a LegoROI for the given character name, creating and registering the actor if necessary.
[AI] Represents an entity that can be placed and managed in the LEGO Island world.
Definition: legoentity.h:16
MxBool GetUnknown0x10IsSet(MxU8 p_flag)
[AI] Checks if a bit flag in m_unk0x10 is set (purpose: state/animation suppression lock).
Definition: legoentity.h:148
LegoROI * GetROI()
[AI] Gets the ROI (Realtime Object Instance) associated with this entity. [AI]
Definition: legoentity.h:161
@ c_altBit1
[AI] Used to prevent repeat sound/animation actions while one is in progress [AI]
Definition: legoentity.h:35
virtual void ClickAnimation()
[AI] Plays a context-sensitive click animation, driven by current entity type and state....
Definition: legoentity.cpp:298
Notification parameter class for LEGO event notifications such as mouse events and modifier keys.
void SwitchArea(Area p_area)
Switches the whole game state into a new area/world; manages transitions/scene loads.
void SetCurrentAct(Act p_currentAct)
Sets the current game act.
Area m_currentArea
Area/world the player is presently in. [AI].
MxBool m_isDirty
TRUE if unsaved changes present. [AI].
void SetActorId(MxU8 p_actorId)
Directly sets the current actor ID (preferred: use SetActor).
@ e_act3
Act 3: final main story segment. [AI].
Definition: legogamestate.h:86
@ e_act1
Act 1: the first main segment of the game. [AI].
Definition: legogamestate.h:84
@ e_act2
Act 2: main story segment two. [AI].
Definition: legogamestate.h:85
void RegisterState(LegoState *p_state)
Registers a state object, replacing by class if already present.
MxU8 GetActorId()
Returns the current selected actor ID. [AI].
MxResult Save(MxULong p_slot)
Saves persistent game state (world variables, actor, etc.) to a file slot.
LegoState * GetState(const char *p_stateName)
Find an existing state (LegoState-derived) object by its registered script/class name.
@ e_infomain
Information Center, main screen. [AI].
Definition: legogamestate.h:96
@ e_act3script
Act 3 world/script main. [AI].
@ e_act2main
Act 2 world main screen. [AI].
@ e_isle
Open world (LEGO Island main map). [AI].
Definition: legogamestate.h:95
[AI] Handles keyboard, mouse, and joystick input for the game.
MxResult GetNavigationKeyStates(MxU32 &p_keyFlags)
[AI] Retrieves current navigation (arrow) key status from the keyboard, combining keypad and arrow ke...
void UnRegister(MxCore *)
[AI] Unregister a previously registered recipient so it will no longer receive input notifications.
MxResult GetJoystickState(MxU32 *p_joystickX, MxU32 *p_joystickY, DWORD *p_buttonsState, MxU32 *p_povPosition)
[AI] Retrieve state of the currently assigned joystick device and normalized position/button state.
@ c_up
[AI] Up arrow key or equivalent key [AI]
@ c_left
[AI] Left arrow key or equivalent key [AI]
@ c_right
[AI] Right arrow key or equivalent key [AI]
@ c_ctrl
[AI] Control key [AI]
@ c_down
[AI] Down arrow key or equivalent key [AI]
@ c_upOrDown
[AI] Combo: up or down arrow [AI]
@ c_leftOrRight
[AI] Combo: left or right arrow [AI]
void Register(MxCore *)
[AI] Register a core object as a recipient for keyboard events; safe for concurrent multi-threading.
[AI] Handles user navigation input (keyboard and joystick) and determines avatar movement and directi...
int m_vMax
[AI] Current vertical axis control maximum (e.g., 480 for screen height).
float m_maxRotationalDeccel
[AI] Maximum allowed rotational deceleration.
MxResult ProcessJoystickInput(MxBool &p_und)
[AI] Processes current joystick/gamepad input and updates navigation targets and accelerations.
float m_maxLinearVel
[AI] Maximum allowed linear velocity.
void SetTargets(int p_hPos, int p_vPos, MxBool p_accel)
[AI] Set the horizontal/vertical target positions from input and optionally apply acceleration/dynami...
LegoNavController()
[AI] Constructs a navigation controller and registers it for input processing.
MxResult ProcessKeyboardInput()
[AI] Reads and processes keyboard navigation input to update velocity/acceleration targets.
float CalculateNewTargetVel(int p_pos, int p_center, float p_max)
[AI] Translates control position into a new target velocity, applying deadzone and centering logic.
static float g_defminLinearAccel
[AI] Application-global default min linear acceleration.
static MxS32 GetNumLocations()
[AI] Static: Retrieves the number of named locations registered in the navigation system.
float m_maxRotationalVel
[AI] Maximum allowed rotational velocity.
static LegoLocation * GetLocation(MxU32 p_location)
[AI] Static: Retrieves the pointer to a LegoLocation struct by its index.
float m_rotationalVel
[AI] Current rotational velocity.
static float g_defminRotationalAccel
[AI] Application-global default min rotational acceleration.
static void GetDefaults(int *p_dz, float *p_lv, float *p_rv, float *p_la, float *p_ra, float *p_ld, float *p_rd, float *p_lmina, float *p_rmina, float *p_rs, MxBool *p_urs)
[AI] Static: Retrieves current global default navigation parameter values.
static float g_defmaxLinearDeccel
[AI] Application-global default max linear deceleration.
MxBool m_unk0x5d
[AI] Indicates that Notify() should inject a one-time movement/turn based on special debug or event t...
static float g_defrotSensitivity
[AI] Application-global default rotation sensitivity.
static float g_defzeroThreshold
[AI] Application-global default zero threshold value.
MxBool m_useRotationalVel
[AI] If TRUE, rotation is determined by velocity (dynamic turning); if FALSE, snaps turn instantly.
static float g_defmaxRotationalVel
[AI] Application-global default max rotational velocity.
MxBool m_isAccelerating
[AI] TRUE if last input was an active movement/acceleration (vs.
void SetControlMax(int p_hMax, int p_vMax)
[AI] Set limits for horizontal and vertical input controls, typically reflecting window/screen size.
float m_minRotationalAccel
[AI] Minimum allowed rotational acceleration.
void SetToDefaultParams()
[AI] Resets current navigation parameters to globally set defaults.
static float g_defmaxRotationalAccel
[AI] Application-global default max rotational acceleration.
float m_unk0x68
[AI] [Usage: debug/direct movement] Rotational offset (degrees), to next direction vector after Notif...
float CalculateNewVel(float p_targetVel, float p_currentVel, float p_accel, float p_time)
[AI] Calculates the next velocity given a target velocity, current velocity, acceleration,...
~LegoNavController() override
[AI] Destroys the controller and unregisters it from input processing.
float m_minLinearAccel
[AI] Minimum allowed linear acceleration.
float m_rotationalAccel
[AI] Current rotational acceleration used to interpolate rotational velocity.
static MxResult UpdateLocation(MxU32 p_location)
[AI] Static: Changes the current world/camera location to the specified index in the location registr...
MxBool m_trackDefault
[AI] TRUE if navigation parameters should match the application defaults; FALSE to allow per-instance...
float m_maxLinearDeccel
[AI] Maximum allowed linear deceleration (negative accel).
float m_maxLinearAccel
[AI] Maximum allowed linear acceleration.
static float g_defmaxLinearVel
[AI] Application-global default max linear velocity.
static float g_defmaxRotationalDeccel
[AI] Application-global default max rotational deceleration.
int m_deadZone
[AI] Deadzone value; minimum distance input must be from axis center to register as movement.
float m_targetLinearVel
[AI] Target value for linear velocity, used for acceleration smoothing.
MxBool CalculateNewPosDir(const Vector3 &p_curPos, const Vector3 &p_curDir, Vector3 &p_newPos, Vector3 &p_newDir, const Vector3 *p_und)
[AI] Calculates the new position and direction vectors based on input, current velocity,...
static int g_defdeadZone
[AI] Application-global default deadzone value.
float m_rotSensitivity
[AI] Sensitivity multiplier for rotation (applies if useRotationalVel is FALSE).
MxTime m_lastTime
[AI] Tracks time of the last navigation tick for smooth movement with deltaTime.
static void SetDefaults(int p_dz, float p_lv, float p_rv, float p_la, float p_ra, float p_ld, float p_rd, float p_lmina, float p_rmina, float p_rs, MxBool p_urs)
[AI] Static: Sets new global defaults for navigation parameters.
int m_hMax
[AI] Current horizontal axis control maximum (e.g., 640 for screen width).
float m_unk0x64
[AI] [Usage: debug/direct movement] Linear velocity applied to next position after Notify key event.
float CalculateNewAccel(int p_pos, int p_center, float p_max, int p_min)
[AI] Computes new acceleration value based on position, axis center, maximum and minimum acceleration...
float m_targetRotationalVel
[AI] Target value for rotational velocity, used for smoothing.
float m_maxRotationalAccel
[AI] Maximum allowed rotational acceleration.
float m_linearVel
[AI] Current linear velocity.
static float g_defmaxLinearAccel
[AI] Application-global default max linear acceleration.
float m_zeroThreshold
[AI] Threshold below which movements are considered negligible/zero.
MxLong Notify(MxParam &p_param) override
[AI] Responds to notifications, including keypresses and special debug shortcuts for avatar control,...
float m_unk0x60
[AI] [Usage: debug/direct movement] Y-offset applied to next position after Notify key event.
float m_linearAccel
[AI] Current linear acceleration used to interpolate linear velocity.
static MxBool g_defuseRotationalVel
[AI] Application-global default for useRotationalVel.
[AI] Central hub singleton for the LEGO Island game engine, managing all core game systems,...
Definition: legomain.h:40
MxResult Start(MxDSAction *p_dsAction) override
[AI] Begins executing the specified DSAction/script in the context of the current world/state.
Definition: legomain.cpp:548
LegoPlantManager * GetPlantManager()
[AI] Returns active plant manager, which tracks in-world plants/objects.
Definition: legomain.h:389
void Resume() override
[AI] Resumes engine/game state and sets default cursor.
Definition: legomain.cpp:593
static LegoOmni * GetInstance()
[AI] Returns the current LegoOmni singleton pointer, cast from MxOmni.
Definition: legomain.cpp:305
LegoInputManager * GetInputManager()
[AI] Returns the input manager.
Definition: legomain.h:353
@ e_act1
[AI] Act 1 main world. [AI]
Definition: legomain.h:59
LegoVideoManager * GetVideoManager()
[AI] Returns the active video manager, cast to LegoVideoManager.
Definition: legomain.h:341
LegoWorld * GetCurrentWorld()
[AI] Returns the pointer to the currently active world.
Definition: legomain.h:371
MxBool m_unk0x13c
[AI] Unknown flag used in rare start-action cases. [AI]
Definition: legomain.h:504
void Pause() override
[AI] Pauses the engine/game state and sets busy cursor.
Definition: legomain.cpp:586
[AI] Manages the lifecycle, state, and properties for all plant objects (flowers, trees,...
LegoEntity * CreatePlant(MxS32 p_index, LegoWorld *p_world, LegoOmni::World p_worldId)
[AI] Instantiates an entity and ROI for the plant at given index in world (if appropriate).
void LoadWorldInfo(LegoOmni::World p_worldId)
[AI] Loads all plant objects/entities for the requested world, instantiates requisite ROIs and entiti...
MxS32 GetNumPlants()
[AI] Returns the total number of plant records referenced by this manager.
void Reset(LegoOmni::World p_worldId)
[AI] Completely resets (removes) all plant objects for the supplied world.
[AI] Represents a Real-time Object Instance enriched with LEGO-specific functionality.
Definition: legoroi.h:43
void UpdateListener(const float *p_position, const float *p_direction, const float *p_up, const float *p_velocity)
[AI] Updates the 3D sound listener properties in DirectSound, reflecting player/world changes.
[AI] Extends the functionality of MxVideoManager to provide LEGO Island–specific video and 3D graphic...
Lego3DManager * Get3DManager()
[AI] Returns the Lego3DManager for this manager, which owns all 3D scene representations and view con...
LegoROI * GetViewROI()
[AI] Returns the viewpoint ROI for the current view/camera.
void ToggleFPS(MxBool p_visible)
[AI] Toggles display of the on-screen frames-per-second (FPS) overlay.
void SetRender3D(MxBool p_render3d)
[AI] Enables or disables main 3D rendering (e.g., used internally on video transitions).
void SetLightTransform(BOOL bDirectionalLight, Tgl::FloatMatrix4 &rMatrix)
[AI] Sets the transformation matrix (position/orientation) for either the sun or directional light.
Definition: legoview1.cpp:200
Represents the active 3D world, holding all entity, animation, sound, path, and ROI objects.
Definition: legoworld.h:49
LegoOmni::World GetWorldId()
Gets the world id associated with this world.
Definition: legoworld.h:289
virtual MxBool Escape()
Handles user-initiated "escape" or exit action.
Definition: legoworld.h:131
LegoCameraController * GetCameraController()
Returns the current camera controller for the world.
Definition: legoworld.h:277
4x4 Matrix class with virtual interface for manipulation and transformation.
Definition: matrix.h:24
virtual void TranslateBy(const float &p_x, const float &p_y, const float &p_z)
Applies translation by amounts along X, Y, Z axes.
void RotateX(const float &p_angle)
Applies a rotation (in radians or degrees, depending on implementation) about the X axis.
void RotateZ(const float &p_angle)
Applies a rotation (in radians or degrees) about the Z axis.
virtual void SetIdentity()
Sets this matrix to identity (diagonal 1, others 0).
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] Atomized (unique) string identifier, managed by reference counting.
Definition: mxatom.h:124
void Enable(MxBool p_enable)
[AI] Enables or disables the background audio manager.
void Stop()
[AI] Immediately stops all background music, clears all actions and presenters, and resets tickle sta...
[AI] Represents an action deserialized from SI chunks, holding key animation or script parameters suc...
Definition: mxdsaction.h:17
virtual void SetAtomId(MxAtomId p_atomId)
[AI] Sets the atom id for this object instance, used for indexing or lookup.
Definition: mxdsobject.h:118
void SetObjectId(MxU32 p_objectId)
[AI] Sets the object id (for serialization or lookup).
Definition: mxdsobject.h:147
MxAtomId & GetAtomId()
Returns a reference to the entity AtomId.
Definition: mxentity.h:98
[AI] Represents a 4x4 transformation matrix, specialized for the LEGO Island engine and derived from ...
Definition: mxmatrix.h:16
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
virtual MxBool IsPaused()
[AI] Returns paused state of the engine.
Definition: mxomni.h:172
[AI] MxParam serves as a polymorphic base class for parameter passing in event and notification syste...
Definition: mxparam.h:7
MxLong GetTime()
Returns the current timer value in ms, depending on running state.
Definition: mxtimer.h:50
MxResult StartTransition(TransitionType p_animationType, MxS32 p_speed, MxBool p_doCopy, MxBool p_playMusicInAnim)
[AI] Begins a new transition animation of type p_animationType at the specified speed,...
@ e_mosaic
[AI] Complex mosaic block-out effect.
const float * GetWorldUp() const
Returns a pointer to the world up vector from the transformation matrix.
const float * GetWorldPosition() const
Returns a pointer to the world position from the transformation matrix (translation row).
const float * GetWorldDirection() const
Returns a pointer to the world direction vector (forward axis) from the transformation matrix.
void WrappedSetLocalTransform(const Matrix4 &p_transform)
Wraps SetLocalTransform, for possible override or interface uniformity.
void FUN_100a5a30(const Vector3 &p_world_velocity)
Sets the world velocity to the provided vector.
const float * GetWorldVelocity() const override
Returns a pointer to the object's velocity vector in world space.
void GetLocalTransform(Matrix4 &p_transform)
Retrieves the local-to-world transformation, or if there is a parent, computes the transform relative...
void WrappedVTable0x24(const Matrix4 &p_transform)
Wraps VTable0x24, possibly for decoupling or uniform invocation.
void UpdateTransformationRelativeToParent(const Matrix4 &p_transform)
Calculates and updates the world transform relative to this object's parent, then calls UpdateWorldDa...
const BoundingBox & GetWorldBoundingBox() const override
Returns the object's bounding box in world coordinates.
unsigned char GetVisibility()
[AI] Returns the visibility flag; true if visible, false if hidden.
Definition: roi.h:228
static void SetUserMaxLOD(float p_lod)
[AI] Sets the maximum LOD allowed for the user and updates global LOD power.
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
void Clear() override
[AI] Sets every coordinate (x, y, z) to zero.
float LenSquared() const override
[AI] Computes the squared magnitude (x^2 + y^2 + z^2) of this vector.
[AI] Manages all ViewROI objects that are rendered in a given scene, handles frustum culling,...
Definition: viewmanager.h:16
unsigned int IsBoundingBoxInFrustum(const BoundingBox &p_bounding_box)
[AI] Determines if a bounding box is (partially) inside the camera's view frustum using frustum-plane...
Definition: viewmanager.cpp:64
[AI] ViewROI objects represent viewable and placeable objects in the scene, each holding their own tr...
Definition: viewroi.h:13
int GetUnknown0xe0()
[AI] Gets the value of an internal state field at offset 0xe0.
Definition: viewroi.h:108
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
typedef DWORD(FAR PASCAL *LPCLIPPERCALLBACK)(LPDIRECTDRAWCLIPPER lpDDClipper
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define sizeOfArray(arr)
Definition: decomp.h:23
LegoLocation g_locations[70]
Global table of all defined LEGO Island scene/camera/world locations.
MxU32 g_fpsEnabled
MxU32 g_switchAct
#define DTOR(angle)
MxBool g_resetPlants
MxS32 g_nextLocation
MxS32 g_animationCalcStep
MxU32 g_changeLight
LegoAnimationManager::PlayMode g_unk0x100f66bc
MxBool g_enableMusic
char * g_currentInput
MxS32 g_nextAnimation
#define VK_OEM_MINUS
char g_debugPassword[]
MxS32 g_nextCharacter
MxS32 g_locationCalcStep
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
Definition: legotypes.h:34
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
T Max(T p_t1, T p_t2)
[AI] Returns the maximum of two values.
Definition: legoutil.h:39
T Min(T p_t1, T p_t2)
[AI] Returns the minimum of two values.
Definition: legoutil.h:14
T Abs(T p_t)
[AI] Returns the absolute value.
Definition: legoutil.h:64
LegoGameState * GameState()
[AI] Accessor for the game's central game state controller. [AI]
Definition: misc.cpp:61
LegoVideoManager * VideoManager()
[AI] Accessor for the game's LegoVideoManager subsystem. Used for managing 3D/video hardware....
Definition: misc.cpp:29
LegoCharacterManager * CharacterManager()
[AI] Accessor for the character manager, which manages in-game characters/NPCs. [AI]
Definition: misc.cpp:101
LegoAnimationManager * AnimationManager()
[AI] Accessor for the animation manager, which controls Lego character/world animation state....
Definition: misc.cpp:69
LegoSoundManager * SoundManager()
[AI] Accessor for the game's LegoSoundManager subsystem from the global LegoOmni instance....
Definition: misc.cpp:22
MxTransitionManager * TransitionManager()
[AI] Accessor for the MxTransitionManager, handling level transitions, fades, and world changes....
Definition: misc.cpp:208
MxBackgroundAudioManager * BackgroundAudioManager()
[AI] Accessor for the background audio manager. Used for background music and ambient sounds....
Definition: misc.cpp:37
MxBool g_isWorldActive
Global variable indicating whether the current LegoWorld is considered active.
Definition: misc.cpp:13
LegoPlantManager * PlantManager()
[AI] Accessor for the plant manager, handling in-game foliage and plants. [AI]
Definition: misc.cpp:115
LegoWorld * CurrentWorld()
[AI] Accessor for the currently active LegoWorld instance. [AI]
Definition: misc.cpp:93
LegoOmni * Lego()
[AI] Retrieves the global LegoOmni singleton instance, providing access to core subsystems.
Definition: misc.cpp:16
LegoInputManager * InputManager()
[AI] Accessor for the input manager, which handles keyboard, mouse, and controller input....
Definition: misc.cpp:45
@ e_lowerCase2
[AI] Alternative or legacy lower case mode, functionally equivalent to e_lowerCase.
Definition: mxatom.h:109
#define MxTrace(args)
[AI] Macro for trace logging (non-variadic version, MSVC compatibility), expands to nothing.
Definition: mxdebug.h:55
MxTimer * Timer()
[AI] Returns the global simulation timer.
Definition: mxmisc.cpp:33
@ c_notificationKeyPress
[AI] Keyboard key press detected [AI]
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
float MxFloat
[AI]
Definition: mxtypes.h:68
unsigned char MxU8
[AI]
Definition: mxtypes.h:8
signed int MxS32
[AI]
Definition: mxtypes.h:38
MxS32 MxTime
[AI]
Definition: mxtypes.h:100
unsigned int MxU32
[AI]
Definition: mxtypes.h:32
float FloatMatrix4[4][4]
[AI] Represents a 4x4 matrix of single-precision floating point values.
Definition: tglvector.h:53
void CalcLocalTransform(const Vector3 &p_posVec, const Vector3 &p_dirVec, const Vector3 &p_upVec, Matrix4 &p_outMatrix)
[AI] Computes a transformation matrix based on a position, direction, and up vector.
Definition: realtime.cpp:7
Data structure representing a named spatial location and orientation in the LEGO Island world,...
Definition: legolocations.h:16
#define SET3(to, from)
Definition: vec.h:310
#define IDENTMAT3(m)
Definition: vec.h:354
#define EXPAND3(v)
Definition: vec.h:135
#define FILLVEC3(v, s)
Definition: vec.h:326
#define VXS3(to, from, s)
Definition: vec.h:402
#define VXM3(to, v, m)
Definition: vec.h:422
#define VPV3(to, v, w)
Definition: vec.h:370