31 #include "object/implementation/power_container_impl.h"
32 #include "object/implementation/program_storage_impl.h"
33 #include "object/implementation/programmable_impl.h"
34 #include "object/implementation/task_executor_impl.h"
36 #include "object/interface/carrier_object.h"
37 #include "object/interface/controllable_object.h"
38 #include "object/interface/flying_object.h"
39 #include "object/interface/interactive_object.h"
40 #include "object/interface/jet_flying_object.h"
41 #include "object/interface/jostleable_object.h"
42 #include "object/interface/movable_object.h"
43 #include "object/interface/power_container_object.h"
44 #include "object/interface/powered_object.h"
45 #include "object/interface/programmable_object.h"
46 #include "object/interface/ranged_object.h"
47 #include "object/interface/shielded_auto_regen_object.h"
48 #include "object/interface/task_executor_object.h"
49 #include "object/interface/trace_drawing_object.h"
50 #include "object/interface/transportable_object.h"
53 const int OBJECTMAXPART = 40;
64 bool bTranslate =
false;
75 class CObjectInterface;
100 void SetProgrammable();
101 void SetMovable(std::unique_ptr<CMotion> motion, std::unique_ptr<CPhysics> physics);
102 void SetAuto(std::unique_ptr<CAuto> automat);
103 void SetOption(
int option);
104 void SetJostlingSphere(
const Math::Sphere& jostlingSphere);
111 void Simplify()
override;
113 bool DamageObject(DamageType type,
float force = std::numeric_limits<float>::infinity())
override;
116 bool EventProcess(
const Event& event)
override;
117 void UpdateMapping();
119 void DeletePart(
int part)
override;
120 void SetObjectRank(
int part,
int objRank);
121 int GetObjectRank(
int part)
override;
122 void SetObjectParent(
int part,
int parent);
124 const char* GetName();
125 int GetOption()
override;
130 void SetDrawFront(
bool bDraw)
override;
132 int GetShadowLight();
134 void SetFloorHeight(
float height);
135 void FloorAdjust()
override;
144 void SetPartPosition(
int part,
const Math::Vector &pos);
147 void SetPartRotation(
int part,
const Math::Vector &angle);
149 void SetPartRotationY(
int part,
float angle);
150 void SetPartRotationX(
int part,
float angle);
151 void SetPartRotationZ(
int part,
float angle);
152 float GetPartRotationY(
int part);
153 float GetPartRotationX(
int part);
154 float GetPartRotationZ(
int part);
156 void SetPartScale(
int part,
float zoom);
159 void SetPartScaleX(
int part,
float zoom);
160 float GetPartScaleX(
int part);
161 void SetPartScaleY(
int part,
float zoom);
162 float GetPartScaleY(
int part);
163 void SetPartScaleZ(
int part,
float zoom);
164 float GetPartScaleZ(
int part);
169 void SetToy(
bool bEnable);
172 void SetManual(
bool bManual);
175 void SetMasterParticle(
int part,
int parti)
override;
185 void SetTransporterPart(
int part)
override;
205 void SetRange(
float delay)
override;
214 bool JostleObject(
float force)
override;
216 void SetVirusMode(
bool bEnable)
override;
217 bool GetVirusMode()
override;
226 void SetSelect(
bool select,
bool bDisplayError =
true)
override;
229 void SetSelectable(
bool bMode);
232 void SetUnderground(
bool underground);
234 void SetCheckToken(
bool bMode);
235 bool GetCheckToken();
240 void SetDying(DeathType deathType)
override;
247 void SetGunGoalV(
float gunGoal);
248 void SetGunGoalH(
float gunGoal);
254 void CreateSelectParticle();
258 CAuto* GetAuto()
override;
261 bool CreateShadowLight(
float height,
Gfx::Color color);
263 void FlatParent()
override;
292 bool EventFrame(
const Event &event);
293 void VirusFrame(
float rTime);
294 void PartiFrame(
float rTime);
295 void InitPart(
int part);
296 void UpdateTotalPart();
297 int SearchDescendant(
int parent,
int n);
298 void UpdateEnergyMapping();
299 bool UpdateTransformObject(
int part,
bool bForceUpdate);
300 bool UpdateTransformObject();
301 void UpdateSelectParticle();
314 std::unique_ptr<CPhysics> m_physics;
315 std::unique_ptr<CMotion> m_motion;
316 std::unique_ptr<CAuto> m_auto;
317 std::unique_ptr<Ui::CObjectInterface> m_objectInterface;
323 float m_shadowHeight;
331 int m_transporterLink;
339 float m_lastVirusParticle;
353 float m_magnifyDamage;
356 float m_shieldRadius;
368 float m_reactorRange;
371 TraceColor m_traceColor;
Interface for transportable objects.
Definition: transportable_object.h:29
Normal shadow.
Definition: engine.h:301
void TransformCameraCollisionSphere(Math::Sphere &collisionSphere) override
Transform crash sphere by object's world matrix.
Definition: old_object.cpp:1192
CameraType
Type of camera.
Definition: camera.h:44
CObject * GetTransporter() override
Return transported object.
Definition: old_object.cpp:1573
float GetRange() override
Returns jet engine heating speed (bigger = slower, 0 for infinite)
Definition: old_object.cpp:2397
Definition: old_object_interface.h:39
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:2512
void SetRotation(const Math::Vector &rotation) override
Sets object's rotation (Euler angles)
Definition: old_object.cpp:3029
Gfx::CameraType GetCameraType() override
Return camera type for this object.
Definition: old_object.cpp:2493
Definition: robotmain.h:108
float GetShieldFullRegenTime() override
Return time (in seconds) required for full shield regeneration.
Definition: old_object.cpp:3108
Definition: programmable_impl.h:48
bool GetSelect() override
Checks if the object is selected.
Definition: old_object.cpp:2577
4x4 matrix
Definition: matrix.h:65
bool GetTrainer() override
Checks if remote control is disabled.
Definition: old_object.cpp:1495
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:934
void UpdateInterface() override
Updates all interface controls.
Definition: old_object.cpp:3044
void SetTrainer(bool bEnable) override
Disables remote control of an object (only programming allowed)
Definition: old_object.cpp:1485
float GetCapacity() override
Return capacity of this power container.
Definition: old_object.cpp:2363
Definition: task_executor_impl.h:28
TraceColor GetTraceColor() override
Return color of the trace.
Definition: old_object.cpp:3082
DeathType GetDying() override
Return object death type.
Definition: old_object.cpp:2645
Definition: old_object.h:79
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:2417
bool GetActive() override
Is this object active (not dead)?
Definition: old_object.cpp:2655
virtual void SetScale(const Math::Vector &scale)
Sets objects's scale.
Definition: object.cpp:207
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:2592
void TransformCrashSphere(Math::Sphere &crashSphere) override
Transform crash sphere by object's world matrix.
Definition: old_object.cpp:1166
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:338
void SetDying(DeathType deathType) override
Set the status that means the object is currently dying.
Definition: old_object.cpp:2634
void SetTransporter(CObject *transporter) override
Set transporter object that transports this object.
Definition: old_object.cpp:1565
Definition: robotmain.h:159
bool IsRechargeable() override
Returns true if this power container can be recharged.
Definition: old_object.cpp:2368
bool GetCameraLock() override
Check if camera changes are disallowed.
Definition: old_object.cpp:2503
void SetSelect(bool select, bool bDisplayError=true) override
Selects the object.
Definition: old_object.cpp:2535
Particle engine.
Definition: particle.h:223
CObject * GetPower() override
Returns the power cell.
Definition: old_object.cpp:1535
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:2488
void Read(CLevelParserLine *line) override
Reads object properties from line in level file.
Definition: old_object.cpp:1025
CObject * GetCargo() override
Returns carried object.
Definition: old_object.cpp:1558
void SetTraceWidth(float width) override
Set trace width.
Definition: old_object.cpp:3097
void SetRange(float delay) override
Sets jet engine heating speed (bigger = slower, 0 for infinite)
Definition: old_object.cpp:2392
float GetLightningHitProbability() override
Returns the distance modifier for CLightning, used to modify hit probability. Value in range [0...
Definition: old_object.cpp:3115
void SetCameraLock(bool lock) override
Disallow camera changes.
Definition: old_object.cpp:2498
Definition: old_object.h:55
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:2402
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:2216
void SetCargo(CObject *cargo) override
Sets carried object.
Definition: old_object.cpp:1553
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:428
void SetPower(CObject *power) override
Sets power cell.
Definition: old_object.cpp:1530
Camera moving in 3D scene.
Definition: camera.h:128
void SetTraceDown(bool down) override
Put the drawing pencil down.
Definition: old_object.cpp:3077
Terrain loader/generator and manager.
Definition: terrain.h:147
CMotion * GetMotion() override
Returns CMotion instance associated with this object. If the object implements Movable interface...
Definition: old_object.cpp:2981
Math::Vector GetPowerPosition() override
Returns the relative position of power cell.
Definition: old_object.cpp:1545
Math::Vector GetPosition() const override
Returns object's position.
Definition: old_object.cpp:3014
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:585
float GetTraceWidth() override
Return trace width.
Definition: old_object.cpp:3092
Math::Vector GetScale() const override
Returns object's scale.
Definition: old_object.cpp:3034
Event types, structs and event queue.
bool IsDying() override
Is object currently dying?
Definition: old_object.cpp:2650
ObjectType
Type of game object.
Definition: object_type.h:33
Definition: power_container_impl.h:25
bool IsRepairable() override
Returns true if this object can be repaired in RepairStation.
Definition: old_object.cpp:3102
void SetShield(float level) override
Set shield level.
Definition: old_object.cpp:2376
3D (3x1) vector
Definition: vector.h:53
void SetScale(const Math::Vector &scale) override
Sets objects's scale.
Definition: old_object.cpp:3039
Definition: program_storage_impl.h:30
EngineShadowType
Definition: engine.h:298
void SetMagnifyDamage(float factor) override
Set damage multiplier for the object (bigger = more damage, weaker shield)
Definition: old_object.cpp:2623
float GetMagnifyDamage() override
Return damage multiplier for the object (bigger = more damage, weaker shield)
Definition: old_object.cpp:2628
CPhysics * GetPhysics() override
Returns CPhysics instance associated with this object. If the object implements Movable interface...
Definition: old_object.cpp:2974
Math::Vector GetRotation() const override
Returns object's rotation (Euler angles)
Definition: old_object.cpp:3024
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:1540
EventType
Type of event message.
Definition: event.h:41
Event sent by system, interface or game.
Definition: event.h:735
float GetReactorRange() override
Returns current jet engine heat level (this is actually how much is left before it overheats...
Definition: old_object.cpp:2409
float GetShowLimitRadius() override
Return object operation radius for display after clicking UI button.
Definition: old_object.cpp:2746
Base class for all 3D in-game objects.
Definition: object.h:63
void SetPosition(const Math::Vector &pos) override
Sets object's position.
Definition: old_object.cpp:3019
void SetTraceColor(TraceColor color) override
Set color of the trace.
Definition: old_object.cpp:3087
float GetShield() override
Get shield level.
Definition: old_object.cpp:2383
bool GetDetectable() override
Is this object detectable (not dead and not underground)?
Definition: old_object.cpp:2660
Sound plugin interface.
Definition: sound.h:60
void StopProgram() override
Stop currently running program.
Definition: old_object.cpp:3055
bool GetTraceDown() override
Is the pencil down?
Definition: old_object.cpp:3072