3 #ifndef SCENEVIEW_SCENE_NODE_HPP__
4 #define SCENEVIEW_SCENE_NODE_HPP__
10 #include <sceneview/axis_aligned_box.hpp>
57 const QString
Name()
const {
return node_name_; }
67 const QQuaternion&
Rotation()
const {
return rotation_; }
72 const QVector3D&
Scale()
const {
return scale_; }
107 virtual void SetScale(
const QVector3D& vec);
181 const QString node_name_;
183 QVector3D translation_;
184 QQuaternion rotation_;
185 QVector3D scale_{1, 1, 1};
187 QMatrix4x4 to_world_;
188 bool to_world_dirty_ =
true;
190 GroupNode* parent_node_ =
nullptr;
192 bool visible_ =
true;
193 int64_t selection_mask_ = 0;
198 #endif // SCENEVIEW_SCENE_NODE_HPP__
virtual void SetScale(const QVector3D &vec)
Sets the scale component of the node to parent transform.
const QQuaternion & Rotation() const
Retrieve the rotation component of the node to parent transform.
Definition: scene_node.hpp:67
A scene graph node that can have children.
Definition: group_node.hpp:26
bool Visible() const
Check if the node is visible or not.
Definition: scene_node.hpp:85
virtual void SetTranslation(const QVector3D &vec)
Sets the translation component of the node transform.
Pure virtual class that all scene graph nodes inherit.
Definition: scene_node.hpp:41
void SetTranslation(double x, double y, double z)
Sets the translation component of the node transform.
Definition: scene_node.hpp:95
An axis-aligned box typically used for bounding box and intersection calculations.
Definition: axis_aligned_box.hpp:17
void SetSelectionMask(int64_t mask)
Sets the selection mask for this node.
Definition: scene_node.hpp:142
virtual const AxisAlignedBox & WorldBoundingBox()=0
Retrieve the world-space bounding box of the node and all of its children (if applicable).
virtual void TransformChanged()
Internal method, used to enable lazy matrix computations.
virtual void SetRotation(const QQuaternion &quat)
Sets the rotation component of the node to parent transform.
void SetParentNode(GroupNode *parent)
Sets the node's parent.
virtual void SetVisible(bool visible)
Sets the node visibility.
virtual SceneNodeType NodeType() const =0
Retrieve the node type.
SceneNodeType
Specifies a scene node type.
Definition: scene_node.hpp:19
void SetScale(double x, double y, double z)
Sets the scale component of the node to parent transform.
Definition: scene_node.hpp:112
const QVector3D & Scale() const
Retrieve the scale component of the node to parent transform.
Definition: scene_node.hpp:72
const QVector3D & Translation() const
Retrieve the translation component of the node to parent transform.
Definition: scene_node.hpp:62
int64_t GetSelectionMask() const
Retrieve the selection mask for this node.
Definition: scene_node.hpp:147
const QMatrix4x4 & WorldTransform()
Retrieve the transform from node coordinates to world coordinates.
const QString Name() const
Retrieve the node name.
Definition: scene_node.hpp:57
virtual void BoundingBoxChanged()
Internal method, used to enable lazy bounding box computations.
GroupNode * ParentNode()
Retrieve the parent of this node.
Definition: scene_node.hpp:127