![]() |
GA::kit v0.3
G&A's in-house C++ application framework
|
Node represents a basic "node" (or view) in the scenegraph. More...
#include <node.h>
Public Member Functions | |
| template<CLASS_INHERITS(NodeT, ga::Node) > | |
| std::shared_ptr< NodeT > | addChild (std::shared_ptr< NodeT > child=nullptr) |
| std::shared_ptr< Node > | addChild () |
| template<CLASS_INHERITS(NodeT, ga::Node) > | |
| std::shared_ptr< NodeT > | insertChild (size_t index, std::shared_ptr< NodeT > child=nullptr) |
| std::shared_ptr< Node > | insertChild (size_t index) |
| void | detach () |
| bool | removeChild (std::shared_ptr< Node > child) |
| bool | removeDescendant (std::shared_ptr< Node > node) |
| void | clearChildren () |
| void | sortChildren (std::function< bool(const std::shared_ptr< Node > &a, const std::shared_ptr< Node > &b)> comparisonFn) |
| bool | isParentOf (const std::shared_ptr< Node > &child) const |
| bool | isChildOf (const std::shared_ptr< Node > &parent) const |
| bool | hasChild (const std::shared_ptr< Node > &child) const |
| bool | hasDescendant (const std::shared_ptr< Node > &node) const |
| std::shared_ptr< Node > | getParent () const |
| const std::vector< std::shared_ptr< Node > > & | getChildren () const |
| bool | hasChildren () const |
| bool | hasParent () const |
| bool | isRoot () const |
| bool | hasScene () const |
| std::shared_ptr< Scene > | getScene () const |
| size_t | getSceneHierarchyLevel () const |
| size_t | getSceneDrawIndex () const |
| void | setName (const std::string &name) |
| const std::string & | getName () const |
| void | setUuid (const ga::Uuid &uuid) |
| const ga::Uuid & | getUuid () |
| ga::Transform & | getTransform () |
| void | setDrawFn (std::function< void()> drawFn) |
| void | resetDrawFn () |
| void | setUpdateFn (std::function< void()> updateFn) |
| void | resetUpdateFn () |
| ga::Transform | getSceneTransform () |
| vec3 | localPosToScene (const vec3 &pos) |
| vec3 | scenePosToLocal (const vec3 &pos) |
| void | disableUpdate () |
| void | enableUpdate () |
| bool | isUpdateEnabled () const |
| void | disableDraw () |
| void | enableDraw () |
| bool | isDrawEnabled () const |
| template<CLASS_INHERITS(ComponentT, Component) > | |
| std::shared_ptr< ComponentT > | createComponent () |
| template<CLASS_INHERITS(ComponentT, Component) > | |
| std::shared_ptr< ComponentT > | addComponent (std::shared_ptr< ComponentT > component) |
| template<CLASS_INHERITS(ComponentT, Component) > | |
| std::shared_ptr< ComponentT > | getComponent () |
| template<CLASS_INHERITS(ComponentT, Component) > | |
| bool | removeComponent () |
| template<CLASS_INHERITS(ComponentT, Component) > | |
| ComponentT & | component () |
| virtual | ~Node () |
Public Member Functions inherited from ga::Transform | |
| Transform () | |
| Transform (const mat4 &transform) | |
| Transform (const vec3 &translation, const quat &rotation, const vec3 &scale) | |
| Transform & | setMatrix (const mat4 &matrix) |
| Transform & | set (const mat4 &matrix) |
| Transform & | setTranslation (const vec3 &translation) |
| Transform & | setTranslation (const vec2 &translation) |
| Transform & | setRotation (const quat &rotation) |
| Transform & | setScale (const vec3 &scale) |
| Transform & | setEulerRotation (const vec3 &radians) |
| const vec3 & | getTranslation () const |
| const quat & | getRotation () const |
| const vec3 & | getScale () const |
| vec3 | getEulerRotation () const |
| const mat4 & | getMatrix () const |
| Transform & | translate (const vec3 &vec) |
| Transform & | translate (const vec2 &vec) |
| Transform & | translateX (float x) |
| Transform & | translateY (float y) |
| Transform & | translateZ (float z) |
| Transform & | scale (const vec3 &pct) |
| Transform & | scale (float pct) |
| Transform & | rotate (const vec3 &eulerRadians) |
| Transform & | rotateAround (const vec3 &axis, float radians) |
| Transform & | rotateX (float radians) |
| Transform & | rotateY (float radians) |
| Transform & | rotateZ (float radians) |
| operator const mat4 & () const | |
| Transform & | operator= (const mat4 &m) |
| Transform | operator* (const mat4 &m) |
| Transform | operator* (const Transform &t) |
Static Public Member Functions | |
| template<CLASS_INHERITS(NodeT, ga::Node) > | |
| static std::shared_ptr< NodeT > | create () |
| static std::shared_ptr< Node > | create () |
Protected Member Functions | |
| Node () | |
| virtual void | setup () |
| virtual void | update () |
| virtual void | draw () |
| virtual void | onDrawIndexChange () |
| void | setDrawIndex (size_t index) |
| void | setScene (std::shared_ptr< Scene > scene) |
| void | setParent (std::shared_ptr< Node > parent) |
| void | updateTree () |
| void | drawTree () |
| void | walkTree (std::function< void(std::shared_ptr< Node >)> fn) |
Protected Member Functions inherited from ga::Transform | |
| void | flagDirty () |
| void | clean () const |
| void | decompose () |
Protected Attributes | |
| std::weak_ptr< Scene > | m_scene |
| std::weak_ptr< Node > | m_parent |
| std::vector< std::shared_ptr< Node > > | m_children |
| std::unordered_map< std::type_index, std::shared_ptr< Component > > | m_components |
| std::string | m_name |
| ga::Uuid | m_uuid |
| size_t | m_drawIndex |
| std::function< void()> | m_updateFn |
| std::function< void()> | m_drawFn |
| bool | m_isDrawEnabled = true |
| bool | m_isUpdateEnabled = true |
Protected Attributes inherited from ga::Transform | |
| vec3 | m_translation |
| vec3 | m_scale |
| quat | m_rotation |
| mat4 | m_transform |
| bool | m_dirty |
Friends | |
| class | Scene |
Node represents a basic "node" (or view) in the scenegraph.
Nodes keep:
|
inlinevirtual |
|
protected |
| std::shared_ptr< Node > ga::Node::addChild | ( | ) |
| std::shared_ptr< NodeT > ga::Node::addChild | ( | std::shared_ptr< NodeT > | child = nullptr | ) |
| std::shared_ptr< ComponentT > ga::Node::addComponent | ( | std::shared_ptr< ComponentT > | component | ) |
| void ga::Node::clearChildren | ( | ) |
| ComponentT & ga::Node::component | ( | ) |
|
static |
|
inlinestatic |
| std::shared_ptr< ComponentT > ga::Node::createComponent | ( | ) |
| void ga::Node::detach | ( | ) |
| void ga::Node::disableDraw | ( | ) |
| void ga::Node::disableUpdate | ( | ) |
|
protectedvirtual |
|
protected |
| void ga::Node::enableDraw | ( | ) |
| void ga::Node::enableUpdate | ( | ) |
| const std::vector< std::shared_ptr< Node > > & ga::Node::getChildren | ( | ) | const |
| std::shared_ptr< ComponentT > ga::Node::getComponent | ( | ) |
|
inline |
| std::shared_ptr< Node > ga::Node::getParent | ( | ) | const |
| std::shared_ptr< Scene > ga::Node::getScene | ( | ) | const |
| size_t ga::Node::getSceneDrawIndex | ( | ) | const |
| size_t ga::Node::getSceneHierarchyLevel | ( | ) | const |
| ga::Transform ga::Node::getSceneTransform | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
| bool ga::Node::hasDescendant | ( | const std::shared_ptr< Node > & | node | ) | const |
|
inline |
|
inline |
| std::shared_ptr< Node > ga::Node::insertChild | ( | size_t | index | ) |
| std::shared_ptr< NodeT > ga::Node::insertChild | ( | size_t | index, |
| std::shared_ptr< NodeT > | child = nullptr |
||
| ) |
| bool ga::Node::isChildOf | ( | const std::shared_ptr< Node > & | parent | ) | const |
|
inline |
| bool ga::Node::isParentOf | ( | const std::shared_ptr< Node > & | child | ) | const |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
| bool ga::Node::removeChild | ( | std::shared_ptr< Node > | child | ) |
| bool ga::Node::removeComponent | ( | ) |
| bool ga::Node::removeDescendant | ( | std::shared_ptr< Node > | node | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
|
protected |
|
protected |
|
protectedvirtual |
|
inline |
|
inline |
| void ga::Node::sortChildren | ( | std::function< bool(const std::shared_ptr< Node > &a, const std::shared_ptr< Node > &b)> | comparisonFn | ) |
|
protectedvirtual |
|
protected |
|
protected |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| ga::Signal ga::Node::onDidDraw |
| ga::Signal ga::Node::onDidDrawChildren |
| ga::Signal ga::Node::onDidUpdate |
| ga::Signal ga::Node::onDidUpdateChildren |
| ga::Signal ga::Node::onWillDraw |
| ga::Signal ga::Node::onWillDrawChildren |
| ga::Signal ga::Node::onWillUpdate |
| ga::Signal ga::Node::onWillUpdateChildren |