Class Scene¶
-
class Scene¶
Public Functions
-
~Scene()¶
-
void update(float deltaTime)¶
-
void draw(float deltaTime)¶
-
inline uint16_t getId() const¶
-
inline Coll::CollisionScene &getCollision()¶
- inline void sendEvent(
- uint16_t targetId,
- uint16_t senderId,
- uint16_t type,
- uint32_t value
-
template<typename T>
inline T *getRenderPipeline()¶ Returns current (typed) rendering pipeline.
If the expected type is not the correct one, returns nullptr. This function can be used to safely access pipeline-specific features.
- Template Parameters:
T – Type of the expected rendering pipeline
- Returns:
Pointer to the rendering pipeline of type T, or nullptr if the type does not match
- uint16_t addObject(
- uint32_t prefabIdx,
- const fm_vec3_t &pos = {0, 0, 0},
- const fm_vec3_t &scale = {1, 1, 1},
- const fm_quat_t &rot = {0, 0, 0, 1}
Spawns an object from a prefab into the scene.
Note that this will not happen immediately, but at the start of the next frame. The returned value is the ID of the new object, which becomes valid when it spawns.
- Parameters:
prefabIdx – Index of the prefab asset, use _asset suffix
pos – initial pos (default origin)
scale – initial scale (default 1)
rot – initial rotation (none)
- Returns:
ID of the new object
-
inline uint32_t getObjectCount() const¶
-
template<typename F>
inline void iterObjectChildren(uint16_t parentId, F &&f) const¶ Iterates over all direct children of the given parent object ID.
If you need nested iteration, call this function recursively.
Note: This function is intentionally a template with a callback. Doing so generates the same ASM as a direct loops with an if+continue, whereas iterators or std::view performs worse.
- Template Parameters:
F –
- Parameters:
parentId – object id of the parent
f – callback function, takes Object* as argument
-
void endLightingOverride()¶
-
~Scene()¶