31 : _name(
name), _tags(this), _localScale(1, 1, 1),
32 _localTransform(
Matrix4::identity()), _worldTransform(
Matrix4::identity()) {}
35 const std::string&
name()
const {
return _name; }
79 const std::vector<GraphNode*>&
children()
const {
return _children; }
84 std::vector<GraphNode*>
find(
const std::function<
bool(
GraphNode*)>& predicate);
97 bool enabled()
const {
return _enabled && _enabledInHierarchy; }
130 void unfreezeParentToRoot();
132 void dirtifyWorldInternal();
136 void fireOnHierarchy(
const std::string&
name,
const std::string& nameHierarchy,
GraphNode*
parent);
138 void prepareInsertChild(
GraphNode* node);
142 void updateGraphDepth();
161 int _worldScaleSign = 0;
164 std::vector<GraphNode*> _children;
167 bool _dirtyLocal =
false;
168 bool _dirtyWorld =
false;
169 bool _dirtyNormal =
true;
170 bool _frozen =
false;
172 bool _scaleCompensation =
false;
174 bool _enabled =
true;
175 bool _enabledInHierarchy =
false;
Hierarchical scene graph node with local/world transforms and parent-child relationships.
GraphNode * findByName(const std::string &name)
bool isDescendantOf(const GraphNode *node) const
void setPosition(float x, float y, float z)
GraphNode(const std::string &name="Untitled")
const Vector3 & localScale() const
void notifyHierarchyStateChanged(GraphNode *node, bool enabled)
void setLocalEulerAngles(float x, float y, float z)
bool enabledLocal() const
void setLocalPosition(float x, float y, float z)
void addChild(GraphNode *node)
const Quaternion & localRotation() const
void setEnabledInHierarchy(bool value)
const Vector3 & localPosition() const
void setName(const std::string &name)
virtual void onHierarchyStateChanged(bool enabled)
std::vector< GraphNode * > find(const std::function< bool(GraphNode *)> &predicate)
Find all descendants (and self) matching a predicate.
void translateLocal(float x, float y, float z)
void setRotation(const Quaternion &rotation)
const std::vector< GraphNode * > & children() const
GraphNode * parent() const
void removeChild(GraphNode *child)
const Matrix4 & worldTransform()
const std::string & name() const
void setEnabled(bool value)
void setLocalRotation(const Quaternion &rotation)
void rotateLocal(float x, float y, float z)
void setLocalScale(float x, float y, float z)
4x4 column-major transformation matrix with SIMD acceleration.
Unit quaternion for rotation representation with SIMD-accelerated slerp and multiply.
3D vector for positions, directions, and normals with multi-backend SIMD acceleration.