Class ScenePart#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

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

Class for an object with geometry and material in the scene.

Subclassed by Karana::Scene::CollisionScenePart, Karana::Scene::GraphicalScenePart, Karana::Scene::ProxyScenePart

Public Functions

virtual ~ScenePart()#
const VarStaticGeometry &getGeometry() const#

Get the part’s geometry.

Returns:

The part’s geometry

const VarMaterial &getMaterial() const#

Get the part’s material.

Returns:

The part’s material

virtual void setMaterial(const VarMaterial &material)#

Set the part’s material.

Parameters:

material – - The part’s new material.

const layer_t &getLayers() const#

Get which layers the part belongs to.

Returns:

Bitmask for which layers the part belongs to.

virtual void setIntrinsicScale(const Karana::Math::Vec3 &scale)#

Set the part’s intrinsic scale.

The intrinsic scale can be non-uniform but does not apply to attached nodes.

Parameters:

scale – - The part’s intrinsic scale.

virtual const Karana::Math::Vec3 &getIntrinsicScale() const#

Get the part’s intrinsic scale.

The intrinsic scale can be non-uniform but does not apply to attached nodes.

Returns:

The part’s intrinsic scale.

Public Static Functions

static Karana::Core::ks_ptr<ScenePart> create(std::string_view name, const VarStaticGeometry &geometry, const Karana::Core::ks_ptr<Scene> &scene, const VarMaterial &material = defaultMaterial(), layer_t layers = LAYER_PHYSICAL)#

Create a ScenePart.

Parameters:
  • name – - Name of the ScenePart.

  • geometry – - Geometry of the ScenePart.

  • material – - Material for the ScenePart.

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

  • scene – - The Scene to add the ScenePart to.

Returns:

The new scene part.

Protected Functions

ScenePart(std::string_view name, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers, const Karana::Core::ks_ptr<Scene> &scene)#

Constructor for a ScenePart.

Parameters:
  • name – - Name of the ScenePart

  • geometry – - Geometry of the ScenePart.

  • material – - Material of the ScenePart.

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

  • scene – - The Scene to add the ScenePart to.

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

Discard the provided ScenePart.

Parameters:

base – - Base pointer to the ScenePart to discard.

Protected Attributes

Karana::Math::Vec3 _intrinsic_scale = {1.0, 1.0, 1.0}#

The part’s intrinsic scale.