12 #ifndef SPATIAL_H_6014714286
13 #define SPATIAL_H_6014714286
15 #include <Carna/Carna.h>
51 const void* myUserData;
57 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
64 explicit Spatial(
const std::string& tag =
"" );
84 bool hasParent()
const;
98 Spatial* detachFromParent();
104 void updateParent(
Node& parent );
114 const Node& parent()
const;
124 const Node& findRoot()
const;
140 virtual void updateWorldTransform();
154 template<
typename UserDataType >
155 void setUserData(
const UserDataType& userData );
166 void removeUserData();
172 bool hasUserData()
const;
181 template<
typename UserDataType >
182 const UserDataType& userData()
const;
191 void setMovable(
bool movable );
200 bool isMovable()
const;
207 virtual void invalidate();
212 void setTag(
const std::string& tag );
217 const std::string& tag()
const;
222 template<
typename UserDataType >
230 template<
typename UserDataType >
234 return *
static_cast< const UserDataType*
>( myUserData );
243 #endif // SPATIAL_H_6014714286
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
std::function< void(Spatial &) > MutableVisitor
Declares an entity that visits mutable Spatial instances.
std::function< void(const Spatial &) > ImmutableVisitor
Declares an entity that visits mutable Spatial instances.
Defines the inner node of a scene graph. Implements a spatial scene element that is allowed to have c...
Represents a spatial scene element. It's location is determined relatively to another spatial that is...
bool hasUserData() const
Tells whether an object has been linked with this Spatial instance through setUserData previously...
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
void setUserData(const UserDataType &userData)
Links an arbitrary object with this Spatial instance.
const UserDataType & userData() const
Retrieves the object previously linked with this Spatial instance.
#define CARNA_ASSERT(expression)
If the given expression is false, a break point is raised in debug mode and an AssertionFailure throw...
#define NON_COPYABLE
Features class it is placed in as non-copyable.
math::Matrix4f localTransform
Defines the location, rotation and scale of this spatial in relation to it's parent. If this spatial has no parent, the value has no meaning.