class SceneInstanceComponents

Maintains a list of all components associated with a SceneInstance, and their current state (running, inactive, uninitialized).

Public

Methods

SetComponentState

void SetComponentState(ComponentState state)

Changes the component state that globally determines which component callbacks are activated.

Only affects components that don't have the ComponentFlag::AlwaysRun flag set.

IsRunning

bool IsRunning() const

Checks are the components currently in the Running state.

Update

void Update()

Called every frame.

Calls update methods on all active components.

FixedUpdate

void FixedUpdate()

Called at fixed time internals.

Calls the fixed update method on all active components.

NotifyComponentCreated

void NotifyComponentCreated(const HComponent &component, bool parentActive)

Notifies the manager that a new component has just been created.

The manager triggers necessary callbacks.

NotifyComponentActivated

void NotifyComponentActivated(const HComponent &component, bool triggerEvent)

Notifies the manager that a scene object the component belongs to was activated.

The manager triggers necessary callbacks.

NotifyComponentDeactivated

void NotifyComponentDeactivated(const HComponent &component, bool triggerEvent)

Notifies the manager that a scene object the component belongs to was deactivated.

The manager triggers necessary callbacks.

NotifyComponentDestroyed

void NotifyComponentDestroyed(const HComponent &component, bool immediate)

Notifies the manager that a component is about to be destroyed.

The manager triggers necessary callbacks.

Protected

Methods

AddToStateList

void AddToStateList(const HComponent &component, u32 listType)

Adds a component to the specified state list.

Caller is expected to first remove the component from any existing state lists.

RemoveFromStateList

void RemoveFromStateList(const HComponent &component)

Removes a component from its current scene manager state list (if any).

ProcessStateChanges

void ProcessStateChanges()

Iterates over components that had their state modified and moves them to the appropriate state lists.

staticEncodeComponentId

static u32 EncodeComponentId(u32 idx, u32 type)

Encodes an index and a type into a single 32-bit integer.

Top 2 bits represent the type, while the rest represent the index.

staticDecodeComponentId

static void DecodeComponentId(u32 id, u32 &idx, u32 &type)

Decodes an id encoded with encodeComponentId().

staticIsComponentOfType

static bool IsComponentOfType(const HComponent &component, u32 rttiId)

Checks does the specified component type match the provided RTTI id.

Fields

mActiveComponents

Vector<HComponent> mActiveComponents

mInactiveComponents

Vector<HComponent> mInactiveComponents

mUninitializedComponents

Vector<HComponent> mUninitializedComponents

mComponentsPerState

std::array<Vector<HComponent> *, 3> mComponentsPerState

mComponentState

ComponentState mComponentState

mDisableStateChange

bool mDisableStateChange

mStateChanges

Vector<ComponentStateChange> mStateChanges