Pyrogenesis
trunk
|
Basic ICmpPosition implementation. More...
Public Types | |
enum | { UPRIGHT = 0, PITCH = 1, PITCH_ROLL = 2, ROLL = 3 } |
Public Types inherited from IComponent | |
using | AllocFunc = IComponent *(*)(const ScriptInterface &scriptInterface, JS::HandleValue ctor) |
using | DeallocFunc = void(*)(IComponent *) |
Public Member Functions | |
int | GetComponentTypeId () const override |
void | Init (const CParamNode ¶mNode) override |
void | Deinit () override |
void | Serialize (ISerializer &serialize) override |
void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) override |
void | Deserialized () |
void | UpdateTurretPosition () override |
Has to be called to update the simulation position of the turret. More... | |
std::set< entity_id_t > * | GetTurrets () override |
Get the list of turrets to read or edit. More... | |
void | SetTurretParent (entity_id_t id, const CFixedVector3D &offset) override |
Set this as a turret of an other entity. More... | |
entity_id_t | GetTurretParent () const override |
Get the turret parent of this entity. More... | |
bool | IsInWorld () const override |
Returns true if the entity currently exists at a defined position in the world. More... | |
void | MoveOutOfWorld () override |
Causes IsInWorld to return false. More... | |
void | MoveTo (entity_pos_t x, entity_pos_t z) override |
Move smoothly to the given location. More... | |
void | MoveAndTurnTo (entity_pos_t x, entity_pos_t z, entity_angle_t ry) override |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange". More... | |
void | JumpTo (entity_pos_t x, entity_pos_t z) override |
Move immediately to the given location, with no interpolation. More... | |
void | SetHeightOffset (entity_pos_t dy) override |
Set the vertical offset above the terrain/water surface. More... | |
entity_pos_t | GetHeightOffset () const override |
Returns the current vertical offset above the terrain/water surface. More... | |
void | SetHeightFixed (entity_pos_t y) override |
Set the vertical position above the map zero point. More... | |
entity_pos_t | GetHeightFixed () const override |
Returns the current vertical offset above above the map zero point. More... | |
entity_pos_t | GetHeightAtFixed (entity_pos_t x, entity_pos_t z) const override |
Returns the vertical offset above above the map zero point the unit would have at the given position. More... | |
bool | IsHeightRelative () const override |
Returns true iff the entity will follow the terrain height (possibly with an offset) More... | |
void | SetHeightRelative (bool relative) override |
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... | |
bool | CanFloat () const override |
Returns whether the entity can float on water. More... | |
void | SetFloating (bool flag) override |
Set the entity to float on water. More... | |
void | SetActorFloating (bool flag) override |
Set the entity to float on water, in a non-network-synchronised visual-only way. More... | |
void | SetConstructionProgress (fixed progress) override |
Set construction progress of the model, this affects the rendered position of the model. More... | |
CFixedVector3D | GetPosition () const override |
Returns the current x,y,z position (no interpolation). More... | |
CFixedVector2D | GetPosition2D () const override |
Returns the current x,z position (no interpolation). More... | |
CFixedVector3D | GetPreviousPosition () const override |
Returns the previous turn's x,y,z position (no interpolation). More... | |
CFixedVector2D | GetPreviousPosition2D () const override |
Returns the previous turn's x,z position (no interpolation). More... | |
fixed | GetTurnRate () const override |
Returns the turn rate in radians per second. More... | |
void | TurnTo (entity_angle_t y) override |
Rotate smoothly to the given angle around the upwards axis. More... | |
void | SetYRotation (entity_angle_t y) override |
Rotate immediately to the given angle around the upwards axis. More... | |
void | SetXZRotation (entity_angle_t x, entity_angle_t z) override |
Rotate immediately to the given angles around the X (pitch) and Z (roll) axes. More... | |
CFixedVector3D | GetRotation () const override |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll. More... | |
fixed | GetDistanceTravelled () const override |
Returns the distance that the unit will be interpolated over, i.e. More... | |
float | GetConstructionProgressOffset (const CVector3D &pos) const |
void | GetInterpolatedPosition2D (float frameOffset, float &x, float &z, float &rotY) const override |
Get the current interpolated 2D position and orientation, for rendering. More... | |
CMatrix3D | GetInterpolatedTransform (float frameOffset) const override |
Get the current interpolated transform matrix, for rendering. More... | |
void | GetInterpolatedPositions (CVector3D &pos0, CVector3D &pos1) const |
void | HandleMessage (const CMessage &msg, bool global) override |
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 (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 |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (const ScriptInterface &, JS::HandleValue) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
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 () |
Public Attributes | |
enum CCmpPosition:: { ... } | m_AnchorType |
bool | m_Floating |
entity_pos_t | m_FloatDepth |
fixed | 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 |
|
inlineoverridevirtual |
Returns whether the entity can float on water.
Implements ICmpPosition.
|
inlinestatic |
|
inlinestatic |
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
Implements IComponent.
|
inline |
|
inlineoverridevirtual |
Implements IComponent.
|
inline |
|
inlineoverridevirtual |
Returns the distance that the unit will be interpolated over, i.e.
the distance travelled since the start of the turn.
Implements ICmpPosition.
|
inlineoverridevirtual |
Returns the vertical offset above above the map zero point the unit would have at the given position.
Implements ICmpPosition.
|
inlineoverridevirtual |
Returns the current vertical offset above above the map zero point.
Implements ICmpPosition.
|
inlineoverridevirtual |
Returns the current vertical offset above the terrain/water surface.
Implements ICmpPosition.
|
inlineoverridevirtual |
Get the current interpolated 2D position and orientation, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlineoverridevirtual |
Get the current interpolated transform matrix, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Returns the current x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Returns the previous turn's x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
|
inlineoverridevirtual |
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 |
|
inlineoverridevirtual |
Returns the turn rate in radians per second.
Implements ICmpPosition.
|
inlineoverridevirtual |
Get the turret parent of this entity.
Implements ICmpPosition.
|
inlineoverridevirtual |
Get the list of turrets to read or edit.
Implements ICmpPosition.
|
inlineoverridevirtual |
Reimplemented from IComponent.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
Returns true iff the entity will follow the terrain height (possibly with an offset)
Implements ICmpPosition.
|
inlineoverridevirtual |
Returns true if the entity currently exists at a defined position in the world.
Implements ICmpPosition.
|
inlineoverridevirtual |
Move immediately to the given location, with no interpolation.
Implements ICmpPosition.
|
inlineoverridevirtual |
Combines MoveTo and TurnTo to avoid an uncessary "AdvertisePositionChange".
Implements ICmpPosition.
|
inlineoverridevirtual |
Causes IsInWorld to return false.
(Use MoveTo() or JumpTo() to move back into the world.)
Implements ICmpPosition.
|
inlineoverridevirtual |
Move smoothly to the given location.
Implements ICmpPosition.
|
inlineoverridevirtual |
Implements IComponent.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Set the entity to float on water.
Implements ICmpPosition.
|
inlineoverridevirtual |
Set the vertical position above the map zero point.
Implements ICmpPosition.
|
inlineoverridevirtual |
Set the vertical offset above the terrain/water surface.
Implements ICmpPosition.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Set this as a turret of an other entity.
Implements ICmpPosition.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Rotate immediately to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
|
inlineoverridevirtual |
Rotate smoothly to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
|
inlineprivate |
|
inlineoverridevirtual |
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 |
entity_pos_t CCmpPosition::m_FloatDepth |
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 |
fixed 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 |