MathLib
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
SceneNode< Type > Class Template Reference

#include "math/SceneNode.hpp"

Inheritance diagram for SceneNode< Type >:
Inheritance graph

Public Member Functions

 SceneNode (Private)
 
 SceneNode (Private, std::weak_ptr< SceneNode > parent, const Math::BasicVector3D< Type > &translation, const Math::BasicQuaternion< Type > &rotation, std::string_view name)
 
 ~SceneNode ()=default
 
std::weak_ptr< SceneNode< Type > > parent () const
 
const SceneNodeList< Type > & children () const
 
const Math::BasicDualQuaternion< Type > & coordinate_system () const
 
Math::BasicDualQuaternion< Type > & coordinate_system ()
 
std::string_view name () const
 
std::weak_ptr< SceneNode< Type > > createChildNode (const Math::BasicVector3D< Type > &translation=Math::BasicVector3D< Type >::zero(), const Math::BasicQuaternion< Type > &rotation=Math::BasicQuaternion< Type >::identity(), std::string_view name=std::string_view())
 
void detachChild (std::shared_ptr< SceneNode< Type > > item_to_detach)
 
void attachChild (std::shared_ptr< SceneNode< Type > > node)
 
Math::BasicVector3D< Type > localToWorld (const Math::BasicVector3D< Type > &local_coordinate) const
 
Math::BasicDualQuaternion< Type > concatenatedTransforms () const
 

Static Public Member Functions

Creation Functions
static std::shared_ptr< SceneNode< Type > > make ()
 

Related Symbols

(Note that these are not member symbols.)

Type Aliases
template<class T >
using SceneNodeList = std::vector< std::shared_ptr< SceneNode< T > > >
 
using SceneNodef = SceneNode< float >
 
using SceneNoded = SceneNode< double >
 
using SceneNodeld = SceneNode< long double >
 

Detailed Description

template<class Type>
class SceneNode< Type >

Represents a transformation node in a hierarcy, or acyclic graph, structure

Template Parameters
TypeUse a basic type here for specializing the class for float, double, or long double. Defaults to float.
See also
SceneNodef SceneNoded SceneNodeld

Definition at line 40 of file SceneNode.hpp.

Constructor & Destructor Documentation

◆ SceneNode() [1/2]

template<class Type >
SceneNode ( Private  )
inline

Default constructor

Note
I only want some other class to be able to create these, which is why I am using this curious technique. However, it also needs to be public because of std::make_shared().

Definition at line 51 of file SceneNode.hpp.

◆ SceneNode() [2/2]

template<class Type >
SceneNode ( Private  ,
std::weak_ptr< SceneNode< Type > >  parent,
const Math::BasicVector3D< Type > &  translation,
const Math::BasicQuaternion< Type > &  rotation,
std::string_view  name 
)
inline

Construct with the given translation and rotation

Note
This is also meant to not be called by the user.
See also
createChildNode

Definition at line 59 of file SceneNode.hpp.

◆ ~SceneNode()

template<class Type >
~SceneNode ( )
default

Member Function Documentation

◆ attachChild()

template<class Type >
void attachChild ( std::shared_ptr< SceneNode< Type > >  node)
inline

Definition at line 117 of file SceneNode.hpp.

◆ children()

template<class Type >
const SceneNodeList< Type > & children ( ) const
inline

Definition at line 87 of file SceneNode.hpp.

◆ concatenatedTransforms()

template<class Type >
Math::BasicDualQuaternion< Type > concatenatedTransforms ( ) const
inline

Definition at line 149 of file SceneNode.hpp.

◆ coordinate_system() [1/2]

template<class Type >
Math::BasicDualQuaternion< Type > & coordinate_system ( )
inline

Definition at line 90 of file SceneNode.hpp.

◆ coordinate_system() [2/2]

template<class Type >
const Math::BasicDualQuaternion< Type > & coordinate_system ( ) const
inline

Definition at line 89 of file SceneNode.hpp.

◆ createChildNode()

template<class Type >
std::weak_ptr< SceneNode< Type > > createChildNode ( const Math::BasicVector3D< Type > &  translation = Math::BasicVector3D<Type>::zero(),
const Math::BasicQuaternion< Type > &  rotation = Math::BasicQuaternion<Type>::identity(),
std::string_view  name = std::string_view() 
)
inline

Definition at line 94 of file SceneNode.hpp.

◆ detachChild()

template<class Type >
void detachChild ( std::shared_ptr< SceneNode< Type > >  item_to_detach)
inline

Removes the given SceneNode from its list of children

Definition at line 105 of file SceneNode.hpp.

◆ localToWorld()

template<class Type >
Math::BasicVector3D< Type > localToWorld ( const Math::BasicVector3D< Type > &  local_coordinate) const
inline

Definition at line 125 of file SceneNode.hpp.

◆ make()

template<class Type >
static std::shared_ptr< SceneNode< Type > > make ( )
inlinestatic

Creates a default-constructed SceneNode

Returns
shared_ptr<SceneNode>

Definition at line 79 of file SceneNode.hpp.

◆ name()

template<class Type >
std::string_view name ( ) const
inline

Definition at line 92 of file SceneNode.hpp.

◆ parent()

template<class Type >
std::weak_ptr< SceneNode< Type > > parent ( ) const
inline

Definition at line 85 of file SceneNode.hpp.

Friends And Related Symbol Documentation

◆ SceneNoded

template<class Type >
using SceneNoded = SceneNode<double>
related

Definition at line 179 of file SceneNode.hpp.

◆ SceneNodef

template<class Type >
using SceneNodef = SceneNode<float>
related

Definition at line 178 of file SceneNode.hpp.

◆ SceneNodeld

template<class Type >
using SceneNodeld = SceneNode<long double>
related

Definition at line 180 of file SceneNode.hpp.

◆ SceneNodeList

template<class Type >
template<class T >
using SceneNodeList = std::vector< std::shared_ptr<SceneNode<T> > >
related

Definition at line 25 of file SceneNode.hpp.


The documentation for this class was generated from the following file: