1#ifndef BITSIM_UTILS_RENDER_IRRLICHT_SCENE_H
2#define BITSIM_UTILS_RENDER_IRRLICHT_SCENE_H
12#include "bitsim/bitsim_config.h"
14#if defined(BITSIM_IRRLICHT) && defined(BITSIM_CHRONO)
18#include <chrono/physics/ChBody.h>
19#include <chrono_irrlicht/ChVisualSystemIrrlicht.h>
40 const std::string &texture);
65 void add(
const chrono::ChVector3d &p);
70 void draw(chrono::irrlicht::ChVisualSystemIrrlicht &vis,
const chrono::ChColor &colour,
71 real_t thickness = 2.0)
const;
73 std::size_t
size() const noexcept {
return points_.size(); }
74 void clear() { points_.clear(); }
79 std::vector<chrono::ChVector3d> points_;
97 InsetCamera(chrono::irrlicht::ChVisualSystemIrrlicht &vis,
real_t fov,
int width,
int height,
98 const std::string &label =
"robot camera");
104 void draw(
const chrono::ChVector3d &eye,
const chrono::ChVector3d &target);
107 chrono::irrlicht::ChVisualSystemIrrlicht &vis_;
108 chrono::irrlicht::RTSCamera *camera_{
nullptr};
109 irr::scene::ICameraSceneNode *main_camera_{
nullptr};
133 void record(chrono::irrlicht::ChVisualSystemIrrlicht &vis,
real_t time);
149void draw_status_bar(chrono::irrlicht::ChVisualSystemIrrlicht &vis,
const std::string &text);
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
void record(chrono::irrlicht::ChVisualSystemIrrlicht &vis, real_t time)
Write the window if it is time to, at simulation time time [s]. Call this after EndScene()....
Definition irrlicht_scene.cpp:129
bool is_recording() const noexcept
Definition irrlicht_scene.h:135
uint_t n_recorded() const noexcept
Definition irrlicht_scene.h:136
FrameRecorder(const std::string &dir, real_t rate=10.0)
Definition irrlicht_scene.cpp:121
void draw(const chrono::ChVector3d &eye, const chrono::ChVector3d &target)
Render the scene into the corner, from eye looking at target, both in world coordinates....
Definition irrlicht_scene.cpp:94
InsetCamera(chrono::irrlicht::ChVisualSystemIrrlicht &vis, real_t fov, int width, int height, const std::string &label="robot camera")
Definition irrlicht_scene.cpp:77
void clear()
Definition irrlicht_scene.h:74
void add(real_t x, real_t y)
Add a point, if it is further than min_step from the last one.
Definition irrlicht_scene.cpp:48
std::size_t size() const noexcept
Definition irrlicht_scene.h:73
Trail(real_t min_step=0.02, real_t height=0.01)
Definition irrlicht_scene.cpp:46
void draw(chrono::irrlicht::ChVisualSystemIrrlicht &vis, const chrono::ChColor &colour, real_t thickness=2.0) const
Draw the path. Call this between Render() and EndScene().
Definition irrlicht_scene.cpp:64
Definition irrlicht_scene.cpp:20
void add_floor_texture(chrono::ChBody &ground, real_t width, real_t height, real_t z, const std::string &texture)
Put a picture on the ground: a rectangle of width x height [m] centred on the origin of the world,...
Definition irrlicht_scene.cpp:22
void draw_status_bar(chrono::irrlicht::ChVisualSystemIrrlicht &vis, const std::string &text)
Write text on a light bar along the bottom of the window. Call this between Render() and EndScene().
Definition irrlicht_scene.cpp:151
Definition bitsim_utils.h:11
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20