VerticalPlane.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2024 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
12 #include <mrpt/img/TColor.h>
13 #include <mrpt/opengl/CSetOfObjects.h>
14 #include <mrpt/opengl/CSetOfTexturedTriangles.h>
15 #include <mrpt/opengl/CTexturedPlane.h>
17 
18 namespace mvsim
19 {
25 {
27  public:
29  virtual ~VerticalPlane();
30 
31  virtual void loadConfigFrom(const rapidxml::xml_node<char>* root) override;
32  // ------- Interface with "World" ------
33  void simul_pre_timestep(const TSimulContext& context) override;
34  void simul_post_timestep(const TSimulContext& context) override;
35 
36  protected:
37  virtual void internalGuiUpdate(
38  const mrpt::optional_ref<mrpt::opengl::COpenGLScene>& viz,
39  const mrpt::optional_ref<mrpt::opengl::COpenGLScene>& physical, bool childrenOnly) override;
40 
41  float x0_ = -10, x1_ = -10, y0_ = -10, y1_ = 10;
42  mrpt::img::TColor color_ = {0xa0, 0xa0, 0xa0, 0xff};
43  bool enableShadows_ = true;
44 
46  std::string textureFileName_;
47  double textureSizeX_ = 1.0;
48  double textureSizeY_ = 1.0;
49 
50  float z_ = .0f, height_ = 3.0f;
51  std::string cull_faces_ = "NONE";
52 
53  mrpt::opengl::CTexturedPlane::Ptr gl_plane_;
54  mrpt::opengl::CSetOfTexturedTriangles::Ptr gl_plane_text_;
55  mrpt::opengl::CSetOfObjects::Ptr glGroup_;
56 
57  b2Body* b2dBody_ = nullptr;
58  double restitution_ = 0.01;
60 };
61 } // namespace mvsim
mvsim::VisualObject::parent
World * parent()
Definition: VisualObject.h:51
mvsim
Definition: Client.h:21
mvsim::VerticalPlane::gl_plane_
mrpt::opengl::CTexturedPlane::Ptr gl_plane_
Definition: VerticalPlane.h:53
mvsim::VerticalPlane::x1_
float x1_
Definition: VerticalPlane.h:41
WorldElementBase.h
mvsim::VerticalPlane::cull_faces_
std::string cull_faces_
Definition: VerticalPlane.h:51
mvsim::VerticalPlane::x0_
float x0_
Definition: VerticalPlane.h:41
b2Body
A rigid body. These are created via b2World::CreateBody.
Definition: b2_body.h:128
mvsim::VerticalPlane::textureFileName_
std::string textureFileName_
Definition: VerticalPlane.h:46
mvsim::VerticalPlane::b2dBody_
b2Body * b2dBody_
Definition: VerticalPlane.h:57
mvsim::VerticalPlane::color_
mrpt::img::TColor color_
Definition: VerticalPlane.h:42
mvsim::VerticalPlane::z_
float z_
Definition: VerticalPlane.h:50
mvsim::VerticalPlane::height_
float height_
Definition: VerticalPlane.h:50
mvsim::VerticalPlane
Definition: VerticalPlane.h:24
mvsim::VerticalPlane::simul_pre_timestep
void simul_pre_timestep(const TSimulContext &context) override
Definition: VerticalPlane.cpp:246
mvsim::TSimulContext
Definition: basic_types.h:58
DECLARES_REGISTER_WORLD_ELEMENT
#define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME)
Definition: WorldElementBase.h:53
mvsim::VerticalPlane::textureSizeX_
double textureSizeX_
Definition: VerticalPlane.h:47
b2Fixture
Definition: b2_fixture.h:116
mvsim::VerticalPlane::~VerticalPlane
virtual ~VerticalPlane()
Definition: VerticalPlane.cpp:33
mvsim::VerticalPlane::textureSizeY_
double textureSizeY_
Definition: VerticalPlane.h:48
mvsim::VerticalPlane::simul_post_timestep
void simul_post_timestep(const TSimulContext &context) override
Definition: VerticalPlane.cpp:251
mvsim::World
Definition: World.h:82
mvsim::VerticalPlane::y1_
float y1_
Definition: VerticalPlane.h:41
rapidxml::xml_node< char >
mvsim::VerticalPlane::glGroup_
mrpt::opengl::CSetOfObjects::Ptr glGroup_
Definition: VerticalPlane.h:55
mvsim::VerticalPlane::enableShadows_
bool enableShadows_
Definition: VerticalPlane.h:43
mvsim::VerticalPlane::VerticalPlane
VerticalPlane(World *parent, const rapidxml::xml_node< char > *root)
Definition: VerticalPlane.cpp:25
mvsim::VerticalPlane::gl_plane_text_
mrpt::opengl::CSetOfTexturedTriangles::Ptr gl_plane_text_
Definition: VerticalPlane.h:54
mvsim::VerticalPlane::y0_
float y0_
Definition: VerticalPlane.h:41
root
root
mvsim::VerticalPlane::internalGuiUpdate
virtual void internalGuiUpdate(const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical, bool childrenOnly) override
Definition: VerticalPlane.cpp:118
mvsim::WorldElementBase
Definition: WorldElementBase.h:27
mvsim::VerticalPlane::loadConfigFrom
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root) override
Definition: VerticalPlane.cpp:35
mvsim::VerticalPlane::restitution_
double restitution_
Default: 0.01.
Definition: VerticalPlane.h:58
mvsim::VerticalPlane::fixture_block_
b2Fixture * fixture_block_
Definition: VerticalPlane.h:59


mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08