29 #include "object/interface/carrier_object.h"
30 #include "object/interface/controllable_object.h"
31 #include "object/interface/flying_object.h"
32 #include "object/interface/interactive_object.h"
33 #include "object/interface/jet_flying_object.h"
34 #include "object/interface/jostleable_object.h"
35 #include "object/interface/movable_object.h"
36 #include "object/interface/power_container_object.h"
37 #include "object/interface/powered_object.h"
38 #include "object/interface/programmable_object.h"
39 #include "object/interface/ranged_object.h"
40 #include "object/interface/shielded_auto_regen_object.h"
41 #include "object/interface/task_executor_object.h"
42 #include "object/interface/trace_drawing_object.h"
43 #include "object/interface/transportable_object.h"
45 #include "object/implementation/power_container_impl.h"
46 #include "object/implementation/program_storage_impl.h"
47 #include "object/implementation/programmable_impl.h"
48 #include "object/implementation/task_executor_impl.h"
51 const int OBJECTMAXPART = 40;
62 bool bTranslate =
false;
73 class CObjectInterface;
98 void SetProgrammable();
99 void SetMovable(std::unique_ptr<CMotion> motion, std::unique_ptr<CPhysics> physics);
100 void SetAuto(std::unique_ptr<CAuto> automat);
101 void SetOption(
int option);
109 void Simplify()
override;
111 bool DamageObject(DamageType type,
float force = std::numeric_limits<float>::infinity())
override;
114 bool EventProcess(
const Event& event)
override;
115 void UpdateMapping();
117 void DeletePart(
int part)
override;
118 void SetObjectRank(
int part,
int objRank);
119 int GetObjectRank(
int part)
override;
120 void SetObjectParent(
int part,
int parent);
122 const char* GetName();
123 int GetOption()
override;
128 void SetDrawFront(
bool bDraw)
override;
130 int GetShadowLight();
131 int GetEffectLight();
133 void SetFloorHeight(
float height);
134 void FloorAdjust()
override;
143 void SetPartPosition(
int part,
const Math::Vector &pos);
146 void SetPartRotation(
int part,
const Math::Vector &angle);
148 void SetPartRotationY(
int part,
float angle);
149 void SetPartRotationX(
int part,
float angle);
150 void SetPartRotationZ(
int part,
float angle);
151 float GetPartRotationY(
int part);
152 float GetPartRotationX(
int part);
153 float GetPartRotationZ(
int part);
155 void SetPartScale(
int part,
float zoom);
158 void SetPartScaleX(
int part,
float zoom);
159 float GetPartScaleX(
int part);
160 void SetPartScaleY(
int part,
float zoom);
161 float GetPartScaleY(
int part);
162 void SetPartScaleZ(
int part,
float zoom);
163 float GetPartScaleZ(
int part);
168 void SetToy(
bool bEnable);
171 void SetManual(
bool bManual);
174 void SetMasterParticle(
int part,
int parti)
override;
184 void SetTransporterPart(
int part)
override;
204 void SetRange(
float delay)
override;
213 bool JostleObject(
float force)
override;
215 void SetVirusMode(
bool bEnable)
override;
216 bool GetVirusMode()
override;
227 void SetSelect(
bool select,
bool bDisplayError =
true)
override;
230 void SetSelectable(
bool bMode);
233 void SetUnderground(
bool underground);
235 void SetCheckToken(
bool bMode);
236 bool GetCheckToken();
241 void SetDying(DeathType deathType)
override;
248 void SetGunGoalV(
float gunGoal);
249 void SetGunGoalH(
float gunGoal);
255 void CreateSelectParticle();
259 CAuto* GetAuto()
override;
262 bool CreateShadowLight(
float height,
Gfx::Color color);
263 bool CreateEffectLight(
float height,
Gfx::Color color);
265 void FlatParent()
override;
294 bool EventFrame(
const Event &event);
295 void VirusFrame(
float rTime);
296 void PartiFrame(
float rTime);
297 void InitPart(
int part);
298 void UpdateTotalPart();
299 int SearchDescendant(
int parent,
int n);
300 void UpdateEnergyMapping();
301 bool UpdateTransformObject(
int part,
bool bForceUpdate);
302 bool UpdateTransformObject();
303 void UpdateSelectParticle();
316 std::unique_ptr<CPhysics> m_physics;
317 std::unique_ptr<CMotion> m_motion;
318 std::unique_ptr<CAuto> m_auto;
319 std::unique_ptr<Ui::CObjectInterface> m_objectInterface;
325 float m_shadowHeight;
327 float m_effectHeight;
335 int m_transporterLink;
339 float m_transparency;
344 float m_lastVirusParticle;
360 float m_magnifyDamage;
364 float m_shieldRadius;
376 float m_reactorRange;
379 TraceColor m_traceColor;
Interface for transportable objects.
Definition: transportable_object.h:29
Normal shadow.
Definition: engine.h:302
void TransformCameraCollisionSphere(Math::Sphere &collisionSphere) override
Transform crash sphere by object's world matrix.
Definition: old_object.cpp:1203
CameraType
Type of camera.
Definition: camera.h:46
CObject * GetTransporter() override
Return transported object.
Definition: old_object.cpp:1591
float GetRange() override
Returns jet engine heating speed (bigger = slower, 0 for infinite)
Definition: old_object.cpp:2451
Definition: old_object_interface.h:36
bool DeleteObject(CObject *instance)
Deletes the object.
Definition: object_manager.cpp:63
void SetHighlight(bool highlight) override
Highlights the object on mouse over.
Definition: old_object.cpp:2578
void SetRotation(const Math::Vector &rotation) override
Sets object's rotation (Euler angles)
Definition: old_object.cpp:3094
Gfx::CameraType GetCameraType() override
Return camera type for this object.
Definition: old_object.cpp:2549
Definition: robotmain.h:107
float GetShieldFullRegenTime() override
Return time (in seconds) required for full shield regeneration.
Definition: old_object.cpp:3173
Definition: programmable_impl.h:47
bool GetSelect() override
Checks if the object is selected.
Definition: old_object.cpp:2643
4x4 matrix
Definition: matrix.h:65
bool GetTrainer() override
Checks if remote control is disabled.
Definition: old_object.cpp:1513
Interface for objects that have a button in UI for showing range.
Definition: ranged_object.h:28
void Write(CLevelParserLine *line) override
Writes object properties to line in level file.
Definition: old_object.cpp:937
void UpdateInterface() override
Updates all interface controls.
Definition: old_object.cpp:3109
void SetTrainer(bool bEnable) override
Disables remote control of an object (only programming allowed)
Definition: old_object.cpp:1503
float GetCapacity() override
Return capacity of this power container.
Definition: old_object.cpp:2417
float GetCameraDist() override
Return camera distance for this object.
Definition: old_object.cpp:2559
Definition: task_executor_impl.h:28
TraceColor GetTraceColor() override
Return color of the trace.
Definition: old_object.cpp:3147
DeathType GetDying() override
Return object death type.
Definition: old_object.cpp:2711
Definition: old_object.h:77
Interface for interactive objects (objects able to process events from event loop) ...
Definition: interactive_object.h:30
void SetTransparency(float value) override
Sets the transparency of object.
Definition: old_object.cpp:2471
bool GetActive() override
Is this object active (not dead)?
Definition: old_object.cpp:2721
virtual void SetScale(const Math::Vector &scale)
Sets objects's scale.
Definition: object.cpp:206
Manager for dynamic lights in 3D scene.
Definition: lightman.h:146
Interface for shielded objects with auto regeneration.
Definition: shielded_auto_regen_object.h:28
bool GetSelectable() override
Returns true if the object is selectable.
Definition: old_object.cpp:2658
void TransformCrashSphere(Math::Sphere &crashSphere) override
Transform crash sphere by object's world matrix.
Definition: old_object.cpp:1177
Definition: parserline.h:37
Interface for carrier objects.
Definition: carrier_object.h:29
Interface for objects powered using power cells.
Definition: powered_object.h:37
bool DamageObject(DamageType type, float force=std::numeric_limits< float >::infinity()) override
Damage the object, with the given force. Returns true if the object has been fully destroyed (assumin...
Definition: old_object.cpp:333
void SetDying(DeathType deathType) override
Set the status that means the object is currently dying.
Definition: old_object.cpp:2700
void SetTransporter(CObject *transporter) override
Set transporter object that transports this object.
Definition: old_object.cpp:1583
Definition: robotmain.h:151
void SetCameraDist(float dist) override
Set camera distance for this object.
Definition: old_object.cpp:2554
bool IsRechargeable() override
Returns true if this power container can be recharged.
Definition: old_object.cpp:2422
bool GetCameraLock() override
Check if camera changes are disallowed.
Definition: old_object.cpp:2569
void SetSelect(bool select, bool bDisplayError=true) override
Selects the object.
Definition: old_object.cpp:2601
Particle engine.
Definition: particle.h:223
CObject * GetPower() override
Returns the power cell.
Definition: old_object.cpp:1553
Interface for objects that can draw wheel trace (at the moment, all movable objects) ...
Definition: trace_drawing_object.h:64
Interface for objects that can be selected and controlled by the player.
Definition: controllable_object.h:30
Interface for objects that can fly using a jet engine.
Definition: jet_flying_object.h:30
void SetCameraType(Gfx::CameraType type) override
Set camera type for this object.
Definition: old_object.cpp:2544
void Read(CLevelParserLine *line) override
Reads object properties from line in level file.
Definition: old_object.cpp:1028
CObject * GetCargo() override
Returns carried object.
Definition: old_object.cpp:1576
void SetTraceWidth(float width) override
Set trace width.
Definition: old_object.cpp:3162
void SetRange(float delay) override
Sets jet engine heating speed (bigger = slower, 0 for infinite)
Definition: old_object.cpp:2446
float GetLightningHitProbability() override
Returns the distance modifier for CLightning, used to modify hit probability. Value in range [0...
Definition: old_object.cpp:3180
void SetCameraLock(bool lock) override
Disallow camera changes.
Definition: old_object.cpp:2564
Definition: old_object.h:53
Interface for objects that can be jostled.
Definition: jostleable_object.h:30
void SetReactorRange(float reactorRange) override
Sets current jet engine heat level (this is actually how much is left before it overheats, so smaller = more hot)
Definition: old_object.cpp:2456
void AdjustCamera(Math::Vector &eye, float &dirH, float &dirV, Math::Vector &lookat, Math::Vector &upVec, Gfx::CameraType type) override
Adjust camera parameters for the given object.
Definition: old_object.cpp:2270
void SetCargo(CObject *cargo) override
Sets carried object.
Definition: old_object.cpp:1571
void DestroyObject(DestructionType type) override
Destroy the object immediately. Use this only if you are 100% sure this is what you want...
Definition: old_object.cpp:423
void SetPower(CObject *power) override
Sets power cell.
Definition: old_object.cpp:1548
Camera moving in 3D scene.
Definition: camera.h:134
void SetTraceDown(bool down) override
Put the drawing pencil down.
Definition: old_object.cpp:3142
Terrain loader/generator and manager.
Definition: terrain.h:145
CMotion * GetMotion() override
Returns CMotion instance associated with this object. If the object implements Movable interface...
Definition: old_object.cpp:3046
Math::Vector GetPowerPosition() override
Returns the relative position of power cell.
Definition: old_object.cpp:1563
Math::Vector GetPosition() const override
Returns object's position.
Definition: old_object.cpp:3079
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:620
float GetTraceWidth() override
Return trace width.
Definition: old_object.cpp:3157
Math::Vector GetScale() const override
Returns object's scale.
Definition: old_object.cpp:3099
bool IsDying() override
Is object currently dying?
Definition: old_object.cpp:2716
ObjectType
Type of game object.
Definition: object_type.h:33
Definition: power_container_impl.h:26
bool IsRepairable() override
Returns true if this object can be repaired in RepairStation.
Definition: old_object.cpp:3167
void SetShield(float level) override
Set shield level.
Definition: old_object.cpp:2430
3D (3x1) vector
Definition: vector.h:53
void SetScale(const Math::Vector &scale) override
Sets objects's scale.
Definition: old_object.cpp:3104
Definition: program_storage_impl.h:30
EngineShadowType
Definition: engine.h:299
void SetMagnifyDamage(float factor) override
Set damage multiplier for the object (bigger = more damage, weaker shield)
Definition: old_object.cpp:2689
float GetMagnifyDamage() override
Return damage multiplier for the object (bigger = more damage, weaker shield)
Definition: old_object.cpp:2694
CPhysics * GetPhysics() override
Returns CPhysics instance associated with this object. If the object implements Movable interface...
Definition: old_object.cpp:3039
Math::Vector GetRotation() const override
Returns object's rotation (Euler angles)
Definition: old_object.cpp:3089
RGBA color.
Definition: color.h:39
Definition: object_factory.h:48
Manages CObject instances.
Definition: object_manager.h:148
void SetPowerPosition(const Math::Vector &powerPosition) override
Sets the relative position of power cell.
Definition: old_object.cpp:1558
EventType
Type of event message.
Definition: event.h:41
Event sent by system, interface or game.
Definition: event.h:709
float GetReactorRange() override
Returns current jet engine heat level (this is actually how much is left before it overheats...
Definition: old_object.cpp:2463
float GetShowLimitRadius() override
Return object operation radius for display after clicking UI button.
Definition: old_object.cpp:2812
Base class for all 3D in-game objects.
Definition: object.h:59
void SetPosition(const Math::Vector &pos) override
Sets object's position.
Definition: old_object.cpp:3084
void SetTraceColor(TraceColor color) override
Set color of the trace.
Definition: old_object.cpp:3152
float GetShield() override
Get shield level.
Definition: old_object.cpp:2437
bool GetDetectable() override
Is this object detectable (not dead and not underground)?
Definition: old_object.cpp:2726
Sound plugin interface.
Definition: sound.h:57
void StopProgram() override
Stop currently running program.
Definition: old_object.cpp:3120
bool GetTraceDown() override
Is the pencil down?
Definition: old_object.cpp:3137