-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMovableObject.h
More file actions
1282 lines (1050 loc) · 65.8 KB
/
Copy pathMovableObject.h
File metadata and controls
1282 lines (1050 loc) · 65.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
/// Header file for the MovableObject class.
/// @author Daniel Tabar
/// data@datarealms.com
/// http://www.datarealms.com
/// Inclusions of header files, forward declarations, namespace stuff
#include "SceneObject.h"
#include "Vector.h"
#include "Matrix.h"
#include "Timer.h"
#include "LuabindObjectWrapper.h"
#include "Material.h"
#include "MovableMan.h"
#include <set>
struct BITMAP;
namespace RTE {
struct HitData;
class MOSRotating;
class PieMenu;
class SLTerrain;
class LuaStateWrapper;
/// A movable object with mass.
class MovableObject : public SceneObject {
friend class Atom;
friend struct EntityLuaBindings;
/// Public member variable, method and friend function declarations
public:
ScriptFunctionNames("Create", "Destroy", "Update", "ThreadedUpdate", "SyncedUpdate", "OnScriptDisable", "OnScriptEnable", "OnCollideWithTerrain", "OnCollideWithMO", "WhilePieMenuOpen", "OnSave", "OnMessage", "OnGlobalMessage");
SerializableOverrideMethods;
ClassInfoGetters;
enum MOType {
TypeGeneric = 0,
TypeActor,
TypeHeldDevice,
TypeThrownDevice
};
/// Constructor method used to instantiate a MovableObject object in system
/// memory. Create() should be called before using the object.
MovableObject();
/// Destructor method used to clean up a MovableObject object before deletion
/// from system memory.
~MovableObject() override;
/// Makes the MovableObject object ready for use.
/// @return An error return value signaling sucess or any particular failure.
/// Anything below 0 is an error signal.
int Create() override;
/// Makes the MovableObject object ready for use.
/// @param mass A float specifying the object's mass in Kilograms (kg).
/// @param position A Vector specifying the initial position. (default: Vector(0)
/// @param 0) A Vector specifying the initial velocity.
/// @param velocity The rotation angle in r. (default: Vector(0)
/// @param 0) The angular velocity in r/s.
/// @param rotAngle The amount of time in ms this MovableObject will exist. 0 means unlim. (default: 0)
/// @param angleVel Whether or not this MO will collide with other MO's while travelling. (default: 0)
/// @param lifetime Whether or not this MO be collided with bt other MO's during their travel. (default: 0)
/// @return An error return value signaling sucess or any particular failure.
/// Anything below 0 is an error signal.
int Create(float mass, const Vector& position = Vector(0, 0), const Vector& velocity = Vector(0, 0), float rotAngle = 0, float angleVel = 0, unsigned long lifetime = 0, bool hitMOs = true, bool getHitByMOs = false);
/// Creates a MovableObject to be identical to another, by deep copy.
/// @param reference A reference to the MovableObject to deep copy.
/// @return An error return value signaling sucess or any particular failure.
/// Anything below 0 is an error signal.
int Create(const MovableObject& reference);
/// Resets the entire MovableObject, including its inherited members, to their
/// default settings or values.
void Reset() override {
Clear();
SceneObject::Reset();
}
/// Destroys and resets (through Clear()) the MovableObject object.
/// @param notInherited Whether to only destroy the members defined in this derived class, or (default: false)
/// to destroy all inherited members also.
void Destroy(bool notInherited = false) override;
#pragma region Script Handling
/// Loads the script at the given script path onto the object, checking for appropriately named functions within it.
/// If the script contains a Create function and this MO's scripts are running, the Create function will be run immediately.
/// @param scriptPath The path to the script to load.
/// @param loadAsEnabledScript Whether or not the script should load as enabled. Defaults to true.
/// @return 0 on success. -1 if scriptPath is empty. -2 if the script is already loaded. -3 if setup to load the script or modify the global lua state fails. -4 if the script fails to load.
virtual int LoadScript(const std::string& scriptPath, bool loadAsEnabledScript = true);
/// Reloads the all of the scripts on this object. This will also reload scripts for the original preset in PresetMan so future objects spawned will use the new scripts.
/// @return An error return value signaling success or any particular failure. Anything below 0 is an error signal.
int ReloadScripts() final;
/// Gets whether or not the object has a script name, and there were no errors when initializing its Lua scripts. If there were, the object would need to be reloaded.
/// @return Whether or not the object's scripts have been successfully initialized.
bool ObjectScriptsInitialized() const { return !m_ScriptObjectName.empty() && m_ScriptObjectName != "ERROR"; }
/// Checks if this MO has any scripts on it.
/// @return Whether or not this MO has any scripts on it.
bool HasAnyScripts() const { return !m_AllLoadedScripts.empty(); }
/// Checks if the script at the given path is one of the scripts on this MO.
/// @param scriptPath The path to the script to check.
/// @return Whether or not the script is on this MO.
bool HasScript(const std::string& scriptPath) const { return m_AllLoadedScripts.find(scriptPath) != m_AllLoadedScripts.end(); }
/// Checks if the script at the given path is one of the enabled scripts on this MO.
/// @param scriptPath The path to the script to check.
/// @return Whether or not the script is enabled on this MO.
bool ScriptEnabled(const std::string& scriptPath) const {
auto scriptPathIterator = m_AllLoadedScripts.find(scriptPath);
return scriptPathIterator != m_AllLoadedScripts.end() && scriptPathIterator->second == true;
}
/// Enables or dsiableds the script at the given path on this MO.
/// @param scriptPath The path to the script to enable or disable
/// @param enableScript Whether to enable the script, or disable it.
/// @return Whether or not the script was successfully eanbled/disabled.
bool EnableOrDisableScript(const std::string& scriptPath, bool enableScript);
/// Enables or disables all scripts on this MovableObject.
/// @param enableScripts Whether to enable (true) or disable (false) all scripts on this MovableObject.
void EnableOrDisableAllScripts(bool enableScripts);
/// Runs the given function in all scripts that have it, with the given arguments, with the ability to not run on disabled scripts and to cease running if there's an error.
/// The first argument to the function will always be 'self'. If either argument list is not empty, its entries will be passed into the Lua function in order, with entity arguments first.
/// @param functionName The name of the function to run.
/// @param runOnDisabledScripts Whether to run the function on disabled scripts. Defaults to false.
/// @param stopOnError Whether to stop if there's an error running any script, or simply print it to the console and continue. Defaults to false.
/// @param functionEntityArguments Optional vector of entity pointers that should be passed into the Lua function. Their internal Lua states will not be accessible. Defaults to empty.
/// @param functionLiteralArguments Optional vector of strings, that should be passed into the Lua function. Entries must be surrounded with escaped quotes (i.e.`\"`) they'll be passed in as-is, allowing them to act as booleans, etc.. Defaults to empty.
/// @return An error return value signaling success or any particular failure. Anything below 0 is an error signal.
int RunScriptedFunctionInAppropriateScripts(const std::string& functionName, bool runOnDisabledScripts = false, bool stopOnError = false, const std::vector<const Entity*>& functionEntityArguments = std::vector<const Entity*>(), const std::vector<std::string_view>& functionLiteralArguments = std::vector<std::string_view>(), const std::vector<LuabindObjectWrapper*>& functionObjectArguments = std::vector<LuabindObjectWrapper*>());
/// Cleans up and destroys the script state of this object, calling the Destroy callback in lua
virtual void DestroyScriptState();
#pragma endregion
/// Gets the MO type code of this MO. Either Actor, Item, or Generic.
/// @return An int describing the MO Type code of this MovableObject.
int GetMOType() const { return m_MOType; }
/// Gets the mass value of this MovableObject.
/// @return A float describing the mass value in Kilograms (kg).
virtual float GetMass() const { return m_Mass; }
/// Gets the previous position vector of this MovableObject, prior to this frame.
/// @return A Vector describing the previous position vector.
const Vector& GetPrevPos() const { return m_PrevPos; }
/// Gets the velocity vector of this MovableObject.
/// @return A Vector describing the current velocity vector.
const Vector& GetVel() const { return m_Vel; }
/// Gets the previous velocity vector of this MovableObject, prior to this frame.
/// @return A Vector describing the previous velocity vector.
const Vector& GetPrevVel() const { return m_PrevVel; }
/// Gets the amount of distance this MO has travelled since its creation, in pixels.
/// @return The amount of distance this MO has travelled, in pixels.
float GetDistanceTravelled() const { return m_DistanceTravelled; }
/// Gets the current angular velocity of this MovableObject. Positive is
/// a counter-clockwise rotation.
/// @return The angular velocity in radians per second.
virtual float GetAngularVel() const { return 0.0; }
/// Gets the largest radius of this in pixels.
/// @return The radius from its center to the edge of its graphical representation.
virtual float GetRadius() const { return 1.0f; }
/// Gets the largest diameter of this in pixels.
/// @return The largest diameter across its graphical representation.
virtual float GetDiameter() const { return 2.0F; }
/// Gets the current scale of this MOSRotating. This is mostly for fun.
/// @return The normalized scale.
float GetScale() const { return m_Scale; }
/// Gets How this is affected by global effects, from +1.0 to -1.0.
/// Something with a negative value will 'float' upward.
/// @return The global acceleration scalar.
float GetGlobalAccScalar() const { return m_GlobalAccScalar; }
/// Sets How this is affected by global effects, from +1.0 to -1.0.
/// Something with a negative value will 'float' upward.
/// @param newValue The global acceleration scalar.
void SetGlobalAccScalar(float newValue) { m_GlobalAccScalar = newValue; }
/// How much this is affected by air resistance when traveling over a
/// second, 0 to 1.0, with 0 as default
/// @return The air resistance coefficient.
float GetAirResistance() const { return m_AirResistance; }
/// Sets how much this is affected by air resistance when traveling over a
/// second, 0 to 1.0, with 0 as default
/// @param newValue The air resistance coefficient.
void SetAirResistance(float newValue) { m_AirResistance = newValue; }
/// At which threshold of velocity, in m/s, the effect of AirResistance
/// kicks in.
/// @return The air threshold speed.
float GetAirThreshold() const { return m_AirThreshold; }
/// Sets at which threshold of velocity, in m/s, the effect of AirResistance
/// kicks in.
/// @param newValue The air threshold speed.
void SetAirThreshold(float newValue) { m_AirThreshold = newValue; }
/// Gets real time age of this MovableObject.
/// @return A unsigned long describing the current age in ms.
unsigned long GetAge() const { return m_AgeTimer.GetElapsedSimTimeMS(); }
/// Gets the amount of time this MovableObject will exist from creation.
/// @return A unsigned long describing the current lifetime in ms. 0 means unlimited.
unsigned long GetLifetime() const { return m_Lifetime; }
/// Gets the MOID of this MovableObject for this frame.
/// @return An int specifying the MOID that this MovableObject is
/// assigned for the current frame only.
MOID GetID() const { return m_MOID; }
/// Gets the MOID of the MovableObject which is the root MO of this MO for
/// this frame. If same as what GetID returns, then this is owned by
/// MovableMan.
/// @return An int specifying the MOID of the MO that this MovableObject
/// is owned by for the current frame only.
MOID GetRootID() const { return m_RootMOID; }
/// Gets how many total (subsequent) MOID's this MO and all its children
/// are taking up this frame. ie if this MO has no children, this will
/// likely be 1. Note this is only valid for this frame!
/// @return The number of MOID indices this MO and all its children are taking up.
int GetMOIDFootprint() const { return m_MOIDFootprint; }
/// Returns whether or not this MovableObject has ever been added to MovableMan. Does not account for removal from MovableMan.
/// @return Whether or not this MovableObject has ever been added to MovableMan.
bool HasEverBeenAddedToMovableMan() const { return m_HasEverBeenAddedToMovableMan; }
/// Gets the sharpness factor of this MO.
/// @return The sharpness factor of this MO. 1.0 means normal sharpness, no alter-
/// ation to any of the impulses.
float GetSharpness() const { return m_Sharpness; }
/// Placeholder method to allow for ease of use with Attachables. Returns nullptr for classes that aren't derived from Attachable.
/// @return Nothing.
virtual MOSRotating* GetParent() { return nullptr; }
/// Placeholder method to allow for ease of use with Attachables. Returns nullptr for classes that aren't derived from Attachable.
/// @return Nothing.
virtual const MOSRotating* GetParent() const { return nullptr; }
/// Returns a pointer to this MO, this is to enable Attachables to get their root nodes.
/// @return A pointer to this MovableObject.
virtual MovableObject* GetRootParent() { return this; }
/// Returns a pointer to this MO, this is to enable Attachables to get their root nodes.
/// @return A pointer to this MovableObject.
virtual const MovableObject* GetRootParent() const { return this; }
/// Gets the altitide of this' pos (or appropriate low point) over the
/// terrain, in pixels.
/// @param max The max altitude you care to check for. 0 Means check the whole scene's height. (default: 0)
/// @param accuracy The accuracy within which measurement is acceptable. Higher number (default: 0)
/// here means less calculation.
/// @return The rough altitude over the terrain, in pixels.
virtual float GetAltitude(int max = 0, int accuracy = 0);
/// Gets the absoltue position of the top of this' HUD stack.
/// @return A Vector with the absolute position of this' HUD stack top point.
virtual Vector GetAboveHUDPos() const { return m_Pos; }
/// Shows whether this may have started to intersect the terrain since the
/// last frame, e g due to flipping.
/// @return Whether this may have started to intersect the terrain since last frame.
bool IntersectionWarning() const { return m_CheckTerrIntersection; }
/// Gets whether this MovableObject is set to collide with other
/// MovableObject:s during its travel.
/// @return Whether this hits other MO's during its travel, or not.
bool HitsMOs() const { return m_HitsMOs; }
/// Gets whether this MovableObject is set to be able to get hit by other
/// MovableObject:s during their travel.
/// @return Whether this can get hit by MO's, or not.
bool GetsHitByMOs() const { return m_GetsHitByMOs; }
/// Sets the team of this MovableObject.
/// @param team The new team to assign.
void SetTeam(int team) override;
/// Sets whether this will collide with any other MO of the same team.
/// @param ignoreTeam Whether this can hit or get hit by other MOs of the same team. (default: true)
void SetIgnoresTeamHits(bool ignoreTeam = true) { m_IgnoresTeamHits = ignoreTeam; }
/// Tells whether this will collide with any other MO of the same team.
/// @return Whether this can hit or get hit by other MOs of the same team.
bool IgnoresTeamHits() const { return m_IgnoresTeamHits; }
/// Tells which team this would be ignoring hits with, if we're ignoring
/// hits at all.
/// @return Which team this ignores hits with, if any.
int IgnoresWhichTeam() const { return m_IgnoresTeamHits ? m_Team : Activity::NoTeam; }
/// Sets whether this will collide with any other MO that uses an
/// AtomGroup as a physical representation. This also overrides the
/// IgnoresAGHitsWhenSlowerThan property.
/// @param ignoreAG Whether this can hit or get hit by other MOs which use AGs. (default: true)
void SetIgnoresAtomGroupHits(bool ignoreAG = true) {
m_IgnoresAtomGroupHits = ignoreAG;
if (ignoreAG)
m_IgnoresAGHitsWhenSlowerThan = -1;
}
/// Tells whether this will collide with any MO that uses an AtomGroup
/// as physical representation. (as opposed to single-atom ones)
/// @return Whether this can hit or get hit by other MOs that use AGs.
bool IgnoresAtomGroupHits() const { return m_IgnoresAtomGroupHits; }
/// Tells whether this will collide with any Terrain
/// @return Whether this can hit terrain.
bool IgnoreTerrain() const { return m_IgnoreTerrain; }
/// Sets whether this will collide with any Terrain
/// @param ignores Whether this can hit terrain.
void SetIgnoreTerrain(bool ignores) { m_IgnoreTerrain = ignores; }
/// Gets whether this MO ignores collisions with actors.
/// @return Whether this MO ignores collisions with actors.
bool GetIgnoresActorHits() const { return m_IgnoresActorHits; }
/// Sets whether this MO ignores collisions with actors.
/// @param value Whether this MO will ignore collisions with actors.
void SetIgnoresActorHits(bool value) { m_IgnoresActorHits = value; }
/// Gets the main material of this MovableObject.
/// @return The the material of this MovableObject.
virtual Material const* GetMaterial() const = 0;
/// Gets the drawing priority of this MovableObject, if two things were
/// overlap when copying to the terrain, the higher priority MO would
/// end up getting drawn.
/// @return The the priority of this MovableObject. Higher number, the higher
/// priority.
virtual int GetDrawPriority() const = 0;
/// Gets the screen effect this has loaded, which can be applied to post
/// rendering. Ownership is NOT transferred!
/// @return The 32bpp screen effect BITMAP. Ownership is NOT transferred!
BITMAP* GetScreenEffect() const { return m_pScreenEffect; }
/// Gets the hash of the path of this object's screen effect file. Used to
/// transfer glow effects over network. The hash itself is calculated during
/// load.
/// @return This effect's unique hash.
size_t GetScreenEffectHash() const { return m_ScreenEffectHash; }
/// Sets the mass of this MovableObject.
/// @param newMass A float specifying the new mass value in Kilograms (kg).
virtual void SetMass(const float newMass) { m_Mass = newMass; }
/// Sets the position at the start of the sim update.
/// @param newPrevPos A Vector specifying the new 'prev' pos.
void SetPrevPos(const Vector& newPrevPos) { m_PrevPos = newPrevPos; }
/// Sets the velocity vector of this MovableObject.
/// @param newVel A Vector specifying the new velocity vector.
void SetVel(const Vector& newVel) { m_Vel = newVel; }
/// Sets the current absolute angle of rotation of this MovableObject.
/// @param newAngle The new absolute angle in radians.
void SetRotAngle(float newAngle) override {}
/// Sets the current absolute angle of rotation of this MovableObject's effect.
/// @param newAngle The new absolute angle in radians.
void SetEffectRotAngle(float newAngle) { m_EffectRotAngle = newAngle; }
/// Gets the current absolute angle of rotation of this MovableObject's effect.
/// @return The absolute angle in radians.
float GetEffectRotAngle() const { return m_EffectRotAngle; }
/// Gets the starting strength of this MovableObject's effect.
/// @return The starting strength of the effect, 0-255.
int GetEffectStartStrength() const { return m_EffectStartStrength; }
/// Gets the stopping strength of this MovableObject's effect.
/// @return The stopping strength of the effect, 0-255.
int GetEffectStopStrength() const { return m_EffectStopStrength; }
/// Sets the current angular velocity of this MovableObject. Positive is
/// a counter clockwise rotation.
/// @param newRotVel The new angular velocity in radians per second.
virtual void SetAngularVel(float newRotVel) {}
/// Sets the current scale of this MOSRotating. This is mostly for fun.
/// @param newScale The new normalized scale.
void SetScale(float newScale) { m_Scale = newScale; }
/// Sets the amount of time this MovableObject will exist.
/// @param newLifetime A unsigned long specifying amount of time in ms. 0 means unlimited life. (default: 0)
void SetLifetime(const int newLifetime = 0) { m_Lifetime = newLifetime; }
/// Sets this' age timer to a specific value, in ms.
/// @param newAge The new age of this, in MS. (default: 0) { m_AgeTimer.SetElapsedSimTimeMS(newAge)
void SetAge(double newAge = 0) { m_AgeTimer.SetElapsedSimTimeMS(newAge); }
/// Sets the MOID of this MovableObject to be g_NoMOID (255) for this frame.
virtual void SetAsNoID() { m_MOID = g_NoMOID; }
/// Sets this MovableObject as having been added to MovableMan. Should only really be done in MovableMan::Add/Remove Actor/Item/Particle.
/// @param addedToMovableMan Whether or not this MovableObject has been added to MovableMan.
void SetAsAddedToMovableMan(bool addedToMovableMan = true) {
if (addedToMovableMan) {
m_HasEverBeenAddedToMovableMan = true;
}
}
/// Sets the sharpness factor of this MO.
/// @param sharpness The sharpness factor of this MO. 1.0 means normal sharpness, no alter-
/// ation to any of the impulses.
void SetSharpness(const float sharpness) { m_Sharpness = sharpness; }
/// Sets this MovableObject to collide with other MovableObjects during
/// travel.
/// @param hitMOs Whether to hit other MO's during travel, or not. (default: true)
void SetToHitMOs(bool hitMOs = true) { m_HitsMOs = hitMOs; }
/// Sets this MovableObject to be able to be collided with by other
/// MovableObjects during their travel.
/// @param getHitByMOs Whether this should get hit by other MO's during travel, or not. (default: true)
void SetToGetHitByMOs(bool getHitByMOs = true) { m_GetsHitByMOs = getHitByMOs; }
/// Gets the MO this MO is set not to hit even when MO hitting is enabled on this MO.
/// @return The MO this MO is set not to hit.
const MovableObject* GetWhichMOToNotHit() const { return m_pMOToNotHit; }
/// Sets this MO to not hit a specific other MO and all its children even when MO hitting is enabled on this MO.
/// @param moToNotHit A pointer to the MO to not be hitting. Null pointer means don't ignore anyhting. Ownership is NOT transferred!
/// @param forHowLong How long, in seconds, to ignore the specified MO. A negative number means forever.
virtual void SetWhichMOToNotHit(MovableObject* moToNotHit = nullptr, float forHowLong = -1) {
m_pMOToNotHit = moToNotHit;
m_MOIgnoreTimer.Reset();
m_MOIgnoreTimer.SetSimTimeLimitS(forHowLong);
}
/// Enables or disables double drawing of this across wrapping seams.
/// @param wrapDraw Wheter to enable or not. (default: true)
void SetWrapDoubleDrawing(bool wrapDraw = true) { m_WrapDoubleDraw = wrapDraw; }
/// Marks this MovableObject for settling onto the terrain at the end of
/// the MovableMan update.
/// @param toSettle Whether to mark this MO for settling or not. (default: true)
void SetToSettle(bool toSettle = true) { m_ToSettle = toSettle; }
/// Marks this MovableObject for deletion at the end of the MovableMan
/// update.
/// @param toDelete Whether to mark this MO for deletion or not. (default: true)
void SetToDelete(bool toDelete = true) { m_ToDelete = toDelete; }
/// Tells if this MovableObject is marked for deletion at the end of the
/// update.
/// @return Whether this is marked for deletion or not.
bool IsSetToDelete() const { return m_ToDelete; }
/// Shows whether this is mission critical and should therefore NEVER be
/// settled or otherwise destroyed during teh course of a mission.
/// @return Whetehr this should be immune to settling and destruction.
bool IsMissionCritical() const { return m_MissionCritical; }
/// Sets whether this is mission critical and should therefore NEVER be
/// settled or otherwise destroyed during teh course of a mission.
/// @param missionCritical Whether this should be immune to settling and destruction.
void SetMissionCritical(bool missionCritical) { m_MissionCritical = missionCritical; }
/// Shows whether this can be squished by getting pushed into the ground.
/// @return Whetehr this should be immune to squishing or not.
bool CanBeSquished() const { return m_CanBeSquished; }
/// Tells whether this Actor's HUD is drawn or not.
/// @return Whether this' HUD gets drawn or not.
void SetHUDVisible(bool visible) { m_HUDVisible = visible; }
/// Tells whether this Actor's HUD is drawn or not.
/// @return Whether this' HUD gets drawn or not.
bool GetHUDVisible() const { return m_HUDVisible; }
/// Indicates whether this MO is moving or rotating stupidly fast in a way
/// that will screw up the simulation.
/// @return Whether this is either moving or rotating too fast.
virtual bool IsTooFast() const { return m_Vel.MagnitudeIsGreaterThan(500.0F); }
/// Slows the speed of anyhting that is deemed to be too fast to within
/// acceptable rates.
virtual void FixTooFast() {
if (IsTooFast()) {
m_Vel.SetMagnitude(450.0F);
}
}
/// Indicates whether this MO is an Generic or not.
/// @return Whether this MovableObject is of Type Generic or not.
bool IsGeneric() const { return m_MOType == TypeGeneric; }
/// Indicates whether this MO is an Actor or not.
/// @return Whether this MovableObject is of Type Actor or not.
bool IsActor() const { return m_MOType == TypeActor; }
/// Indicates whether this MO is a Device or not.
/// @return Whether this MovableObject is of Type Device (Held or Thrown) or not.
bool IsDevice() const { return m_MOType == TypeHeldDevice || m_MOType == TypeThrownDevice; }
/// Indicates whether this MO is a HeldDevice or not.
/// @return Whether this MovableObject is of Type HeldDevice or not.
// LEGACY CRAP
bool IsHeldDevice() const { return m_MOType == TypeHeldDevice || m_MOType == TypeThrownDevice; }
/// Indicates whether this MO is a ThrownDevice or not.
/// @return Whether this MovableObject is of Type ThrownDevice or not.
bool IsThrownDevice() const { return m_MOType == TypeThrownDevice; }
/// Indicates whether this MO is made of Gold or not.
/// @return Whether this MovableObject is of Gold or not.
bool IsGold() const { return m_MOType == TypeGeneric && GetMaterial()->GetIndex() == c_GoldMaterialID; }
/// Indicates whether this MovableObject is to be drawn after
/// (in front of) or before (behind) the parent.
/// @return Whether it's to be drawn after parent or not.
virtual bool IsDrawnAfterParent() const { return true; }
/// Whether a set of X, Y coordinates overlap us (in world space).
/// @param pixelX The given X coordinate, in world space.
/// @param pixelY The given Y coordinate, in world space.
/// @return Whether the given coordinate overlap us.
virtual bool HitTestAtPixel(int pixelX, int pixelY) const { return false; }
/// Shows whether this is or carries a specifically named object in its
/// inventory. Also looks through the inventories of potential passengers,
/// as applicable.
/// @param objectName The Preset name of the object to look for.
/// @return Whetehr the object was found carried by this.
virtual bool HasObject(std::string objectName) const { return m_PresetName == objectName; }
/// Shows whether this is or carries a specifically grouped object in its
/// inventory. Also looks through the inventories of potential passengers,
/// as applicable.
/// @param const_cast<MovableObject*>(this)->IsInGroup(groupName The name of the group to look for.
/// @return Whetehr the object in the group was found carried by this.
virtual bool HasObjectInGroup(std::string groupName) const { return const_cast<MovableObject*>(this)->IsInGroup(groupName); }
/// Adds force to this MovableObject for the next time Update() is called.
/// @param force An Vector with the external force vector that will be added to this
/// @param offset MovableObject and affect its path next Update(). In N or kg * m/s^2. (default: Vector()) { m_Forces.push_back(std::make_pair(force)
/// @param offset) A Vector with the offset, in METERS, of where the force is being
/// applied relative to the center of this MovableObject.
/// @return None.A
void AddForce(const Vector& force, const Vector& offset = Vector()) { m_Forces.push_back(std::make_pair(force, offset)); }
/// Adds force to this MovableObject for the next time Update() is called.
/// @param force An Vector with the external force vector that will be added to this
/// @param absPos MovableObject and affect its path next Update(). In N or kg * m/s^2.
/// A Vector with the absolute world coordinates, in PIXELS, of where the
/// force is being applied to the center of this MovableObject.
void AddAbsForce(const Vector& force, const Vector& absPos);
/// Adds impulse force (or instant momentum) to this MovableObject for
/// the next time Update() is called.
/// @param impulse An Vector with the impulse force vector that will directly be added
/// to this MovableObject's momentum next Update(). In kg * m/s.
/// @param offset A Vector with the offset, in METERS, of where the impulse is being (default: Vector())
/// applied relative to the center of this MovableObject.
void AddImpulseForce(const Vector& impulse, const Vector& offset = Vector()) {
#ifndef RELEASE_BUILD
RTEAssert(impulse.MagnitudeIsLessThan(500000.0F), "HUEG IMPULSE FORCE");
RTEAssert(offset.MagnitudeIsLessThan(5000.0F), "HUGE IMPULSE FORCE OFFSET");
#endif
m_ImpulseForces.push_back({impulse, offset});
}
/// Adds impulse force (or instant momentum) to this MovableObject for
/// the next time Update() is called.
/// @param impulse An Vector with the impulse force vector that will directly be added
/// to this MovableObject's momentum next Update(). In kg * m/s.
/// @param absPos A Vector with the absolute world coordinates, in PIXELS, of where the
/// force is being applied to the center of this MovableObject.
void AddAbsImpulseForce(const Vector& impulse, const Vector& absPos);
/// Clears out all the forces this MO has accumulated during this frame.
void ClearForces() { m_Forces.clear(); }
/// Clears out all the impulses this MO has accumulated during this frame.
void ClearImpulseForces() { m_ImpulseForces.clear(); }
/// Gets the impulse force threshold which has to be exceeded to
/// 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved
/// by travel algos. If 0, this isn't pinned.
/// @return The impulse threshold in kg * (m/s). 0 means no pinning
float GetPinStrength() const { return m_PinStrength; }
/// Sets a impulse force threshold which has to be exceeded to
/// 'shake loose' this from a 'pinned' state. Pinned MOs don't get moved
/// by travel algos. If 0, this isn't pinned.
/// @param pinStrength The impulse threshold in kg * (m/s). 0 means no pinning
void SetPinStrength(float pinStrength) { m_PinStrength = pinStrength; }
/// Resest all the timers used by this. Can be emitters, etc. This is to
/// prevent backed up emissions to come out all at once while this has been
/// held dormant in an inventory.
virtual void ResetAllTimers() {}
/// Does the calculations necessary to detect whether this MovableObject is at rest or not. IsAtRest() retrieves the answer.
virtual void RestDetection();
/// Forces this MovableObject out of resting conditions.
virtual void NotResting() {
m_RestTimer.Reset();
m_ToSettle = false;
m_VelOscillations = 0;
}
/// Indicates whether this MovableObject has been at rest with no movement for longer than its RestThreshold.
virtual bool IsAtRest();
/// Indicates wheter this MovableObject has been updated yet during this
/// frame.
/// @return Wheter or not the MovableObject has been updated yet during this frame.
bool IsUpdated() const { return m_IsUpdated; }
/// Tell this MovableObject that a new frame has started.
void NewFrame() { m_IsUpdated = false; }
/// Indicates whether this MO is marked for settling at the end of the
/// MovableMan update.
/// @return Whether this MO is marked for settling ontot the terrain or not.
bool ToSettle() const { return !m_MissionCritical && m_ToSettle; }
/// Indicates whether this MO is marked for deletion at the end of the
/// MovableMan update.
/// @return Whether this MO is marked for deletion or not.
bool ToDelete() const { return m_ToDelete; }
/// Indicates whether this MO moved across the scene wrap seam during the
/// last update.
/// @return Whether this MO wrapped or not.
bool DidWrap() { return m_DidWrap; }
/// Calculates the collision response when another MO's Atom collides with
/// this MO's physical representation. The effects will be applied
/// directly to this MO, and also represented in the passed in HitData.
/// @param hitData Reference to the HitData struct which describes the collision. This
/// will be modified to represent the results of the collision.
/// @return Whether the collision has been deemed valid. If false, then disregard
/// any impulses in the Hitdata.
virtual bool CollideAtPoint(HitData& hitData) = 0;
/// Defines what should happen when this MovableObject hits another MO.
/// This is called by the owned Atom/AtomGroup of this MovableObject during
/// travel.
/// @param hd The HitData describing the collision in detail.
/// @return Wheter the MovableObject should immediately halt any travel going on
/// after this hit.
bool OnMOHit(HitData& hd);
/// Defines what should happen when this MovableObject hits and then
/// bounces off of something. This is called by the owned Atom/AtomGroup
/// of this MovableObject during travel.
/// @param hd The HitData describing the collision in detail.
/// @return Wheter the MovableObject should immediately halt any travel going on
/// after this bounce.
virtual bool OnBounce(HitData& hd) = 0;
/// Defines what should happen when this MovableObject hits and then
/// sink into something. This is called by the owned Atom/AtomGroup
/// of this MovableObject during travel.
/// @param hd The HitData describing the collision in detail.
/// @return Wheter the MovableObject should immediately halt any travel going on
/// after this sinkage.
virtual bool OnSink(HitData& hd) = 0;
/// Checks whether any of the Atom:s in this MovableObject are on top of
/// terrain pixels, and if so, attempt to move this out so none of this'
/// Atoms are on top of the terrain any more.
/// @param strongerThan Only consider materials stronger than this in the terrain for (default: g_MaterialAir)
/// intersections.
/// @return Whether any intersection was successfully resolved. Will return true
/// even if there wasn't any intersections to begin with.
virtual bool MoveOutOfTerrain(unsigned char strongerThan = g_MaterialAir) { return true; }
/// Rotates a vector offset from this MORotating's position according to
/// the rotate angle and flipping.
/// @param offset A const reference the offset Vector to rotate.
/// @return A new vector that is the result of the rotation.
virtual Vector RotateOffset(const Vector& offset) const { return offset; }
/// Gathers and applies the global and accumulated forces. Then it clears
/// out the force list.Note that this does NOT apply the accumulated
/// impulses (impulse forces)!
virtual void ApplyForces();
/// Gathers and applies the accumulated impulse forces. Then it clears
/// out the impulse list.Note that this does NOT apply the accumulated
/// regular forces (non-impulse forces)!
virtual void ApplyImpulses();
/// Returns the number of Forces vectors to apply.
/// @return Number of entries in Forces list.
int GetForcesCount() { return m_Forces.size(); };
/// Returns force vector in newtons of the specified Force record.
/// @param n Force record index to get data from.
/// @return Force vector in newtons of the specified Force record.
Vector GetForceVector(unsigned int n) {
if (n > 0 && n < m_Forces.size())
return m_Forces[n].first;
else
return Vector(0, 0);
}
/// Gets the total sum of all forces applied to this MovableObject in a single Vector.
/// @return The total sum of all forces applied to this MovableObject.
virtual Vector GetTotalForce();
/// Returns offset vector in METERS (not pixels) of the specified Force record.
/// @param n Force record index to get data from.
/// @return Offset vector in meters of the specified Force record.
Vector GetForceOffset(unsigned int n) {
if (n > 0 && n < m_Forces.size())
return m_Forces[n].second;
else
return Vector(0, 0);
}
/// Sets force vector in newtons of the specified Force record.
/// @param n Force record index to get data from. New Vector force value in newtons.
void SetForceVector(unsigned int n, Vector v) {
if (n > 0 && n < m_Forces.size())
m_Forces[n].first = v;
}
/// Sets offset vector in METERS (not pixels) of the specified Force record.
/// @param n Force record index to get data from. New Vector offset value in meters.
void SetForceOffset(unsigned int n, Vector v) {
if (n > 0 && n < m_Forces.size())
m_Forces[n].second = v;
}
/// Gets the pairs of impulse forces and their offsets that have to be applied.
/// @return A constant reference to the deque of impulses for this MovableObject.
const std::deque<std::pair<Vector, Vector>>& GetImpulses() { return m_ImpulseForces; }
/// Returns the number of ImpulseForces vectors to apply.
/// @return Number of entries in ImpulseForces list.
int GetImpulsesCount() { return m_ImpulseForces.size(); }
/// Returns Impulse vector in newtons of the specified Impulse record.
/// @param n Impulse record index to get data from.
/// @return Impulse vector in newtons of the specified Impulse record.
Vector GetImpulseVector(unsigned int n) {
if (n > 0 && n < m_ImpulseForces.size())
return m_ImpulseForces[n].first;
else
return Vector(0, 0);
}
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
/// @param n Impulse record index to get data from.
/// @return Offset vector in meters of the specified Impulse record.
Vector GetImpulseOffset(unsigned int n) {
if (n > 0 && n < m_ImpulseForces.size())
return m_ImpulseForces[n].second;
else
return Vector(0, 0);
}
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
/// @param n Impulse record index to get data from.
/// @return Offset vector in meters of the specified Impulse record.
void SetImpulseVector(unsigned int n, Vector v) {
if (n > 0 && n < m_ImpulseForces.size())
m_ImpulseForces[n].first = v;
}
/// Sets offset vector in METERS (not pixels) of the specified Impulse record.
/// @param n Impulse record index to get data from. New Vector offset value in meters.
void SetImpulseOffset(unsigned int n, Vector v) {
if (n > 0 && n < m_ImpulseForces.size())
m_ImpulseForces[n].second = v;
}
/// Gets the number of Sim updates that run between each script update for this MovableObject.
/// @return The number of Sim updates that run between each script update for this MovableObject.
int GetSimUpdatesBetweenScriptedUpdates() const { return m_SimUpdatesBetweenScriptedUpdates; }
/// Sets the number of Sim updates that run between each script update for this MovableObject.
/// @param newSimUpdatesBetweenScriptedUpdates The new number of Sim updates that run between each script update for this MovableObject.
void SetSimUpdatesBetweenScriptedUpdates(int newSimUpdatesBetweenScriptedUpdates) { m_SimUpdatesBetweenScriptedUpdates = std::max(1, newSimUpdatesBetweenScriptedUpdates); }
/// Does stuff that needs to be done before Travel(). Always call before
/// calling Travel.
virtual void PreTravel();
/// Travels this MovableObject, using its physical representation.
virtual void Travel();
/// Does stuff that needs to be done after Travel(). Always call after
/// calling Travel.
virtual void PostTravel();
/// Update called prior to controller update. Ugly hack. Supposed to be done every frame.
virtual void PreControllerUpdate(){};
/// Updates this MovableObject. Supposed to be done every frame. This also
/// applies and clear the accumulated impulse forces (impulses), and the
/// transferred forces of MOs attached to this.
void Update() override;
void Draw(BITMAP* pTargetBitmap, const Vector& targetPos = Vector(), DrawMode mode = g_DrawColor, bool onlyPhysical = false) const override;
/// Updates this MovableObject's Lua scripts.
/// @return An error return value signaling success or any particular failure. Anything below 0 is an error signal.
virtual int UpdateScripts();
/// Gets a const reference to this MOSRotating's map of string values.
/// @return A const reference to this MOSRotating's map of string values.
const std::unordered_map<std::string, std::string>& GetStringValueMap() const { return m_StringValueMap; }
/// Gets a const reference to this MOSRotating's map of number values.
/// @return A const reference to this MOSRotating's map of number values.
const std::unordered_map<std::string, double>& GetNumberValueMap() const { return m_NumberValueMap; }
/// Returns the string value associated with the specified key or "" if it does not exist.
/// @param key Key to retrieve value.
/// @return The value associated with the key.
const std::string& GetStringValue(const std::string& key) const;
/// Returns an encoded string value associated with the specified key or "" if it does not exist.
/// @param key Key to retrieve value.
/// @return The value associated with the key.
std::string GetEncodedStringValue(const std::string& key) const;
/// Returns the number value associated with the specified key or 0 if it does not exist.
/// @param key Key to retrieve value.
/// @return The value associated with the key.
double GetNumberValue(const std::string& key) const;
/// Returns the entity value associated with the specified key or nullptr if it does not exist.
/// @param key Key to retrieve value.
/// @return The value associated with the key.
Entity* GetObjectValue(const std::string& key) const;
/// Sets the string value associated with the specified key.
/// @param key Key to retrieve value.
/// @param value The new value to be associated with the key.
void SetStringValue(const std::string& key, const std::string& value);
/// Sets the string value associated with the specified key.
/// @param key Key to retrieve value.
/// @param value The new value to be associated with the key.
void SetEncodedStringValue(const std::string& key, const std::string& value);
/// Sets the number value associated with the specified key.
/// @param key Key to retrieve value.
/// @param value The new value to be associated with the key.
void SetNumberValue(const std::string& key, double value);
/// Sets the entity value associated with the specified key.
/// @param key Key to retrieve value.
/// @param value The new value to be associated with the key.
void SetObjectValue(const std::string& key, Entity* value);
/// Remove the string value associated with the specified key.
/// @param key The key to remove.
void RemoveStringValue(const std::string& key);
/// Remove the number value associated with the specified key.
/// @param key The key to remove.
void RemoveNumberValue(const std::string& key);
/// Remove the entity value associated with the specified key.
/// @param key The key to remove.
void RemoveObjectValue(const std::string& key);
/// Checks whether the string value associated with the specified key exists.
/// @param key The key to check.
/// @return Whether or not there is an associated value for this key.
bool StringValueExists(const std::string& key) const;
/// Checks whether the number value associated with the specified key exists.
/// @param key The key to check.
/// @return Whether or not there is an associated value for this key.
bool NumberValueExists(const std::string& key) const;
/// Checks whether the entity value associated with the specified key exists.
/// @param key The key to check.
/// @return Whether or not there is an associated value for this key.
bool ObjectValueExists(const std::string& key) const;
/// Event listener to be run while this MovableObject's PieMenu is opened.
/// @param pieMenu The PieMenu this event listener needs to listen to. This will always be this' m_PieMenu and only exists for std::bind.
/// @return An error return value signaling success or any particular failure. Anything below 0 is an error signal.
virtual int WhilePieMenuOpenListener(const PieMenu* pieMenu);
/// Updates this' and its its childrens' MOID's and foorprint. Should
/// be done every frame.
void UpdateMOID(std::vector<MovableObject*>& MOIDIndex, MOID rootMOID = g_NoMOID, bool makeNewMOID = true);
/// Draws the MOID representation of this to the SceneMan's MOID layer if
/// this is found to potentially overlap another MovableObject.
/// @param pOverlapMO The MovableObject to check this for overlap against.
/// @return Whether it was drawn or not.
virtual bool DrawMOIDIfOverlapping(MovableObject* pOverlapMO) { return false; }
/// Draws this' current graphical HUD overlay representation to a
/// BITMAP of choice.
/// @param pTargetBitmap A pointer to a BITMAP to draw on.
/// @param targetPos The absolute position of the draw bitmap's upper left corner in the Scene. (default: Vector())
/// @param whichScreen Which player's screen this is being drawn to. May affect what HUD elements (default: 0)
/// get drawn etc.
virtual void DrawHUD(BITMAP* pTargetBitmap, const Vector& targetPos = Vector(), int whichScreen = 0, bool playerControlled = false) { return; }
/// Returns current rest threshold for this MO
/// @return Rest threshold of this MO
int GetRestThreshold() const { return m_RestThreshold; }
/// Sets current rest threshold for this MO
/// @param newRestThreshold New rest threshold value
void SetRestThreshold(int newRestThreshold) { m_RestThreshold = newRestThreshold; }
/// Returns the next unique id for MO's and increments unique ID counter
/// @return Returns the next unique id.
static unsigned long int GetNextUniqueID() { return ++m_UniqueIDCounter; }
/// Returns this MO's unique persistent ID
/// @return Returns this MO's unique persistent ID
unsigned long int const GetUniqueID() const { return m_UniqueID; }
/// Gets the preset name and unique ID of this MO, often useful for error messages.
/// @return A string containing the unique ID and preset name of this MO.
std::string GetPresetNameAndUniqueID() const { return m_PresetName + ", UID: " + std::to_string(m_UniqueID); }
/// If not zero applyies specified ammount of damage points to actors on
/// collision even without penetration.
/// @return Amount of damage to apply.
float DamageOnCollision() const { return m_DamageOnCollision; }
/// If not zero applyies specified ammount of damage points to actors on
/// collision even without penetration.
/// @param value Amount of damage to apply.
void SetDamageOnCollision(float value) { m_DamageOnCollision = value; }
/// If not zero applies specified ammount of damage points to actors on
/// collision if penetration occured.
/// @return Amount of damage to apply.
float DamageOnPenetration() const { return m_DamageOnPenetration; }
/// If not zero applies specified ammount of damage points to actors on
/// collision if penetration occured.
/// @param value Amount of damage to apply.
void SetDamageOnPenetration(float value) { m_DamageOnPenetration = value; }
/// Returns damage multiplier transferred to wound inflicted by this object on penetration
/// @return Damage multiplier to apply to wound.
float WoundDamageMultiplier() const { return m_WoundDamageMultiplier; }
/// Sets damage multiplier transferred to wound inflicted by this object on penetration
/// @param value New damage multiplier to apply to wound.
void SetWoundDamageMultiplier(float value) { m_WoundDamageMultiplier = value; }
/// Gets whether or not this MovableObject should apply wound damage when it collides with another MovableObject.
/// @return Whether or not this MovableObject should apply wound damage when it collides with another MovableObject.
bool GetApplyWoundDamageOnCollision() const { return m_ApplyWoundDamageOnCollision; }
/// Sets whether or not this MovableObject should apply wound damage when it collides with another MovableObject.
/// @param applyWoundDamageOnCollision Whether or not this MovableObject should apply wound damage on collision.
void SetApplyWoundDamageOnCollision(bool applyWoundDamageOnCollision) { m_ApplyWoundDamageOnCollision = applyWoundDamageOnCollision; }
/// Gets whether or not this MovableObject should apply burst wound damage when it collides with another MovableObject.
/// @return Whether or not this MovableObject should apply burst wound damage when it collides with another MovableObject.
bool GetApplyWoundBurstDamageOnCollision() const { return m_ApplyWoundBurstDamageOnCollision; }
/// Sets whether or not this MovableObject should apply burst wound damage when it collides with another MovableObject.
/// @param applyWoundDamageOnCollision Whether or not this MovableObject should apply burst wound damage on collision.
void SetApplyWoundBurstDamageOnCollision(bool applyWoundBurstDamageOnCollision) { m_ApplyWoundBurstDamageOnCollision = applyWoundBurstDamageOnCollision; }
/// Puts all MOIDs associated with this MO and all it's descendants into MOIDs vector
/// @param MOIDs Vector to store MOIDs
virtual void GetMOIDs(std::vector<MOID>& MOIDs) const;
/// Returns the ID of the MO hit at the previously taken Travel