Pyrogenesis
trunk
|
Basic ICmpPosition implementation. More...
Public Types | |
enum | { UPRIGHT = 0, PITCH = 1, PITCH_ROLL = 2, ROLL = 3 } |
Public Member Functions | |
virtual int | GetComponentTypeId () const |
virtual void | Init (const CParamNode ¶mNode) |
virtual void | Deinit () |
virtual void | Serialize (ISerializer &serialize) |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
void | Deserialized () |
virtual void | UpdateTurretPosition () |
Has to be called to update the simulation position of the turret. More... | |
virtual std::set< entity_id_t > * | GetTurrets () |
Get the list of turrets to read or edit. More... | |
virtual void | SetTurretParent (entity_id_t id, const CFixedVector3D &offset) |
Set this as a turret of an other entity. More... | |
virtual entity_id_t | GetTurretParent () const |
Get the turret parent of this entity. More... | |
virtual bool | IsInWorld () const |
Returns true if the entity currently exists at a defined position in the world. More... | |
virtual void | MoveOutOfWorld () |
Causes IsInWorld to return false. More... | |
virtual void | MoveTo (entity_pos_t x, entity_pos_t z) |
Move smoothly to the given location. More... | |
virtual void | MoveAndTurnTo (entity_pos_t x, entity_pos_t z, entity_angle_t ry) |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange". More... | |
virtual void | JumpTo (entity_pos_t x, entity_pos_t z) |
Move immediately to the given location, with no interpolation. More... | |
virtual void | SetHeightOffset (entity_pos_t dy) |
Set the vertical offset above the terrain/water surface. More... | |
virtual entity_pos_t | GetHeightOffset () const |
Returns the current vertical offset above the terrain/water surface. More... | |
virtual void | SetHeightFixed (entity_pos_t y) |
Set the vertical position above the map zero point. More... | |
virtual entity_pos_t | GetHeightFixed () const |
Returns the vertical offset above the map zero point. More... | |
virtual bool | IsHeightRelative () const |
Returns true iff the entity will follow the terrain height (possibly with an offset) More... | |
virtual void | SetHeightRelative (bool relative) |
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 | IsFloating () const |
Returns whether the entity floats on water. More... | |
virtual void | SetFloating (bool flag) |
Set the entity to float on water. More... | |
virtual void | SetActorFloating (bool flag) |
Set the entity to float on water, in a non-network-synchronised visual-only way. More... | |
virtual void | SetConstructionProgress (fixed progress) |
Set construction progress of the model, this affects the rendered position of the model. More... | |
virtual CFixedVector3D | GetPosition () const |
Returns the current x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPosition2D () const |
Returns the current x,z position (no interpolation). More... | |
virtual CFixedVector3D | GetPreviousPosition () const |
Returns the previous turn's x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPreviousPosition2D () const |
Returns the previous turn's x,z position (no interpolation). More... | |
virtual void | TurnTo (entity_angle_t y) |
Rotate smoothly to the given angle around the upwards axis. More... | |
virtual void | SetYRotation (entity_angle_t y) |
Rotate immediately to the given angle around the upwards axis. More... | |
virtual void | SetXZRotation (entity_angle_t x, entity_angle_t z) |
Rotate immediately to the given angles around the X (pitch) and Z (roll) axes. More... | |
virtual CFixedVector3D | GetRotation () const |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll. More... | |
virtual fixed | GetDistanceTravelled () const |
Returns the distance that the unit will be interpolated over, i.e. More... | |
float | GetConstructionProgressOffset (const CVector3D &pos) const |
virtual void | GetInterpolatedPosition2D (float frameOffset, float &x, float &z, float &rotY) const |
Get the current interpolated 2D position and orientation, for rendering. More... | |
virtual CMatrix3D | GetInterpolatedTransform (float frameOffset) const |
Get the current interpolated transform matrix, for rendering. More... | |
void | GetInterpolatedPositions (CVector3D &pos0, CVector3D &pos1) const |
virtual void | HandleMessage (const CMessage &msg, bool global) |
Public Member Functions inherited from IComponent | |
virtual | ~IComponent () |
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 bool | NewJSObject (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 |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, JS::HandleValue) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static u8 | GetSerializationVersion () |
Public Attributes | |
enum CCmpPosition:: { ... } | m_AnchorType |
bool | m_Floating |
float | m_RotYSpeed |
bool | m_InWorld |
entity_pos_t | m_X |
entity_pos_t | m_Z |
entity_pos_t | m_LastX |
entity_pos_t | m_LastZ |
entity_pos_t | m_PrevX |
entity_pos_t | m_PrevZ |
entity_pos_t | m_Y |
entity_pos_t | m_LastYDifference |
bool | m_RelativeToGround |
fixed | m_ConstructionProgress |
entity_angle_t | m_RotX |
entity_angle_t | m_RotY |
entity_angle_t | m_RotZ |
player_id_t | m_Territory |
entity_id_t | m_TurretParent |
CFixedVector3D | m_TurretPosition |
std::set< entity_id_t > | m_Turrets |
float | m_InterpolatedRotX |
float | m_InterpolatedRotY |
float | m_InterpolatedRotZ |
float | m_LastInterpolatedRotX |
float | m_LastInterpolatedRotZ |
bool | m_ActorFloating |
bool | m_EnabledMessageInterpolate |
Private Member Functions | |
void | UpdateMessageSubscriptions () |
void | AdvertisePositionChanges () const |
This must be called after changing anything that will affect the return value of GetPosition2D() or GetRotation().Y: More... | |
void | AdvertiseInterpolatedPositionChanges () const |
This must be called after changing anything that will affect the return value of GetInterpolatedPositions(): More... | |
void | UpdateXZRotation () |
Basic ICmpPosition implementation.
|
inlineprivate |
This must be called after changing anything that will affect the return value of GetInterpolatedPositions():
|
inlineprivate |
This must be called after changing anything that will affect the return value of GetPosition2D() or GetRotation().Y:
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Implements IComponent.
|
inline |
|
inlinevirtual |
Implements IComponent.
|
inline |
|
inlinevirtual |
Returns the distance that the unit will be interpolated over, i.e.
the distance travelled since the start of the turn.
Implements ICmpPosition.
|
inlinevirtual |
Returns the vertical offset above the map zero point.
Implements ICmpPosition.
|
inlinevirtual |
Returns the current vertical offset above the terrain/water surface.
Implements ICmpPosition.
|
inlinevirtual |
Get the current interpolated 2D position and orientation, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlinevirtual |
Get the current interpolated transform matrix, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlinevirtual |
Returns the current x,y,z position (no interpolation).
Depends on the current terrain heightmap. Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlinevirtual |
Returns the current x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlinevirtual |
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.
Implements ICmpPosition.
|
inlinevirtual |
Returns the previous turn's x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlinevirtual |
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?)
Implements ICmpPosition.
|
inlinestatic |
|
inlinevirtual |
Get the turret parent of this entity.
Implements ICmpPosition.
|
inlinevirtual |
Get the list of turrets to read or edit.
Implements ICmpPosition.
|
inlinevirtual |
Reimplemented from IComponent.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Returns whether the entity floats on water.
Implements ICmpPosition.
|
inlinevirtual |
Returns true iff the entity will follow the terrain height (possibly with an offset)
Implements ICmpPosition.
|
inlinevirtual |
Returns true if the entity currently exists at a defined position in the world.
Implements ICmpPosition.
|
inlinevirtual |
Move immediately to the given location, with no interpolation.
Implements ICmpPosition.
|
inlinevirtual |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange".
Implements ICmpPosition.
|
inlinevirtual |
Causes IsInWorld to return false.
(Use MoveTo() or JumpTo() to move back into the world.)
Implements ICmpPosition.
|
inlinevirtual |
Move smoothly to the given location.
Implements ICmpPosition.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
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.)
Implements ICmpPosition.
|
inlinevirtual |
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.
Implements ICmpPosition.
|
inlinevirtual |
Set the entity to float on water.
Implements ICmpPosition.
|
inlinevirtual |
Set the vertical position above the map zero point.
Implements ICmpPosition.
|
inlinevirtual |
Set the vertical offset above the terrain/water surface.
Implements ICmpPosition.
|
inlinevirtual |
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.
Implements ICmpPosition.
|
inlinevirtual |
Set this as a turret of an other entity.
Implements ICmpPosition.
|
inlinevirtual |
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. |
Implements ICmpPosition.
|
inlinevirtual |
Rotate immediately to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
|
inlinevirtual |
Rotate smoothly to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
|
inlineprivate |
|
inlinevirtual |
Has to be called to update the simulation position of the turret.
Implements ICmpPosition.
|
inlineprivate |
bool CCmpPosition::m_ActorFloating |
enum { ... } CCmpPosition::m_AnchorType |
fixed CCmpPosition::m_ConstructionProgress |
bool CCmpPosition::m_EnabledMessageInterpolate |
bool CCmpPosition::m_Floating |
float CCmpPosition::m_InterpolatedRotX |
float CCmpPosition::m_InterpolatedRotY |
float CCmpPosition::m_InterpolatedRotZ |
bool CCmpPosition::m_InWorld |
float CCmpPosition::m_LastInterpolatedRotX |
float CCmpPosition::m_LastInterpolatedRotZ |
entity_pos_t CCmpPosition::m_LastX |
entity_pos_t CCmpPosition::m_LastYDifference |
entity_pos_t CCmpPosition::m_LastZ |
entity_pos_t CCmpPosition::m_PrevX |
entity_pos_t CCmpPosition::m_PrevZ |
bool CCmpPosition::m_RelativeToGround |
entity_angle_t CCmpPosition::m_RotX |
entity_angle_t CCmpPosition::m_RotY |
float CCmpPosition::m_RotYSpeed |
entity_angle_t CCmpPosition::m_RotZ |
player_id_t CCmpPosition::m_Territory |
entity_id_t CCmpPosition::m_TurretParent |
CFixedVector3D CCmpPosition::m_TurretPosition |
std::set<entity_id_t> CCmpPosition::m_Turrets |
entity_pos_t CCmpPosition::m_X |
entity_pos_t CCmpPosition::m_Y |
entity_pos_t CCmpPosition::m_Z |