29 float x0,
float y0,
float z0,
float x1,
float y1,
float z1,
float headRatio,
30 float smallRadius,
float largeRadius,
float arrow_roll,
float arrow_pitch,
35 x0, y0, z0, x1, y1,
z1, headRatio, smallRadius, largeRadius,
36 arrow_roll, arrow_pitch, arrow_yaw));
43 #if MRPT_HAS_OPENGL_GLUT 45 GLUquadricObj* obj1 = gluNewQuadric();
46 GLUquadricObj* obj2 = gluNewQuadric();
51 float vx = m_x1 - m_x0;
52 float vy = m_y1 - m_y0;
53 float vz = m_z1 - m_z0;
54 if ((m_arrow_roll != -1.0f) || (m_arrow_pitch != -1.0f) ||
55 (m_arrow_yaw != -1.0f))
64 float cr = cos(m_arrow_roll);
65 float sr = sin(m_arrow_roll);
66 float cp = cos(m_arrow_pitch);
67 float sp = sin(m_arrow_pitch);
68 float cy = cos(m_arrow_yaw);
69 float sy = sin(m_arrow_yaw);
73 m(0, 1) = cr * sp * sy - sr * cy;
74 m(0, 2) = sr * sy + cr * sp * cy;
76 m(1, 1) = sr * sp * sy + cr * cy;
77 m(1, 2) = sr * sp * cy - cr * sy;
108 mat[3] = mat[7] = mat[11] = 0;
120 if (vx != 0 || vy != 0)
148 glScalef(1.0f, 1.0f, v_mod * (1.0f - m_headRatio));
149 gluCylinder(obj1, m_smallRadius, m_smallRadius, 1, 10, 1);
155 mat[12] = m_x0 + vx * v_mod * (1.0f - m_headRatio);
156 mat[13] = m_y0 + vy * v_mod * (1.0f - m_headRatio);
157 mat[14] = m_z0 + vz * v_mod * (1.0f - m_headRatio);
163 glScalef(1.0f, 1.0f, v_mod * m_headRatio);
165 gluCylinder(obj2, m_largeRadius, 0, 1, 10, 10);
169 gluDeleteQuadric(obj1);
170 gluDeleteQuadric(obj2);
185 writeToStreamRender(out);
186 out << m_x0 << m_y0 << m_z0;
187 out << m_x1 << m_y1 << m_z1;
188 out << m_headRatio << m_smallRadius << m_largeRadius;
189 out << m_arrow_roll << m_arrow_pitch << m_arrow_yaw;
203 readFromStreamRender(
in);
204 in >> m_x0 >> m_y0 >> m_z0;
205 in >> m_x1 >> m_y1 >> m_z1;
206 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
211 readFromStreamRender(
in);
212 in >> m_x0 >> m_y0 >> m_z0;
213 in >> m_x1 >> m_y1 >> m_z1;
214 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
215 in >> m_arrow_roll >> m_arrow_pitch >> m_arrow_yaw;
231 bb_max.
x = std::max(m_x0, m_x1);
232 bb_max.
y = std::max(m_y0, m_y1);
233 bb_max.
z = std::max(m_z0, m_z1);
236 m_pose.composePoint(bb_min, bb_min);
237 m_pose.composePoint(bb_max, bb_max);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void render_dl() const override
Render.
GLAPI void GLAPIENTRY glMultMatrixf(const GLfloat *m)
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
GLAPI void GLAPIENTRY glPopMatrix(void)
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
std::shared_ptr< CObject > Ptr
void crossProduct3D(const T &v0, const U &v1, V &vOut)
Computes the cross product of two 3D vectors, returning a vector normal to both.
T square(const T x)
Inline function for the square of a number.
A renderizable object suitable for rendering with OpenGL's display lists.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This base provides a set of functions for maths stuff.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
double x
X,Y,Z coordinates.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLAPI void GLAPIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
The namespace for 3D scene representation and rendering.
A matrix of dynamic size.
GLAPI void GLAPIENTRY glPushMatrix(void)
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
std::shared_ptr< CArrow > Ptr