Class ScenePart#
Defined in File ScenePart.h
Inheritance Relationships#
Base Type#
public Karana::Scene::SceneNode(Class SceneNode)
Derived Types#
public Karana::Scene::CollisionScenePart(Class CollisionScenePart)public Karana::Scene::GraphicalScenePart(Class GraphicalScenePart)public Karana::Scene::ProxyScenePart(Class ProxyScenePart)
Class Documentation#
-
class ScenePart : public virtual Karana::Scene::SceneNode#
Class for objects with geometry and material in the scene.
See Scene layer for more discussion on the scene layer.
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.
-
virtual const ScenePartVars &getVars() const override#
Get the vars member as a ScenePartVars.
- Returns:
The ScenePartVars for this ScenePart.
Public Static Functions
-
static Karana::Core::ks_ptr<ScenePart> create(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene, const VarStaticGeometry &geometry, const VarMaterial &material = defaultMaterial(), layer_t layers = LAYER_PHYSICAL)#
Create a ScenePart.
-
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
-
ScenePart(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene, const VarStaticGeometry &geometry, const VarMaterial &material, layer_t layers)#
Constructor for a ScenePart.
-
virtual ~ScenePart()#