Class Scene#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class Scene : public Karana::Core::Base#

Base container for a hierarchy of geometries.

See Scene layer for more discussion on the scene layer.

Subclassed by Karana::Scene::CollisionScene, Karana::Scene::GraphicalScene, Karana::Scene::ProxyScene

Public Functions

virtual ~Scene()#
Karana::Core::ks_ptr<Scene> getManager() const#

Get the Scene managing this one.

Returns:

The managing scene or nullptr

void setManager(const Karana::Core::ks_ptr<Scene> &manager)#

Assign a managing scene.

Parameters:

manager – The scene managing this one (nullable)

Protected Functions

Scene(std::string_view name)#

Scene constructor.

Parameters:

name – - Name of the Scene.

virtual void _discard(Karana::Core::ks_ptr<Karana::Core::Base> &s) override = 0#

Discard the scene. Derived scenes need to implement this with the logic required to discard their scene.

Parameters:

s – - A pointer to the scene to discard.

virtual Karana::Core::ks_ptr<SceneNode> _createNodeBase(std::string_view name) = 0#

Helper to create a SceneNode.

Derived scenes should implement by calling their non-virtual createNode. This is to support derived return types.

Parameters:

name – - Name for the SceneNode.

Returns:

The created SceneNode.

virtual void _discardNodeBase(Karana::Core::ks_ptr<SceneNode> &node, bool recursive = true) = 0#

Dicard the provided node. Derived scenes should implement downcasting and calling their non-virtual discardNode.

Parameters:
  • node – - The node to discard.

  • recursive – - If true, then also discard all the children recursively. If false, then children are moved up the tree with the same pose.

virtual Karana::Core::ks_ptr<ScenePart> _createPartBase(std::string_view name, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers) = 0#

Helper to create a ScenePart.

Derived scenes should implement by calling their non-virtual createPart. This is to support derived return types.

Parameters:
Returns:

The created ScenePart.

virtual void _discardPartBase(Karana::Core::ks_ptr<ScenePart> &part) = 0#

Helper to discard a ScenePart.

Derived scenes should implement downcasting and calling their non-virtual discardPart.

Parameters:

part – - The ScenePart to discard.

void _track(const Karana::Core::ks_ptr<SceneNode> &node)#

Track the usage of a SceneNode.

Parameters:

node – - The SceneNode to track.

void _untrack(Karana::Core::ks_ptr<SceneNode> &node)#

Stop tracking the usage of a SceneNode.

Parameters:

node – - The SceneNode to stop tracking.

Protected Attributes

std::weak_ptr<Scene> _manager#

The scene managing this one (if any)