27 #include "object/crash_sphere.h"
28 #include "object/object_create_params.h"
36 struct ModelCrashSphere;
117 void SetRotationY(
float angle);
118 void SetRotationZ(
float angle);
119 float GetRotationX();
120 float GetRotationY();
121 float GetRotationZ();
134 void SetScaleY(
float angle);
135 void SetScaleZ(
float angle);
142 void SetCrashSpheres(
const std::vector<Gfx::ModelCrashSphere>& crashSpheres);
224 bool m_animateOnReset;
227 bool m_proxyActivate;
228 float m_proxyDistance;
virtual void Read(CLevelParserLine *line)=0
Reads object properties from line in level file.
virtual Math::Vector GetScale() const
Returns object's scale.
Definition: object.cpp:202
virtual void SetTransparency(float value)=0
Sets the transparency of object.
void AddCrashSphere(const CrashSphere &crashSphere)
Adds a new crash sphere.
Definition: object.cpp:86
virtual void TransformCrashSphere(Math::Sphere &crashSphere)=0
Transform crash sphere by object's world matrix.
virtual Math::Vector GetPosition() const
Returns object's position.
Definition: object.cpp:144
int GetID() const
Returns object's unique id.
Definition: object.h:81
void SetProxyActivate(bool activate)
Enable object activation only after you come close.
Definition: object.cpp:306
virtual void Write(CLevelParserLine *line)=0
Writes object properties to line in level file.
void SetTeam(int team)
Sets object team (shouldn't be called after creation because the model won't update!) ...
Definition: object.cpp:296
bool GetCollisions()
Returns true if collisions are enabled.
Definition: object.cpp:291
ObjectInterfaceTypes m_implementedInterfaces
interfaces that the object implements
Definition: object.h:218
bool GetAnimateOnReset()
Returns flag controlling animation effect on level reset.
Definition: object.cpp:276
std::vector< CrashSphere > m_crashSpheres
crash spheres
Definition: object.h:222
float GetProxyDistance()
Returns distance for close activation.
Definition: object.cpp:321
Legacy CObject interface.
virtual void SetScale(const Math::Vector &scale)
Sets objects's scale.
Definition: object.cpp:207
CBot::CBotVar * GetBotVar()
Returns CBot "object" variable associated with this object.
Definition: object.cpp:326
virtual void SetRotation(const Math::Vector &rotation)
Sets object's rotation (Euler angles)
Definition: object.cpp:160
Sphere used to detect object collisions.
Definition: crash_sphere.h:33
void SetAnimateOnReset(bool animateOnReset)
Sets flag controlling animation effect on level reset.
Definition: object.cpp:281
Definition: parserline.h:37
A CBot variable.
Definition: CBotVar.h:42
bool GetProxyActivate()
Returns close activation mode.
Definition: object.cpp:311
void SetCollisions(bool collisions)
Turns object collisions on/off.
Definition: object.cpp:286
static ObjectCreateParams ReadCreateParams(CLevelParserLine *line)
Reads params required for object creation.
Definition: object.cpp:60
int GetCrashSphereCount()
Returns total number of crash spheres.
Definition: object.cpp:254
ObjectInterfaceType
Type of interface that an object implements.
Definition: object_interface_type.h:34
virtual void SetPosition(const Math::Vector &pos)
Sets object's position.
Definition: object.cpp:149
ObjectType m_type
object type
Definition: object.h:217
void SetCrashSpheres(const std::vector< Gfx::ModelCrashSphere > &crashSpheres)
Sets crash spheres for object.
Definition: object.cpp:76
virtual Math::Vector GetRotation() const
Returns object's rotation (Euler angles)
Definition: object.cpp:155
Math::Sphere GetCameraCollisionSphere()
Returns sphere used to test for camera collisions.
Definition: object.cpp:269
void SetScaleX(float angle)
Definition: object.cpp:218
ObjectInterfaceType enum.
bool Implements(ObjectInterfaceType type) const
Check if object implements the given type of interface.
Definition: object.h:97
Namespace for (new) graphics code.
Definition: app.h:49
std::string GetTooltipText()
Returns tooltip text for an object.
Definition: object.cpp:331
void DeleteAllCrashSpheres()
Removes all crash spheres.
Definition: object.cpp:259
Definition: object_create_params.h:26
virtual bool GetDetectable()
Is this object detectable (not dead and not underground)?
Definition: object.h:207
CrashSphere GetFirstCrashSphere()
Returns the first crash sphere (assumes it exists)
Definition: object.cpp:91
CObject(int id, ObjectType type)
Constructor only accessible to subclasses.
Definition: object.cpp:38
ObjectType
Type of game object.
Definition: object_type.h:33
Definition: old_object_interface.h:48
void SetLock(bool lock)
Set "lock" mode of an object (for example, a robot while it's being factored, or a building while it'...
Definition: object.cpp:346
std::vector< CrashSphere > GetAllCrashSpheres()
Returns all crash spheres.
Definition: object.cpp:100
3D (3x1) vector
Definition: vector.h:53
int GetTeam()
Returns object team.
Definition: object.cpp:301
bool CanCollideWith(CObject *other)
Returns true if this object can collide with the other one.
Definition: object.cpp:114
virtual void UpdateInterface()
Updates all interface controls.
Definition: object.h:94
bool GetLock()
Return "lock" mode of an object.
Definition: object.cpp:351
ObjectType GetType() const
Returns object type.
Definition: object.h:76
CBot engine.
Definition: CBotCallMethode.cpp:28
void SetCameraCollisionSphere(const Math::Sphere &sphere)
Sets sphere used to test for camera collisions.
Definition: object.cpp:264
Base class for all 3D in-game objects.
Definition: object.h:63
void SetProxyDistance(float distance)
Sets distance for close activation.
Definition: object.cpp:316
void SetRotationX(float angle)
Definition: object.cpp:166
virtual bool GetActive()
Is this object active (not dead)?
Definition: object.h:205
virtual void TransformCameraCollisionSphere(Math::Sphere &collisionSphere)=0
Transform crash sphere by object's world matrix.
const int m_id
unique identifier
Definition: object.h:216