Class SceneFileObject#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class SceneFileObject : public virtual Karana::Scene::SceneNode#

Class for an opaque node with contents loaded from a file.

See Scene layer for more discussion on the scene layer.

Subclassed by Karana::Scene::CoalSceneFileObject, Karana::Scene::ProxySceneFileObject, Karana::Scene::WebSceneFileObject

Public Functions

virtual ~SceneFileObject()#

Destructor.

SceneFileObject(const SceneFileObject&) = delete#
SceneFileObject &operator=(const SceneFileObject&) = delete#
const std::filesystem::path &getFilepath() const#

Get the file node’s filepath.

Returns:

The file node’s filepath

inline virtual bool isSceneFileObject() const override#

Return true if this scene node is a scene file node.

Returns:

true if the node is a scene file node

const layer_t &getLayers() const#

Get which layers the part belongs to.

Returns:

Bitmask for which layers the part belongs to.

Public Static Functions

static Karana::Core::ks_ptr<SceneFileObject> create(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene, const std::filesystem::path &filepath, layer_t layers = LAYER_PHYSICAL)#

Create a SceneFileObject.

Parameters:
  • name – Name of the SceneFileObject.

  • scene – The Scene to add the SceneFileObject to.

  • filepath – The filepath to load

  • layers – Bitmask for which layers the part belongs to.

Returns:

The new scene part.

static std::string getLayersString(layer_t layer)#

Convert the layer value into a more readable string form.

The conversion only uses the pre-defined and known layer values (eg. COLLISION etc)

Parameters:

layer – the layer value

Returns:

A string representation of the bitmask for which layers the part belongs to.

Protected Functions

SceneFileObject(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene, const std::filesystem::path &filepath, layer_t layers)#

Constructor for a SceneFileObject.

Parameters:
  • name – Name of the SceneFileObject

  • scene – The Scene to add the SceneFileObject to.

  • filepath – The filepath to load

  • layers – Bitmask for which layers the part belongs to.

virtual Karana::Core::ks_ptr<Karana::Core::BaseVars> _getVars() const override#

Create the vars for this object.

Returns:

The vars for this object.

void _discard(kc::ks_ptr<Base> &base) override#

Discard the provided SceneFileObject.

Parameters:

base – - Base pointer to the SceneFileObject to discard.

void _defaultPopulate()#

Populate the SceneFileObject via AssimpImporter.