|
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) |
|
virtual void | HandleMessage (const CMessage &msg, bool global) |
|
SUnit * | LookupUnit (tag_t tag) |
|
virtual tag_t | AddUnit (CEntityHandle entity, CUnit *actor, const CBoundingSphere &boundsApprox, int flags) |
|
virtual void | RemoveUnit (tag_t tag) |
|
void | RecomputeSweptBounds (SUnit *unit) |
|
virtual void | UpdateUnit (tag_t tag, CUnit *actor, const CBoundingSphere &boundsApprox) |
|
virtual void | UpdateUnitPos (tag_t tag, bool inWorld, const CVector3D &pos0, const CVector3D &pos1) |
|
void | TurnStart () |
|
void | Interpolate (float frameTime, float frameOffset) |
|
void | RenderSubmit (SceneCollector &collector, const CFrustum &frustum, bool culling) |
|
void | UpdateVisibility (SUnit &unit) const |
|
virtual float | GetFrameOffset () const |
| Returns the frame offset from the last Interpolate message. More...
|
|
virtual void | SetDebugOverlay (bool enabled) |
| Toggle the rendering of debug info. More...
|
|
virtual void | PickAllEntitiesAtPoint (std::vector< std::pair< CEntityHandle, CVector3D > > &outEntities, const CVector3D &origin, const CVector3D &dir, bool allowEditorSelectables) const |
| Return a list of visual entities along with their center point. More...
|
|
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 |
|
Efficiently(ish) renders all the units in the world.
The class maintains a list of all units that currently exist, and the data needed for frustum-culling them. To minimise the amount of work done per frame (despite a unit's interpolated position changing every frame), the culling data is only updated once per turn: we store the position at the start of the turn, and the position at the end of the turn, and assume the unit might be anywhere between those two points (linearly).
(Note this is a slightly invalid assumption: units don't always move linearly, since their interpolated position depends on terrain and water. But over a single turn it's probably going to be a good enough approximation, and will only break for units that both start and end the turn off-screen.)
We want to ignore rotation entirely, since it's a complex function of interpolated position and terrain. So we store a bounding sphere, which is rotation-independent, instead of a bounding box.