Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ICmpPosition Class Referenceabstract

Represents an entity's position in the world (plus its orientation). More...

#include <ICmpPosition.h>

Inheritance diagram for ICmpPosition:
IComponent CCmpPosition

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...
 
- Public Member Functions inherited from IComponent
virtual ~IComponent ()
 
virtual void Init (const CParamNode &paramNode)=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 CSimContextGetSimContext () const
 
void SetSimContext (const CSimContext &context)
 
virtual void Serialize (ISerializer &serialize)=0
 
virtual void Deserialize (const CParamNode &paramNode, IDeserializer &deserialize)=0
 
virtual JSClass * GetJSClass () const
 
virtual jsval GetJSInstance () const
 

Additional Inherited Members

- Static Public Member Functions inherited from IComponent
static std::string GetSchema ()
 
static u8 GetSerializationVersion ()
 

Detailed Description

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.

Member Function Documentation

virtual fixed ICmpPosition::GetDistanceTravelled ( )
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.

virtual entity_pos_t ICmpPosition::GetHeightOffset ( )
pure virtual

Returns the current vertical offset above the terrain/water surface.

Implemented in CCmpPosition.

virtual void ICmpPosition::GetInterpolatedPosition2D ( float  frameOffset,
float &  x,
float &  z,
float &  rotY 
)
pure virtual

Get the current interpolated 2D position and orientation, for rendering.

Must not be called unless IsInWorld is true.

Implemented in CCmpPosition.

virtual CMatrix3D ICmpPosition::GetInterpolatedTransform ( float  frameOffset,
bool  forceFloating 
)
pure virtual

Get the current interpolated transform matrix, for rendering.

Must not be called unless IsInWorld is true.

Implemented in CCmpPosition.

virtual CFixedVector3D ICmpPosition::GetPosition ( )
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.

virtual CFixedVector2D ICmpPosition::GetPosition2D ( )
pure virtual

Returns the current x,z position (no interpolation).

Must not be called unless IsInWorld is true.

Implemented in CCmpPosition.

virtual CFixedVector3D ICmpPosition::GetPreviousPosition ( )
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.

virtual CFixedVector2D ICmpPosition::GetPreviousPosition2D ( )
pure virtual

Returns the previous turn's x,z position (no interpolation).

Must not be called unless IsInWorld is true.

Implemented in CCmpPosition.

virtual CFixedVector3D ICmpPosition::GetRotation ( )
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.

virtual bool ICmpPosition::IsFloating ( )
pure virtual

Returns whether the entity floats on water.

Implemented in CCmpPosition.

virtual bool ICmpPosition::IsInWorld ( )
pure virtual

Returns true if the entity currently exists at a defined position in the world.

Implemented in CCmpPosition.

virtual void ICmpPosition::JumpTo ( entity_pos_t  x,
entity_pos_t  z 
)
pure virtual

Move immediately to the given location, with no interpolation.

Implemented in CCmpPosition.

virtual void ICmpPosition::MoveOutOfWorld ( )
pure virtual

Causes IsInWorld to return false.

(Use MoveTo() or JumpTo() to move back into the world.)

Implemented in CCmpPosition.

virtual void ICmpPosition::MoveTo ( entity_pos_t  x,
entity_pos_t  z 
)
pure virtual

Move smoothly to the given location.

Implemented in CCmpPosition.

virtual void ICmpPosition::SetHeightFixed ( entity_pos_t  y)
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.

virtual void ICmpPosition::SetHeightOffset ( entity_pos_t  dy)
pure virtual

Set the vertical offset above the terrain/water surface.

Implemented in CCmpPosition.

virtual void ICmpPosition::SetXZRotation ( entity_angle_t  x,
entity_angle_t  z 
)
pure virtual

Rotate immediately to the given angles around the X (pitch) and Z (roll) axes.

Parameters
xradians around the X axis. (TODO: in which direction?)
zradians around the Z axis.
Note
if either x or z is non-zero, it will override terrain conformance mode

Implemented in CCmpPosition.

virtual void ICmpPosition::SetYRotation ( entity_angle_t  y)
pure virtual

Rotate immediately to the given angle around the upwards axis.

Parameters
yclockwise radians from the +Z axis.

Implemented in CCmpPosition.

virtual void ICmpPosition::TurnTo ( entity_angle_t  y)
pure virtual

Rotate smoothly to the given angle around the upwards axis.

Parameters
yclockwise radians from the +Z axis.

Implemented in CCmpPosition.


The documentation for this class was generated from the following file: