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> 74 namespace mira {
namespace OgreUtils {
78 template <
typename TPo
int>
81 static_assert(
sizeof(TPoint)==0,
"toOgreVector is not implemented for this type");
82 return Ogre::Vector3();
88 return Ogre::Vector3(p.x(), p.y(), 0);
94 return Ogre::Vector3(p.x(), p.y(), p.z());
100 return Ogre::Vector3(p.x(), p.y(), 0);
106 return Ogre::Vector3(p.x(), p.y(), 0);
112 return Ogre::Vector3(p.x(), p.y(), p.z());
118 return Ogre::Vector3(p.x(), p.y(), p.z());
124 return Ogre::Vector3(p.x(), p.y(), 0);
130 return Ogre::Vector3(p.x(), p.y(), 0);
136 return Ogre::Vector3(p.x(), p.y(), p.z());
142 return Ogre::Vector3(p.x(), p.y(), p.z());
145 template <
typename ColorType>
148 return Ogre::ColourValue();
152 inline Ogre::ColourValue toOgreColor<Color::RGB>(
const Color::RGB& c)
154 return Ogre::ColourValue(c.r, c.g, c.b, 1.0f);
158 inline Ogre::ColourValue toOgreColor<Color::RGBA>(
const Color::RGBA& c)
160 return Ogre::ColourValue(c.r, c.g, c.b, c.a);
166 const Ogre::String& resourceGroup);
187 const Eigen::Vector2f& t);
194 const Eigen::Vector3f& t);
214 Ogre::MovableObject*
object);
222 void rayQuery(Ogre::SceneNode* node,
223 const Ogre::Ray& ray,
224 Ogre::RaySceneQueryResult& oResult,
225 uint32 queryMask=0xFFFFFFFF);
239 const Ogre::MovableObject*
object);
void setPosition(Ogre::SceneNode *node, const Eigen::Vector2f &t)
Sets the position of the scene node according to the specified translation.
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
void loadResource(const Path &path, const Ogre::String &resourceGroup)
Class for 2D, 3D and N-dimensional points.
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< Pose2 >(const Pose2 &p)
Definition: OgreUtils.h:98
Color in RGBA color space.
Definition: Color.h:159
Ogre::Vector3 toOgreVector< Pose3 >(const Pose3 &p)
Definition: OgreUtils.h:110
Ogre::ColourValue toOgreColor(const ColorType &c)
Definition: OgreUtils.h:146
Ogre::Vector3 toOgreVector(const TPoint &p)
Definition: OgreUtils.h:79
This file contains color classes for the Img class.
bool hasAttachedObject(Ogre::SceneNode *node, Ogre::MovableObject *object)
Returns true if object is directly or indirectly attached to the given node.
std::pair< bool, float > rayObjectCollision(const Ogre::Ray &ray, const Ogre::MovableObject *object)
Performs a ray/object collision check.
Definition: ImageObject.h:60
void setTransform(Ogre::SceneNode *node, const RigidTransform2f &t)
Sets position and orientation of the scene node according to the specified transform.
Functions for modifying file system paths.
Ogre::Vector3 toOgreVector< Point3f >(const Point3f &p)
Definition: OgreUtils.h:92
Non intrusive reflect for OGRE color class.
Ogre::Vector3 toOgreVector< PoseCov3 >(const PoseCov3 &p)
Definition: OgreUtils.h:116
Typedefs for different Pose datatypes that are internally RigidTransforms.
Ogre::Vector3 toOgreVector< PoseCov2 >(const PoseCov2 &p)
Definition: OgreUtils.h:104
The different color spaces.
Definition: Color.h:104
Ogre::Vector3 toOgreVector< Point2f >(const Point2f &p)
Definition: OgreUtils.h:86
void setOrientation(Ogre::SceneNode *node, const Eigen::Rotation2D< float > &r)
Sets the orientation of the scene node according to the specified rotation.