modules
simulator
include
mvsim
WorldElements
VerticalPlane.h
Go to the documentation of this file.
1
/*+-------------------------------------------------------------------------+
2
| MultiVehicle simulator (libmvsim) |
3
| |
4
| Copyright (C) 2014-2023 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>
16
#include <
mvsim/WorldElements/WorldElementBase.h
>
17
18
namespace
mvsim
19
{
24
class
VerticalPlane
:
public
WorldElementBase
25
{
26
DECLARES_REGISTER_WORLD_ELEMENT
(
VerticalPlane
)
27
public
:
28
VerticalPlane
(
World
*
parent
,
const
rapidxml::xml_node<char>
* root);
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,
40
bool
childrenOnly)
override
;
41
42
float
x0_
= -10,
x1_
= -10,
y0_
= -10,
y1_
= 10;
43
mrpt::img::TColor
color_
= {0xa0, 0xa0, 0xa0, 0xff};
44
bool
enableShadows_
=
true
;
45
47
std::string
textureFileName_
;
48
double
textureSizeX_
= 1.0;
49
double
textureSizeY_
= 1.0;
50
51
float
z_
= .0f,
height_
= 3.0f;
52
std::string
cull_faces_
=
"NONE"
;
53
54
mrpt::opengl::CTexturedPlane::Ptr
gl_plane_
;
55
mrpt::opengl::CSetOfTexturedTriangles::Ptr
gl_plane_text_
;
56
mrpt::opengl::CSetOfObjects::Ptr
glGroup_
;
57
58
b2Body
*
b2dBody_
=
nullptr
;
59
double
restitution_
= 0.01;
60
b2Fixture
*
fixture_block_
=
nullptr
;
61
};
62
}
// namespace mvsim
mvsim::VerticalPlane::loadConfigFrom
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root) override
Definition:
VerticalPlane.cpp:36
mvsim
mvsim::VerticalPlane::cull_faces_
std::string cull_faces_
Definition:
VerticalPlane.h:52
mvsim::VerticalPlane::textureSizeX_
double textureSizeX_
Definition:
VerticalPlane.h:48
mvsim::VerticalPlane::x1_
float x1_
Definition:
VerticalPlane.h:42
mvsim::VerticalPlane::b2dBody_
b2Body * b2dBody_
Definition:
VerticalPlane.h:58
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:120
mvsim::VerticalPlane::z_
float z_
Definition:
VerticalPlane.h:51
mvsim::World
Definition:
World.h:62
mvsim::TSimulContext
Definition:
basic_types.h:55
mvsim::VerticalPlane::y1_
float y1_
Definition:
VerticalPlane.h:42
b2Fixture
Definition:
b2_fixture.h:116
mvsim::VerticalPlane::gl_plane_
mrpt::opengl::CTexturedPlane::Ptr gl_plane_
Definition:
VerticalPlane.h:54
mvsim::VerticalPlane
Definition:
VerticalPlane.h:24
mvsim::VerticalPlane::simul_pre_timestep
void simul_pre_timestep(const TSimulContext &context) override
Definition:
VerticalPlane.cpp:250
b2Body
A rigid body. These are created via b2World::CreateBody.
Definition:
b2_body.h:128
mvsim::VerticalPlane::~VerticalPlane
virtual ~VerticalPlane()
Definition:
VerticalPlane.cpp:34
mvsim::VerticalPlane::textureFileName_
std::string textureFileName_
Definition:
VerticalPlane.h:47
mvsim::VerticalPlane::color_
mrpt::img::TColor color_
Definition:
VerticalPlane.h:43
DECLARES_REGISTER_WORLD_ELEMENT
#define DECLARES_REGISTER_WORLD_ELEMENT(CLASS_NAME)
Definition:
WorldElementBase.h:45
mvsim::WorldElementBase
Definition:
WorldElementBase.h:18
mvsim::VerticalPlane::simul_post_timestep
void simul_post_timestep(const TSimulContext &context) override
Definition:
VerticalPlane.cpp:255
mvsim::VerticalPlane::fixture_block_
b2Fixture * fixture_block_
Definition:
VerticalPlane.h:60
WorldElementBase.h
mvsim::VerticalPlane::enableShadows_
bool enableShadows_
Definition:
VerticalPlane.h:44
mvsim::VerticalPlane::gl_plane_text_
mrpt::opengl::CSetOfTexturedTriangles::Ptr gl_plane_text_
Definition:
VerticalPlane.h:55
mvsim::VerticalPlane::VerticalPlane
VerticalPlane(World *parent, const rapidxml::xml_node< char > *root)
Definition:
VerticalPlane.cpp:25
mvsim::VisualObject::parent
World * parent()
Definition:
VisualObject.h:46
mvsim::VerticalPlane::glGroup_
mrpt::opengl::CSetOfObjects::Ptr glGroup_
Definition:
VerticalPlane.h:56
mvsim::VerticalPlane::y0_
float y0_
Definition:
VerticalPlane.h:42
mvsim::VerticalPlane::height_
float height_
Definition:
VerticalPlane.h:51
rapidxml::xml_node< char >
mvsim::VerticalPlane::textureSizeY_
double textureSizeY_
Definition:
VerticalPlane.h:49
mvsim::VerticalPlane::restitution_
double restitution_
Default: 0.01.
Definition:
VerticalPlane.h:59
mvsim::VerticalPlane::x0_
float x0_
Definition:
VerticalPlane.h:42
mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:21