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);
178 writeToStreamRender(out);
179 out << m_x0 << m_y0 << m_z0;
180 out << m_x1 << m_y1 << m_z1;
181 out << m_headRatio << m_smallRadius << m_largeRadius;
182 out << m_arrow_roll << m_arrow_pitch << m_arrow_yaw;
191 readFromStreamRender(
in);
192 in >> m_x0 >> m_y0 >> m_z0;
193 in >> m_x1 >> m_y1 >> m_z1;
194 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
199 readFromStreamRender(
in);
200 in >> m_x0 >> m_y0 >> m_z0;
201 in >> m_x1 >> m_y1 >> m_z1;
202 in >> m_headRatio >> m_smallRadius >> m_largeRadius;
203 in >> m_arrow_roll >> m_arrow_pitch >> m_arrow_yaw;
219 bb_max.
x = std::max(m_x0, m_x1);
220 bb_max.
y = std::max(m_y0, m_y1);
221 bb_max.
z = std::max(m_z0, m_z1);
224 m_pose.composePoint(bb_min, bb_min);
225 m_pose.composePoint(bb_max, bb_max);