Pyrogenesis
13997
|
Represents an entity's position in the world (plus its orientation). More...
#include <ICmpPosition.h>
Public Member Functions | |
virtual bool | IsInWorld ()=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 | 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 ()=0 |
Returns the current vertical offset above the terrain/water surface. More... | |
virtual void | SetHeightFixed (entity_pos_t y)=0 |
Set the vertical position as a fixed, absolute value. More... | |
virtual bool | IsFloating ()=0 |
Returns whether the entity floats on water. More... | |
virtual CFixedVector3D | GetPosition ()=0 |
Returns the current x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPosition2D ()=0 |
Returns the current x,z position (no interpolation). More... | |
virtual CFixedVector3D | GetPreviousPosition ()=0 |
Returns the previous turn's x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPreviousPosition2D ()=0 |
Returns the previous turn's x,z position (no interpolation). 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 ()=0 |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll. More... | |
virtual fixed | GetDistanceTravelled ()=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)=0 |
Get the current interpolated 2D position and orientation, for rendering. More... | |
virtual CMatrix3D | GetInterpolatedTransform (float frameOffset, bool forceFloating)=0 |
Get the current interpolated transform matrix, for rendering. More... | |
![]() | |
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 JSClass * | GetJSClass () const |
virtual jsval | GetJSInstance () const |
Additional Inherited Members | |
![]() | |
static std::string | GetSchema () |
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.
Definition at line 58 of file ICmpPosition.h.
|
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 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 whether the entity floats on water.
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 |
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 vertical position as a fixed, absolute value.
Will stay at this height until the next call to SetHeightFixed or SetHeightOffset.
Implemented in CCmpPosition.
|
pure virtual |
Set the vertical offset above the terrain/water surface.
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.