MVSim
Lightweight simulator for 2.5D vehicles and robots
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
mvsim::VisualObject Class Referenceabstract

#include <VisualObject.h>

Inheritance diagram for mvsim::VisualObject:
Inheritance graph
[legend]
Collaboration diagram for mvsim::VisualObject:
Collaboration graph
[legend]

Public Member Functions

 VisualObject (World *parent, bool insertCustomVizIntoViz=true, bool insertCustomVizIntoPhysical=true)
 
 VisualObject (const VisualObject &)=delete
 
VisualObjectoperator= (const VisualObject &)=delete
 
 VisualObject (VisualObject &&)=delete
 
VisualObjectoperator= (VisualObject &&)=delete
 
virtual void guiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical)
 
Worldparent ()
 
const Worldparent () const
 
void customVisualVisible (const bool visible)
 
bool customVisualVisible () const
 
const std::optional< Shape2p5 > & collisionShape () const
 
void showCollisionShape (bool show)
 

Static Public Member Functions

static void FreeOpenGLResources ()
 

Static Public Attributes

static double GeometryEpsilon
 

Protected Member Functions

bool parseVisual (const rapidxml::xml_node< char > &rootNode)
 Returns true if there is at least one <visual>...</visual> entry.
 
bool parseVisual (const JointXMLnode<> &rootNode)
 
virtual void internalGuiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical, bool childrenOnly=false)=0
 
void addCustomVisualization (const mrpt::opengl::CRenderizable::Ptr &glModel, const mrpt::poses::CPose3D &modelPose={}, const float modelScale=1.0f, const std::string &modelName="group", const std::optional< std::string > &modelURI=std::nullopt, const bool initialShowBoundingBox=false, const std::optional< double > &scaleOverride=std::nullopt)
 
void setCollisionShape (const Shape2p5 &cs)
 

Protected Attributes

Worldworld_
 
std::shared_ptr< mrpt::opengl::CSetOfObjects > glCustomVisual_
 
std::shared_ptr< mrpt::opengl::CSetOfObjects > glCollision_
 
int32_t glCustomVisualId_ = -1
 
const bool insertCustomVizIntoViz_ = true
 
const bool insertCustomVizIntoPhysical_ = true
 

Detailed Description

Virtual base class for any entity that can be shown in the 3D viewer (or sent out to RViz)

Member Function Documentation

◆ collisionShape()

const std::optional<Shape2p5>& mvsim::VisualObject::collisionShape ( ) const
inline

Returns the collision shape, if defined (should be for regular entities after correct initialization).

◆ guiUpdate()

virtual void mvsim::VisualObject::guiUpdate ( const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &  viz,
const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &  physical 
)
virtual

This creates a new object in the scene and/or update it according to the current state of the object. If none of the scenes are passed, the poses of existing visual objects are updated, but no new ones are created.

Member Data Documentation

◆ GeometryEpsilon

double mvsim::VisualObject::GeometryEpsilon
static

Epsilon for geometry checks related to bounding boxes (default:1e-3)

◆ glCustomVisual_

std::shared_ptr<mrpt::opengl::CSetOfObjects> mvsim::VisualObject::glCustomVisual_
protected

If not empty, will override the derived-class visualization for this object.


The documentation for this class was generated from the following file: