raisin::CameraFrustum
class · #include <rayrai/CameraFrustum.hpp>
Visual helper that renders camera frustum edges.
The frustum mesh is updated from either a rayrai Camera or a raisim DepthCamera and rendered using a Visuals instance.
Constructors & destructor
CameraFrustum
CameraFrustum(
std::shared_ptr<Visuals> visual,
std::shared_ptr<OpenGLMesh> mesh)Construct a frustum helper with a visual and mesh.
Parameters
| Parameter | Description |
|---|---|
visual | Visuals object used for rendering. |
mesh | OpenGL line mesh representing the frustum edges. |
Public member functions
updateFromCamera
void updateFromCamera(const Camera &camera)Update frustum mesh from a rayrai camera.
Handles both perspective (vertical FOV from Camera::zoom) and orthographic (Camera::orthoScale) projections. The drawn far distance is clamped to 10 m. Requires a current OpenGL context (the mesh is re-uploaded).
Parameters
| Parameter | Description |
|---|---|
camera | Source camera. |
updateFromDepthCamera
void updateFromDepthCamera(raisim::DepthCamera &depthCam)Update frustum mesh from a raisim depth camera.
Calls depthCam.updatePose() first. The sensor's horizontal FOV is read as radians, or as degrees when it exceeds pi. The drawn far distance is clamped to 10 m. Requires a current OpenGL context.
Parameters
| Parameter | Description |
|---|---|
depthCam | Source depth camera. |
updatePerspective
void updatePerspective(
const glm::vec3 &position,
const glm::quat &orientation,
float horizontalFov,
float aspect,
float nearDistance,
float farDistance)Update a perspective frustum from an explicit world-space sensor pose.
The sensor convention is local +X forward and local +Z up, matching RaiSim RGB and depth cameras.
Parameters
| Parameter | Description |
|---|---|
position | Sensor position in world coordinates. |
orientation | Sensor-to-world orientation (normalized internally; identity if degenerate). |
horizontalFov | Horizontal field of view in radians, clamped to (0, ~179 deg). |
aspect | Image width divided by image height. |
nearDistance | Near-plane distance. |
farDistance | Far-plane distance used to size the visualization. |
setColor
void setColor(const glm::vec4 &color)Set the frustum color.
Parameters
| Parameter | Description |
|---|---|
color | RGBA color. |
setDetectable
void setDetectable(bool detectable)Set the capture/detection render category on the frustum visual.
Camera frustums are usually viewer-only helpers and should normally remain non-detectable so they do not appear in external-camera or generated capture images. Set this to true only when the frustum helper itself should be included by detectable-only visualization passes.
Parameters
| Parameter | Description |
|---|---|
detectable | True to include the frustum visual in detectable-only render passes; false to keep it viewer-only for those passes. |
See also VisualCategory
getVisual
std::shared_ptr<Visuals> getVisual() constGet the underlying Visuals object.
Returns Shared pointer to the visual.