100 const float fov_horz_left_degrees,
const float fov_horz_right_degrees);
103 const float fov_vert_down_degrees,
const float fov_vert_up_degrees);
127 float near_distance,
float far_distance,
float horz_FOV_degrees,
128 float vert_FOV_degrees,
float lineWidth,
bool draw_lines,
float getHorzFOVLeft() const
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Simulation of ray-trace, given a pose.
void onUpdateBuffers_Triangles() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
void freeOpenGLResources() override
Free opengl buffers.
void notifyChange() const
Call to enable calling renderUpdateBuffers() before the next render() rendering iteration.
void onUpdateBuffers_Wireframe() override
Must be implemented in derived classes to update the geometric entities to be drawn in "m_*_buffer" f...
float getNearPlaneDistance() const
float m_min_distance
Near and far planes.
void setVertFOV(const float fov_vert_degrees)
Changes vertical FOV (symmetric)
float getHorzFOVRight() const
Renderizable generic renderer for objects using the triangles shader.
std::array< mrpt::math::TPoint3Df, 8 > computeFrustumCorners() const
void setHorzFOV(const float fov_horz_degrees)
Changes horizontal FOV (symmetric)
float getVertFOVUp() const
void renderUpdateBuffers() const override
Called whenever m_outdatedBuffers is true: used to re-generate OpenGL vertex buffers, etc.
std::vector< shader_id_t > shader_list_t
A list of shader IDs.
Context for calls to render()
void setPlaneColor(const mrpt::img::TColor &c)
Changes the color of the planes; to change color of lines, use CRenderizable base methods...
CFrustum()
Basic empty constructor.
static constexpr shader_id_t WIREFRAME
void render(const RenderContext &rc) const override
Implements the rendering of 3D objects in each class derived from CRenderizable.
void freeOpenGLResources() override
Free opengl buffers.
~CFrustum() override=default
Destructor.
static constexpr shader_id_t TRIANGLES
virtual shader_list_t requiredShaders() const override
Returns the ID of the OpenGL shader program required to render this class.
const mrpt::img::TColor & getPlaneColor() const
mrpt::img::TColor m_planes_color
float m_fov_horz_left
Semi FOVs (in radians)
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void setNearFarPlanes(const float near_distance, const float far_distance)
Changes distance of near & far planes.
Renderizable generic renderer for objects using the wireframe shader.
constexpr double RAD2DEG(const double x)
Radians to degrees.
The namespace for 3D scene representation and rendering.
void setVertFOVAsymmetric(const float fov_vert_down_degrees, const float fov_vert_up_degrees)
Changes vertical FOV (asymmetric)
A solid or wireframe frustum in 3D (a rectangular truncated pyramid), with arbitrary (possibly assyme...
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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 setHorzFOVAsymmetric(const float fov_horz_left_degrees, const float fov_horz_right_degrees)
Changes horizontal FOV (asymmetric)
void freeOpenGLResources() override
Free opengl buffers.
float getFarPlaneDistance() const
float m_fov_vert_down
Semi FOVs (in radians)
float getVertFOVDown() const