Class SceneNode#
Defined in File SceneNode.h
Inheritance Relationships#
Base Type#
public Karana::Core::BaseWithVars(Class BaseWithVars)
Derived Types#
public Karana::Scene::CollisionSceneNode(Class CollisionSceneNode)public Karana::Scene::GraphicalSceneNode(Class GraphicalSceneNode)public Karana::Scene::ProxySceneNode(Class ProxySceneNode)public Karana::Scene::ScenePart(Class ScenePart)
Class Documentation#
-
class SceneNode : public Karana::Core::BaseWithVars#
Base for objects with a transform i n the scene hierarchy.
See Scene layer for more discussion on the scene layer.
Subclassed by Karana::Scene::CollisionSceneNode, Karana::Scene::GraphicalSceneNode, Karana::Scene::ProxySceneNode, Karana::Scene::ScenePart
Public Functions
-
virtual ~SceneNode()#
Destructor.
-
inline virtual bool isScenePart() const#
Return true if this scene node is a scene part.
- Returns:
true if the node is a scene part
-
virtual void setTranslation(const Karana::Math::Vec3 &translation)#
Set position of the node relative to its parent.
- Parameters:
translation – - The relative translation
-
virtual void setUnitQuaternion(const Karana::Math::UnitQuaternion &quaternion)#
Set rotation of the node relative to its parent.
- Parameters:
quaternion – - The relative rotation as a unit quaternion
-
double getScale() const#
Get uniform scale of the node relative to its parent.
- Returns:
The relative uniform scale
-
virtual void setScale(double scale)#
Set uniform of the node relative to its parent.
- Parameters:
scale – - The relative uniform scale
-
const Karana::Math::SimTran &getSimTransform() const#
Get similarity transform of the node relative to its parent.
- Returns:
The similarity transform
-
virtual void setSimTransform(const Karana::Math::SimTran &transform)#
Set similarity transform of the node relative to its parent.
- Parameters:
transform – - The similarity transform
-
const Karana::Math::SimTran &getWorldSimTransform() const#
Get similarity transform of the node relative to the scene’s root.
- Returns:
The similarity transform
-
const Karana::Core::ks_ptr<SceneNode> &parent() const#
Get the parent node.
- Returns:
The parent node or nullptr
-
virtual void attachTo(const Karana::Core::ks_ptr<SceneNode> &parent, bool maintain_world_sim_transform = false)#
Attach to a parent node.
- Parameters:
parent – - The parent node
maintain_world_sim_transform – - If true, update the node’s relative transform so that its overall world transform doesn’t change after attaching it to the parent
-
virtual void detach(bool maintain_world_sim_transform = false)#
Detach the node from its parent.
- Parameters:
maintain_world_sim_transform – - If true, update the node’s relative transform so that its overall world transform doesn’t change after detaching
-
const std::vector<kc::ks_ptr<SceneNode>> &childrenNodes() const#
Get the node’s children nodes.
- Returns:
A list of the node’s children nodes
-
Karana::Core::RegistryList<SceneNode> children() const#
Get the node’s children registry.
- Returns:
A list of the node’s children registry
-
virtual void setVisible(bool visible)#
Set whether the object is visible.
- Parameters:
visible – - The visibility flag
-
bool getVisible() const#
Get whether the object is visible.
- Returns:
The visibility flag
Public Static Functions
Protected Functions
-
SceneNode(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene)#
SceneNode Constructor.
- Parameters:
name – - Name of the node.
scene – - The scene to add the node to.
-
virtual Karana::Core::ks_ptr<Karana::Core::BaseVars> _getVars() const override#
Create the vars for this object.
- Returns:
The vars for this object.
-
virtual ~SceneNode()#