30 #include <OgrePlane.h> 32 #include <OgreSceneNode.h> 33 #include <OgreViewport.h> 63 setStatus(
"Click and drag mouse to set position/orientation.");
80 Ogre::Vector3 intersection;
81 Ogre::Plane ground_plane(Ogre::Vector3::UNIT_Z, 0.0
f);
91 else if (event.
type == QEvent::MouseMove && event.
left())
96 Ogre::Vector3 cur_pos;
97 Ogre::Plane ground_plane(Ogre::Vector3::UNIT_Z, 0.0
f);
106 Ogre::Quaternion orient_x =
107 Ogre::Quaternion(Ogre::Radian(-Ogre::Math::HALF_PI), Ogre::Vector3::UNIT_Y);
109 arrow_->
setOrientation(Ogre::Quaternion(Ogre::Radian(angle), Ogre::Vector3::UNIT_Z) * orient_x);
120 Ogre::Vector3 cur_pos;
121 Ogre::Plane ground_plane(Ogre::Vector3::UNIT_Z, 0.0
f);
Ogre::Viewport * viewport
void setPosition(const Ogre::Vector3 &position) override
Set the position of the base of the arrow.
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
Ogre::SceneNode * getSceneNode()
Get the scene node associated with this arrow.
bool getPointOnPlaneFromWindowXY(Ogre::Viewport *viewport, Ogre::Plane &plane, int window_x, int window_y, Ogre::Vector3 &intersection_out)
Given a viewport and an x,y position in window-pixel coordinates, find the point on a plane directly ...
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
An arrow consisting of a cylinder and a cone.
void setOrientation(const Ogre::Quaternion &orientation) override
Set the orientation.
void setColor(float r, float g, float b, float a) override
Set the color of this arrow. Sets both the head and shaft color to the same value. Values are in the range [0, 1].