Pyrogenesis
13997
|
Basic ICmpPosition implementation. More...
Public Types | |
enum | { UPRIGHT = 0, PITCH = 1, PITCH_ROLL = 2, ROLL =3 } |
Public Member Functions | |
virtual void | Init (const CParamNode ¶mNode) |
virtual void | Deinit () |
virtual void | Serialize (ISerializer &serialize) |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
virtual bool | IsInWorld () |
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 | 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 () |
Returns the current vertical offset above the terrain/water surface. More... | |
virtual void | SetHeightFixed (entity_pos_t y) |
Set the vertical position as a fixed, absolute value. More... | |
virtual bool | IsFloating () |
Returns whether the entity floats on water. More... | |
virtual CFixedVector3D | GetPosition () |
Returns the current x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPosition2D () |
Returns the current x,z position (no interpolation). More... | |
virtual CFixedVector3D | GetPreviousPosition () |
Returns the previous turn's x,y,z position (no interpolation). More... | |
virtual CFixedVector2D | GetPreviousPosition2D () |
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 () |
Returns the current rotation (relative to the upwards axis), as Euler angles with X=pitch, Y=yaw, Z=roll. More... | |
virtual fixed | GetDistanceTravelled () |
Returns the distance that the unit will be interpolated over, i.e. More... | |
virtual void | GetInterpolatedPosition2D (float frameOffset, float &x, float &z, float &rotY) |
Get the current interpolated 2D position and orientation, for rendering. More... | |
virtual CMatrix3D | GetInterpolatedTransform (float frameOffset, bool forceFloating) |
Get the current interpolated transform matrix, for rendering. More... | |
virtual void | HandleMessage (const CMessage &msg, bool global) |
![]() | |
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 JSClass * | GetJSClass () const |
virtual jsval | GetJSInstance () const |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, jsval) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
![]() | |
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_YOffset |
entity_pos_t | m_LastYOffset |
bool | m_RelativeToGround |
entity_angle_t | m_RotX |
entity_angle_t | m_RotY |
entity_angle_t | m_RotZ |
float | m_InterpolatedRotX |
float | m_InterpolatedRotY |
float | m_InterpolatedRotZ |
float | m_LastInterpolatedRotX |
float | m_LastInterpolatedRotZ |
bool | m_NeedInitialXZRotation |
Private Member Functions | |
void | AdvertisePositionChanges () |
void | UpdateXZRotation () |
Basic ICmpPosition implementation.
Definition at line 39 of file CCmpPosition.cpp.
anonymous enum |
Enumerator | |
---|---|
UPRIGHT | |
PITCH | |
PITCH_ROLL | |
ROLL |
Definition at line 57 of file CCmpPosition.cpp.
|
inlineprivate |
Definition at line 548 of file CCmpPosition.cpp.
|
inlinestatic |
Definition at line 53 of file CCmpPosition.cpp.
|
inlinestatic |
Definition at line 42 of file CCmpPosition.cpp.
|
inlinestatic |
Definition at line 53 of file CCmpPosition.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 141 of file CCmpPosition.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 188 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns the distance that the unit will be interpolated over, i.e.
the distance travelled since the start of the turn.
Implements ICmpPosition.
Definition at line 414 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns the current vertical offset above the terrain/water surface.
Implements ICmpPosition.
Definition at line 272 of file CCmpPosition.cpp.
|
inlinevirtual |
Get the current interpolated 2D position and orientation, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
Definition at line 425 of file CCmpPosition.cpp.
|
inlinevirtual |
Get the current interpolated transform matrix, for rendering.
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
Definition at line 439 of file CCmpPosition.cpp.
|
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.
Definition at line 296 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns the current x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
Definition at line 322 of file CCmpPosition.cpp.
|
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.
Definition at line 333 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns the previous turn's x,z position (no interpolation).
Must not be called unless IsInWorld is true.
Implements ICmpPosition.
Definition at line 359 of file CCmpPosition.cpp.
|
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.
Definition at line 409 of file CCmpPosition.cpp.
|
inlinestatic |
Definition at line 85 of file CCmpPosition.cpp.
|
inlinevirtual |
Reimplemented from IComponent.
Definition at line 482 of file CCmpPosition.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 114 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns whether the entity floats on water.
Implements ICmpPosition.
Definition at line 291 of file CCmpPosition.cpp.
|
inlinevirtual |
Returns true if the entity currently exists at a defined position in the world.
Implements ICmpPosition.
Definition at line 214 of file CCmpPosition.cpp.
|
inlinevirtual |
Move immediately to the given location, with no interpolation.
Implements ICmpPosition.
Definition at line 242 of file CCmpPosition.cpp.
|
inlinevirtual |
Causes IsInWorld to return false.
(Use MoveTo() or JumpTo() to move back into the world.)
Implements ICmpPosition.
Definition at line 219 of file CCmpPosition.cpp.
|
inlinevirtual |
Move smoothly to the given location.
Implements ICmpPosition.
Definition at line 226 of file CCmpPosition.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 145 of file CCmpPosition.cpp.
|
inlinevirtual |
Set the vertical position as a fixed, absolute value.
Will stay at this height until the next call to SetHeightFixed or SetHeightOffset.
Implements ICmpPosition.
Definition at line 277 of file CCmpPosition.cpp.
|
inlinevirtual |
Set the vertical offset above the terrain/water surface.
Implements ICmpPosition.
Definition at line 256 of file CCmpPosition.cpp.
|
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.
Definition at line 393 of file CCmpPosition.cpp.
|
inlinevirtual |
Rotate immediately to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
Definition at line 377 of file CCmpPosition.cpp.
|
inlinevirtual |
Rotate smoothly to the given angle around the upwards axis.
y | clockwise radians from the +Z axis. |
Implements ICmpPosition.
Definition at line 370 of file CCmpPosition.cpp.
|
inlineprivate |
Definition at line 562 of file CCmpPosition.cpp.
enum { ... } CCmpPosition::m_AnchorType |
bool CCmpPosition::m_Floating |
Definition at line 65 of file CCmpPosition.cpp.
float CCmpPosition::m_InterpolatedRotX |
Definition at line 80 of file CCmpPosition.cpp.
float CCmpPosition::m_InterpolatedRotY |
Definition at line 80 of file CCmpPosition.cpp.
float CCmpPosition::m_InterpolatedRotZ |
Definition at line 80 of file CCmpPosition.cpp.
bool CCmpPosition::m_InWorld |
Definition at line 70 of file CCmpPosition.cpp.
float CCmpPosition::m_LastInterpolatedRotX |
Definition at line 81 of file CCmpPosition.cpp.
float CCmpPosition::m_LastInterpolatedRotZ |
Definition at line 81 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_LastX |
Definition at line 73 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_LastYOffset |
Definition at line 74 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_LastZ |
Definition at line 73 of file CCmpPosition.cpp.
bool CCmpPosition::m_NeedInitialXZRotation |
Definition at line 83 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_PrevX |
Definition at line 73 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_PrevZ |
Definition at line 73 of file CCmpPosition.cpp.
bool CCmpPosition::m_RelativeToGround |
Definition at line 75 of file CCmpPosition.cpp.
entity_angle_t CCmpPosition::m_RotX |
Definition at line 77 of file CCmpPosition.cpp.
entity_angle_t CCmpPosition::m_RotY |
Definition at line 77 of file CCmpPosition.cpp.
float CCmpPosition::m_RotYSpeed |
Definition at line 66 of file CCmpPosition.cpp.
entity_angle_t CCmpPosition::m_RotZ |
Definition at line 77 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_X |
Definition at line 73 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_YOffset |
Definition at line 74 of file CCmpPosition.cpp.
entity_pos_t CCmpPosition::m_Z |
Definition at line 73 of file CCmpPosition.cpp.