27 float radius,
int nDivsLongitude,
int nDivsLatitude)
36 #if MRPT_HAS_OPENGL_GLUT 46 if (m_keepRadiusIndependentEyeDistance)
52 float eye_distance = raster_pos[3];
54 eye_distance = max(eye_distance, 0.1f);
56 real_radius = 0.01 * m_radius * eye_distance;
59 real_radius = m_radius;
61 GLUquadricObj*
obj = gluNewQuadric();
64 gluQuadricDrawStyle(
obj, GLU_FILL);
65 gluQuadricNormals(
obj, GLU_SMOOTH);
67 gluSphere(
obj, real_radius, m_nDivsLongitude, m_nDivsLatitude);
70 gluDeleteQuadric(
obj);
91 writeToStreamRender(out);
94 << m_keepRadiusIndependentEyeDistance;
109 readFromStreamRender(
in);
113 m_nDivsLongitude = i;
116 in >> m_keepRadiusIndependentEyeDistance;
118 m_keepRadiusIndependentEyeDistance =
false;
137 CPose3D transf = this->m_pose - o;
138 double x = transf.
x(),
y = transf.
y(),
z = transf.z();
139 double r2 = m_radius * m_radius;
140 double dyz =
y *
y +
z *
z;
141 if (dyz > r2)
return false;
142 double dx = sqrt(r2 - dyz);
148 else if (
x + dx >= 0)
160 bb_min.
x = -m_radius;
161 bb_min.
y = -m_radius;
162 bb_min.
z = -m_radius;
169 m_pose.composePoint(bb_min, bb_min);
170 m_pose.composePoint(bb_max, bb_max);
double x() const
Common members of all points & poses classes.
GLAPI void GLAPIENTRY glGetFloatv(GLenum pname, GLfloat *params)
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
GLAPI void GLAPIENTRY glEnable(GLenum cap)
GLAPI void GLAPIENTRY glRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
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...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated) ...
#define GL_ONE_MINUS_SRC_ALPHA
std::shared_ptr< CObject > Ptr
GLsizei GLsizei GLuint * obj
#define GL_CURRENT_RASTER_POSITION
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
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...
void writeToStream(mrpt::utils::CStream &out, int *getVersion) const override
Introduces a pure virtual method responsible for writing to a CStream.
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.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
A solid or wire-frame sphere.
The namespace for 3D scene representation and rendering.
void render_dl() const override
Render.
unsigned __int32 uint32_t
GLAPI void GLAPIENTRY glDisable(GLenum cap)
std::shared_ptr< CSphere > Ptr
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...