46 return CArrowPtr(
new CArrow(x0,y0,z0, x1,y1,z1, headRatio, smallRadius, largeRadius, arrow_roll, arrow_pitch, arrow_yaw ));
53 #if MRPT_HAS_OPENGL_GLUT 55 GLUquadricObj *obj1 = gluNewQuadric();
56 GLUquadricObj *obj2 = gluNewQuadric();
64 if ((m_arrow_roll!=-1.0f)||(m_arrow_pitch!=-1.0f)||(m_arrow_yaw!=-1.0f))
73 float cr = cos(m_arrow_roll);
74 float sr = sin(m_arrow_roll);
75 float cp = cos(m_arrow_pitch);
76 float sp = sin(m_arrow_pitch);
77 float cy = cos(m_arrow_yaw);
78 float sy = sin(m_arrow_yaw);
81 m(0,0) = cr*cp; m(0,1) = cr*sp*sy - sr*cy; m(0,2) = sr*sy + cr*sp*cy;
82 m(1,0) = sr*cp; m(1,1) = sr*sp*sy + cr*cy; m(1,2) = sr*sp*cy - cr*sy;
83 m(2,0) = -sp; m(2,1) = cp*sy; m(2,2) = cp*cy;
111 mat[3] = mat[7] = mat[11] = 0;
113 mat[12] = m_x0; mat[13] = m_y0; mat[14] = m_z0;
149 glScalef(1.0f,1.0f,v_mod*(1.0f-m_headRatio));
150 gluCylinder( obj1, m_smallRadius, m_smallRadius, 1, 10, 1 );
156 mat[12] = m_x0 + vx*v_mod*(1.0f-m_headRatio);
157 mat[13] = m_y0 + vy*v_mod*(1.0f-m_headRatio);
158 mat[14] = m_z0 + vz*v_mod*(1.0f-m_headRatio);
164 glScalef(1.0f,1.0f,v_mod*m_headRatio);
166 gluCylinder( obj2, m_largeRadius, 0, 1, 10, 10 );
170 gluDeleteQuadric(obj1);
171 gluDeleteQuadric(obj2);
186 writeToStreamRender(out);
187 out << m_x0 << m_y0 << m_z0;
188 out << m_x1 << m_y1 << m_z1;
189 out << m_headRatio << m_smallRadius << m_largeRadius;
190 out << m_arrow_roll << m_arrow_pitch << m_arrow_yaw;
205 readFromStreamRender(
in);
206 in >> m_x0 >> m_y0 >> m_z0;
207 in >> m_x1 >> m_y1 >> m_z1;
208 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
213 readFromStreamRender(
in);
214 in >> m_x0 >> m_y0 >> m_z0;
215 in >> m_x1 >> m_y1 >> m_z1;
216 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
217 in >> m_arrow_roll >> m_arrow_pitch >> m_arrow_yaw;
234 bb_max.
x = std::max( m_x0, m_x1 );
235 bb_max.
y = std::max( m_y0, m_y1 );
236 bb_max.
z = std::max( m_z0, m_z1 );
239 m_pose.composePoint(bb_min, bb_min);
240 m_pose.composePoint(bb_max, bb_max);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
GLAPI void GLAPIENTRY glMultMatrixf(const GLfloat *m)
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
GLAPI void GLAPIENTRY glPopMatrix(void)
void readFromStream(mrpt::utils::CStream &in, int version)
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
double z
X,Y,Z coordinates.
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.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLAPI void GLAPIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z)
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const
Introduces a pure virtual method responsible for writing to a CStream.
The namespace for 3D scene representation and rendering.
A matrix of dynamic size.
GLAPI void GLAPIENTRY glPushMatrix(void)
void render_dl() const MRPT_OVERRIDE
Render.