Class WebSceneNode#
Defined in File WebSceneNode.h
Inheritance Relationships#
Base Type#
public Karana::Scene::GraphicalSceneNode(Class GraphicalSceneNode)
Derived Types#
public Karana::Scene::WebSceneCamera(Class WebSceneCamera)public Karana::Scene::WebScenePart(Class WebScenePart)
Class Documentation#
-
class WebSceneNode : public virtual Karana::Scene::GraphicalSceneNode#
GraphicalSceneNode implementation for WebScene.
See Scene layer for more discussion on the scene layer.
Subclassed by Karana::Scene::WebSceneCamera, Karana::Scene::WebScenePart
Public Functions
-
WebSceneNode(std::string_view name, const Karana::Core::ks_ptr<Karana::WebUI::Server> &server, const kc::ks_ptr<Scene> &scene)#
WebSceneNode constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.
- Parameters:
name – - Name of the WebSceneNode
server – - Server to communicate with frontends
scene – - WebScene to add the node to.
-
virtual void setUnitQuaternion(const Karana::Math::UnitQuaternion &quaternion) override#
Set rotation of the node relative to its parent.
- Parameters:
quaternion – - The relative rotation as a unit quaternion
-
virtual void setTranslation(const Karana::Math::Vec3 &translation) override#
Set position of the node relative to its parent.
- Parameters:
translation – - The relative translation
-
virtual void setScale(double scale) override#
Set uniform of the node relative to its parent.
- Parameters:
scale – - The relative uniform scale
-
virtual void setVisible(bool visible) override#
Set whether the object is visible.
- Parameters:
visible – - The visibility flag
-
virtual void attachTo(const Karana::Core::ks_ptr<SceneNode> &parent, bool maintain_world_transform = false) override#
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) override#
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
-
virtual void showAxes(float size = 1) override#
Show axes to visualize the node’s position and orientation.
- Parameters:
size – - Lengths of the axes (zero to remove the axes)
-
virtual void trail(const Karana::Core::ks_ptr<GraphicalSceneNode> &relative_to = nullptr, const Color &color = Color::WHITE) override#
Display a trail tracking the node’s motion over time.
- Parameters:
relative_to – - Another node to draw the trail relative to.
color – - The color of the Trail.
-
virtual void removeTrail() override#
Remove a trail previously created by calling trail.
Public Static Functions
-
static Karana::Core::ks_ptr<WebSceneNode> create(std::string_view name, const Karana::Core::ks_ptr<WebScene> &scene)#
Create a WebSceneNode.
- Parameters:
name – - Name of the node.
scene – - The WebScene to add the node to.
- Returns:
The created WebSceneNode.
Protected Functions
-
virtual void _ioHandleConn(Karana::WebUI::Connection &conn) const#
Handler for a new frontend connection.
- Parameters:
conn – - Connection to the new frontend
Protected Attributes
Friends
- friend class WebScene
-
WebSceneNode(std::string_view name, const Karana::Core::ks_ptr<Karana::WebUI::Server> &server, const kc::ks_ptr<Scene> &scene)#