Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Represents an entity's position in the world (plus its orientation). More...
#include <ICmpPosition.h>
Public Member Functions | |
virtual void | SetTurretParent (entity_id_t parent, const CFixedVector3D &offset)=0 |
Set this as a turret of an other entity. More... | |
virtual entity_id_t | GetTurretParent () const =0 |
Get the turret parent of this entity. More... | |
virtual void | UpdateTurretPosition ()=0 |
Has to be called to update the simulation position of the turret. More... | |
virtual std::set< entity_id_t > * | GetTurrets ()=0 |
Get the list of turrets to read or edit. More... | |
virtual bool | IsInWorld () const =0 |
Returns true if the entity currently exists at a defined position in the world. More... | |
virtual void | MoveOutOfWorld ()=0 |
Causes IsInWorld to return false. More... | |
virtual void | MoveTo (entity_pos_t x, entity_pos_t z)=0 |
Move smoothly to the given location. More... | |
virtual void | MoveAndTurnTo (entity_pos_t x, entity_pos_t z, entity_angle_t ry)=0 |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange". More... | |
virtual void | JumpTo (entity_pos_t x, entity_pos_t z)=0 |
Move immediately to the given location, with no interpolation. More... | |
virtual void | SetHeightOffset (entity_pos_t dy)=0 |
Set the vertical offset above the terrain/water surface. More... | |
virtual entity_pos_t | GetHeightOffset () const =0 |
Returns the current vertical offset above the terrain/water surface. More... | |
virtual void | SetHeightFixed (entity_pos_t y)=0 |
Set the vertical position above the map zero point. More... | |
virtual entity_pos_t | GetHeightFixed () const =0 |
Returns the current vertical offset above above the map zero point. More... | |
virtual entity_pos_t | GetHeightAtFixed (entity_pos_t x, entity_pos_t z) const =0 |
Returns the vertical offset above above the map zero point the unit would have at the given position. More... | |
virtual bool | IsHeightRelative () const =0 |
Returns true iff the entity will follow the terrain height (possibly with an offset) More... | |
virtual void | SetHeightRelative (bool flag)=0 |
When set to true, the entity will follow the terrain height (possibly with an offset) When set to false, it's height won't change automatically. More... | |
virtual bool | CanFloat () const =0 |
Returns whether the entity can float on water. More... | |
virtual void | SetFloating (bool flag)=0 |
Set the entity to float on water. More... | |
virtual void | SetActorFloating (bool flag)=0 |
Set the entity to float on water, in a non-network-synchronised visual-only way. More... | |
virtual void | SetConstructionProgress (fixed progress)=0 |
Set construction progress of the model, this affects the rendered position of the model. More... | |
virtual CFixedVector3D | GetPosition () const =0 |
Returns the current x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPosition2D () const =0 |
Returns the current x,z position (no interpolation). More... | |
virtual CFixedVector3D | GetPreviousPosition () const =0 |
Returns the previous turn's x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPreviousPosition2D () const =0 |
Returns the previous turn's x,z position (no interpolation). More... | |
virtual fixed | GetTurnRate () const =0 |
Returns the turn rate in radians per second. More... | |
virtual void | TurnTo (entity_angle_t y)=0 |
Rotate smoothly to the given angle around the upwards axis. More... | |
virtual void | SetYRotation (entity_angle_t y)=0 |
Rotate immediately to the given angle around the upwards axis. More... | |
virtual void | SetXZRotation (entity_angle_t x, entity_angle_t z)=0 |
Rotate immediately to the given angles around the X (pitch) and Z (roll) axes. More... | |
virtual CFixedVector3D | GetRotation () const =0 |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll. More... | |
virtual fixed | GetDistanceTravelled () const =0 |
Returns the distance that the unit will be interpolated over, i.e. More... | |
virtual void | GetInterpolatedPosition2D (float frameOffset, float &x, float &z, float &rotY) const =0 |
Get the current interpolated 2D position and orientation, for rendering. More... | |
virtual CMatrix3D | GetInterpolatedTransform (float frameOffset) const =0 |
Get the current interpolated transform matrix, for rendering. More... | |
Public Member Functions inherited from IComponent | |
virtual | ~IComponent () |
virtual void | Init (const CParamNode ¶mNode)=0 |
virtual void | Deinit ()=0 |
virtual void | HandleMessage (const CMessage &msg, bool global) |
CEntityHandle | GetEntityHandle () const |
void | SetEntityHandle (CEntityHandle ent) |
entity_id_t | GetEntityId () const |
CEntityHandle | GetSystemEntity () const |
const CSimContext & | GetSimContext () const |
void | SetSimContext (const CSimContext &context) |
virtual void | Serialize (ISerializer &serialize)=0 |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize)=0 |
virtual bool | NewJSObject (const ScriptInterface &scriptInterface, JS::MutableHandleObject out) const |
Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More... | |
virtual JS::Value | GetJSInstance () const |
virtual int | GetComponentTypeId () const =0 |
Additional Inherited Members | |
Public Types inherited from IComponent | |
using | AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor) |
using | DeallocFunc = void(*)(IComponent *) |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static void | RegisterComponentType (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
static void | RegisterComponentTypeScriptWrapper (CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema) |
static u8 | GetSerializationVersion () |
Represents an entity's position in the world (plus its orientation).
Entity positions are determined by the following:
Orientations consist of the following:
Entities can also be 'outside the world' (e.g. hidden inside a building), in which case they have no position. Callers must check the entity is in the world, before querying its position.
|
pure virtual |
Returns whether the entity can float on water.
Implemented in CCmpPosition.
|
pure virtual |
Returns the distance that the unit will be interpolated over, i.e.
the distance travelled since the start of the turn.
Implemented in CCmpPosition.
|
pure virtual |
Returns the vertical offset above above the map zero point the unit would have at the given position.
Implemented in CCmpPosition.
|
pure virtual |
Returns the current vertical offset above above the map zero point.
Implemented in CCmpPosition.
|
pure virtual |
Returns the current vertical offset above the terrain/water surface.
Implemented in CCmpPosition.
|
pure virtual |
Get the current interpolated 2D position and orientation, for rendering.
Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Get the current interpolated transform matrix, for rendering.
Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Returns the current x,y,z position (no interpolation).
Depends on the current terrain heightmap. Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Returns the current x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Returns the previous turn's x,y,z position (no interpolation).
Depends on the current terrain heightmap. Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Returns the previous turn's x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implemented in CCmpPosition.
|
pure virtual |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll.
(TODO: is that the right way round?)
Implemented in CCmpPosition.
|
pure virtual |
Returns the turn rate in radians per second.
Implemented in CCmpPosition.
|
pure virtual |
Get the turret parent of this entity.
Implemented in CCmpPosition.
|
pure virtual |
Get the list of turrets to read or edit.
Implemented in CCmpPosition.
|
pure virtual |
Returns true iff the entity will follow the terrain height (possibly with an offset)
Implemented in CCmpPosition.
|
pure virtual |
Returns true if the entity currently exists at a defined position in the world.
Implemented in CCmpPosition.
|
pure virtual |
Move immediately to the given location, with no interpolation.
Implemented in CCmpPosition.
|
pure virtual |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange".
Implemented in CCmpPosition.
|
pure virtual |
Causes IsInWorld to return false.
(Use MoveTo() or JumpTo() to move back into the world.)
Implemented in CCmpPosition.
|
pure virtual |
Move smoothly to the given location.
Implemented in CCmpPosition.
|
pure virtual |
Set the entity to float on water, in a non-network-synchronised visual-only way.
(This is to support the 'floating' flag in actor XMLs.)
Implemented in CCmpPosition.
|
pure virtual |
Set construction progress of the model, this affects the rendered position of the model.
0.0 will be fully underground, 1.0 will be fully visible, 0.5 will be half underground.
Implemented in CCmpPosition.
|
pure virtual |
Set the entity to float on water.
Implemented in CCmpPosition.
|
pure virtual |
Set the vertical position above the map zero point.
Implemented in CCmpPosition.
|
pure virtual |
Set the vertical offset above the terrain/water surface.
Implemented in CCmpPosition.
|
pure virtual |
When set to true, the entity will follow the terrain height (possibly with an offset) When set to false, it's height won't change automatically.
Implemented in CCmpPosition.
|
pure virtual |
Set this as a turret of an other entity.
Implemented in CCmpPosition.
|
pure virtual |
Rotate immediately to the given angles around the X (pitch) and Z (roll) axes.
x | radians around the X axis. (TODO: in which direction?) |
z | radians around the Z axis. |
Implemented in CCmpPosition.
|
pure virtual |
Rotate immediately to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implemented in CCmpPosition.
|
pure virtual |
Rotate smoothly to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implemented in CCmpPosition.
|
pure virtual |
Has to be called to update the simulation position of the turret.
Implemented in CCmpPosition.