Class SceneNode#
Defined in File SceneNode.h
Inheritance Relationships#
Base Type#
public Karana::Core::Base(Class Base)
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::Base#
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()#
-
const Karana::Math::Vec3 &getTranslation() const#
Get position of the node relative to its parent.
- Returns:
The relative translation
-
virtual void setTranslation(const Karana::Math::Vec3 &translation)#
Set position of the node relative to its parent.
- Parameters:
translation – - The relative translation
-
const Karana::Math::UnitQuaternion &getUnitQuaternion() const#
Get rotation of the node relative to its parent.
- Returns:
The relative rotation as a unit quaternion
-
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 &getTransform() const#
Get similarity transform of the node relative to its parent.
- Returns:
The similarity transform
-
const Karana::Math::SimTran &getWorldTransform() const#
Get similarity transform of the node relative to the scene’s root.
- Returns:
The similarity transform
-
const Karana::Math::Vec3 &getWorldTranslation() const#
Get translation of the node relative to the scene’s root.
- Returns:
The translation
-
const Karana::Math::UnitQuaternion &getWorldUnitQuaternion() const#
Get rotation of the node relative to the scene’s root.
- Returns:
The rotation as a unit quaternion
-
double getWorldScale() const#
Get uniform scale of the node relative to the scene’s root.
- Returns:
The uniform scale
-
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_transform = false)#
Attach to a parent node.
- Parameters:
parent – - The parent node
maintain_world_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_transform = false)#
Detach the node from its parent.
- Parameters:
maintain_world_transform – - If true, update the node’s relative transform so that its overall world transform doesn’t change after detaching
-
Karana::Core::RegistryList<SceneNode> children()#
Get the node’s children.
- Returns:
A list of the node’s children
-
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
-
static Karana::Core::ks_ptr<SceneNode> create(std::string_view name, const Karana::Core::ks_ptr<Scene> &scene)#
Create a scene node.
- Parameters:
name – - Name of the node.
scene – - The scene to add the node to.
- Returns:
Shared pointer to a scene node
-
static void discardNonRecursive(Karana::Core::ks_ptr<SceneNode> &node)#
Discard the given SceneNode non-recursively. Calling discard on a scene node will discard it and all of its children, which is the normal desired behavior. This specialized method will discard the node, but not its children.
- Parameters:
node – - The node to discard
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 ~SceneNode()#