Go to the documentation of this file.
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);
85 writeToStreamRender(out);
88 << m_keepRadiusIndependentEyeDistance;
97 readFromStreamRender(
in);
101 m_nDivsLongitude = i;
104 in >> m_keepRadiusIndependentEyeDistance;
106 m_keepRadiusIndependentEyeDistance =
false;
125 CPose3D transf = this->m_pose - o;
126 double x = transf.
x(),
y = transf.
y(),
z = transf.z();
127 double r2 = m_radius * m_radius;
128 double dyz =
y *
y +
z *
z;
129 if (dyz > r2)
return false;
130 double dx = sqrt(r2 - dyz);
136 else if (
x + dx >= 0)
148 bb_min.
x = -m_radius;
149 bb_min.
y = -m_radius;
150 bb_min.
z = -m_radius;
157 m_pose.composePoint(bb_min, bb_min);
158 m_pose.composePoint(bb_max, bb_max);
GLAPI void GLAPIENTRY glGetFloatv(GLenum pname, GLfloat *params)
std::shared_ptr< CSphere > Ptr
A solid or wire-frame sphere.
A renderizable object suitable for rendering with OpenGL's display lists.
GLsizei GLsizei GLuint * obj
GLAPI void GLAPIENTRY glDisable(GLenum cap)
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
GLAPI void GLAPIENTRY glEnable(GLenum cap)
GLAPI void GLAPIENTRY glRasterPos3f(GLfloat x, GLfloat y, GLfloat z)
std::shared_ptr< CRenderizable > Ptr
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
Virtual base class for "archives": classes abstracting I/O streams.
uint8_t serializeGetVersion() const override
Must return the current versioning number of the object.
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...
void checkOpenGLError()
Checks glGetError and throws an exception if an error situation is found.
#define GL_ONE_MINUS_SRC_ALPHA
double x() const
Common members of all points & poses classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
double x
X,Y,Z coordinates.
void serializeTo(mrpt::serialization::CArchive &out) const override
Pure virtual method for writing (serializing) to an abstract archive.
#define GL_CURRENT_RASTER_POSITION
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
This base provides a set of functions for maths stuff.
void serializeFrom(mrpt::serialization::CArchive &in, uint8_t serial_version) override
Pure virtual method for reading (deserializing) from an abstract archive.
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void render_dl() const override
Render.
The namespace for 3D scene representation and rendering.
unsigned __int32 uint32_t
GLAPI void GLAPIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor)
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |