47 #ifndef _MIRA_OGREUTILS_H_ 48 #define _MIRA_OGREUTILS_H_ 57 #include <OGRE/OgreString.h> 58 #include <OGRE/OgreVector3.h> 60 #include <OGRE/OgreSceneQuery.h> 76 namespace mira {
namespace OgreUtils {
80 template <
typename TPo
int>
83 static_assert(
sizeof(TPoint)==0,
"toOgreVector is not implemented for this type");
84 return Ogre::Vector3();
90 return Ogre::Vector3(p.x(), p.y(), 0);
96 return Ogre::Vector3(p.x(), p.y(), p.z());
102 return Ogre::Vector3(p.x(), p.y(), 0);
108 return Ogre::Vector3(p.x(), p.y(), 0);
114 return Ogre::Vector3(p.x(), p.y(), p.z());
120 return Ogre::Vector3(p.x(), p.y(), p.z());
126 return Ogre::Vector3(p.x(), p.y(), 0);
132 return Ogre::Vector3(p.x(), p.y(), 0);
138 return Ogre::Vector3(p.x(), p.y(), p.z());
144 return Ogre::Vector3(p.x(), p.y(), p.z());
147 template <
typename ColorType>
150 return Ogre::ColourValue();
154 inline Ogre::ColourValue toOgreColor<Color::RGB>(
const Color::RGB& c)
156 return Ogre::ColourValue(c.r, c.g, c.b, 1.0f);
160 inline Ogre::ColourValue toOgreColor<Color::RGBA>(
const Color::RGBA& c)
162 return Ogre::ColourValue(c.r, c.g, c.b, c.a);
168 const Ogre::String& resourceGroup);
189 const Eigen::Vector2f& t);
196 const Eigen::Vector3f& t);
216 Ogre::MovableObject*
object);
225 const Ogre::Ray& ray,
226 Ogre::RaySceneQueryResult& oResult,
227 uint32 queryMask=0xFFFFFFFF);
241 const Ogre::MovableObject*
object);
MIRA_GUI_WIDGETS_EXPORT void loadResource(const Path &path, const Ogre::String &resourceGroup)
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
boost::filesystem::path Path
Typedef of a Path (shorter version for boost::filesystem::path)
Definition: Path.h:69
Class for 2D, 3D and N-dimensional points.
MIRA_GUI_WIDGETS_EXPORT std::pair< bool, float > rayObjectCollision(const Ogre::Ray &ray, const Ogre::MovableObject *object)
Performs a ray/object collision check.
Ogre::Vector3 toOgreVector< Pose2 >(const Pose2 &p)
Definition: OgreUtils.h:100
Color in RGBA color space.
Definition: Color.h:159
Ogre::Vector3 toOgreVector< Pose3 >(const Pose3 &p)
Definition: OgreUtils.h:112
MIRA_GUI_WIDGETS_EXPORT void setPosition(Ogre::SceneNode *node, const Eigen::Vector2f &t)
Sets the position of the scene node according to the specified translation.
Ogre::ColourValue toOgreColor(const ColorType &c)
Definition: OgreUtils.h:148
Ogre::Vector3 toOgreVector(const TPoint &p)
Definition: OgreUtils.h:81
This file contains color classes for the Img class.
Definition: ImageObject.h:60
Functions for modifying file system paths.
Ogre::Vector3 toOgreVector< Point3f >(const Point3f &p)
Definition: OgreUtils.h:94
Non intrusive reflect for OGRE color class.
MIRA_GUI_WIDGETS_EXPORT void setOrientation(Ogre::SceneNode *node, const Eigen::Rotation2D< float > &r)
Sets the orientation of the scene node according to the specified rotation.
Ogre::Vector3 toOgreVector< PoseCov3 >(const PoseCov3 &p)
Definition: OgreUtils.h:118
Typedefs for different Pose datatypes that are internally RigidTransforms.
Ogre::Vector3 toOgreVector< PoseCov2 >(const PoseCov2 &p)
Definition: OgreUtils.h:106
The different color spaces.
Definition: Color.h:104
MIRA_GUI_WIDGETS_EXPORT bool hasAttachedObject(Ogre::SceneNode *node, Ogre::MovableObject *object)
Returns true if object is directly or indirectly attached to the given node.
MIRA_GUI_WIDGETS_EXPORT void rayQuery(Ogre::SceneNode *node, const Ogre::Ray &ray, Ogre::RaySceneQueryResult &oResult, uint32 queryMask=0xFFFFFFFF)
Performs ray intersection tests for ALL movable objects in the specified scene node and all of its ch...
Ogre::Vector3 toOgreVector< Point2f >(const Point2f &p)
Definition: OgreUtils.h:88
MIRA_GUI_WIDGETS_EXPORT void setTransform(Ogre::SceneNode *node, const RigidTransform2f &t)
Sets position and orientation of the scene node according to the specified transform.