Pyrogenesis
13997
|
Fairly basic decay implementation, for units and buildings etc. More...
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 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 | |
bool | m_Active |
bool | m_ShipSink |
float | m_DelayTime |
float | m_SinkRate |
float | m_SinkAccel |
entity_pos_t | m_InitialXRotation |
entity_pos_t | m_InitialZRotation |
float | m_SinkingAngleX |
float | m_SinkingAngleZ |
float | m_CurrentTime |
float | m_TotalSinkDepth |
Fairly basic decay implementation, for units and buildings etc.
The decaying entity remains stationary for some time period, then falls downwards with some initial speed and some acceleration, until it has fully sunk. The sinking depth is determined from the actor's bounding box and the terrain.
This currently doesn't work with entities whose ICmpPosition has an initial Y offset.
This isn't very efficient (we'll store data and iterate every frame for every entity, not just for corpse entities) - it could be designed more optimally if that's a real problem.
Eventually we might want to adjust the decay rate based on user configuration (low-spec machines could have fewer corpses), number of corpses, etc.
Must not be used on network-synchronised entities, unless <Inactive> is present.
Definition at line 45 of file CCmpDecay.cpp.
|
inlinestatic |
Definition at line 53 of file CCmpDecay.cpp.
|
inlinestatic |
Definition at line 48 of file CCmpDecay.cpp.
|
inlinestatic |
Definition at line 53 of file CCmpDecay.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 114 of file CCmpDecay.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 123 of file CCmpDecay.cpp.
|
inlinestatic |
Definition at line 71 of file CCmpDecay.cpp.
|
inlinevirtual |
Reimplemented from IComponent.
Definition at line 128 of file CCmpDecay.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 95 of file CCmpDecay.cpp.
|
inlinevirtual |
Implements IComponent.
Definition at line 118 of file CCmpDecay.cpp.
bool CCmpDecay::m_Active |
Definition at line 55 of file CCmpDecay.cpp.
float CCmpDecay::m_CurrentTime |
Definition at line 68 of file CCmpDecay.cpp.
float CCmpDecay::m_DelayTime |
Definition at line 57 of file CCmpDecay.cpp.
entity_pos_t CCmpDecay::m_InitialXRotation |
Definition at line 61 of file CCmpDecay.cpp.
entity_pos_t CCmpDecay::m_InitialZRotation |
Definition at line 62 of file CCmpDecay.cpp.
bool CCmpDecay::m_ShipSink |
Definition at line 56 of file CCmpDecay.cpp.
float CCmpDecay::m_SinkAccel |
Definition at line 59 of file CCmpDecay.cpp.
float CCmpDecay::m_SinkingAngleX |
Definition at line 65 of file CCmpDecay.cpp.
float CCmpDecay::m_SinkingAngleZ |
Definition at line 66 of file CCmpDecay.cpp.
float CCmpDecay::m_SinkRate |
Definition at line 58 of file CCmpDecay.cpp.
float CCmpDecay::m_TotalSinkDepth |
Definition at line 69 of file CCmpDecay.cpp.