chrono::irrlicht::tools Namespace Reference

Description

Utilities for interfacing Chrono and Irrlicht.

Functions

void alignIrrlichtNodeToChronoCsys (scene::ISceneNode *mnode, const ChCoordsys<> &mcoords)
 
int drawAllContactPoints (std::shared_ptr< ChContactContainer > mcontactcontainer, irr::video::IVideoDriver *driver, double mlen=1.0, IrrContactsDrawMode drawtype=IrrContactsDrawMode::CONTACT_NORMALS)
 Easy-to-use function which draws contact points used by a ChSystem in the current Irrlicht viewer (the IVideoDriver). More...
 
int drawAllContactLabels (std::shared_ptr< ChContactContainer > mcontactcontainer, irr::IrrlichtDevice *device, IrrContactsLabelMode labeltype=IrrContactsLabelMode::CONTACT_FORCES_N_VAL, irr::video::SColor mcol=irr::video::SColor(255, 255, 255, 255))
 Easy-to-use function which draws contact informations as labels at the contact point.
 
int drawAllLinks (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double mlen=1.0, IrrLinkDrawMode drawtype=IrrLinkDrawMode::LINK_REACT_FORCE)
 Easy-to-use function which draws reaction forces in all contacts in current Irrlicht viewer (the IVideoDriver).
 
int drawAllLinkLabels (ChSystem &mphysicalSystem, irr::IrrlichtDevice *device, IrrLinkLabelMode labeltype=IrrLinkLabelMode::LINK_REACT_FORCE_X, irr::video::SColor mcol=irr::video::SColor(255, 255, 255, 255))
 Easy-to-use function which draws contact informations as labels at the contact point.
 
int drawAllBoundingBoxes (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver)
 Easy-to-use function which draws collision objects bounding boxes for rigid bodies - if they have a collision shape.
 
int drawAllCOGs (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double scale=0.01)
 Easy-to-use function which draws coordinate systems of ChBody objects.
 
int drawAllLinkframes (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double scale=0.01)
 Easy-to-use function which draws coordinate systems of link frames.
 
void drawHUDviolation (irr::video::IVideoDriver *driver, IrrlichtDevice *mdevice, ChSystem &asystem, int mx, int my, int sx, int sy, double spfact)
 
void drawChFunction (IrrlichtDevice *mdevice, ChFunction *fx, double xmin, double xmax, double ymin, double ymax, int mx, int my, int sx, int sy)
 
void drawSegment (irr::video::IVideoDriver *driver, ChVector<> mstart, ChVector<> mend, irr::video::SColor mcol=irr::video::SColor(255, 0, 0, 0), bool use_Zbuffer=false)
 Easy-to-use function to draw segment lines in 3D space, with given color.
 
void drawPolyline (irr::video::IVideoDriver *driver, std::vector< ChVector<> > &mpoints, irr::video::SColor mcol=irr::video::SColor(255, 0, 0, 0), bool use_Zbuffer=false)
 Easy-to-use function to draw a polyline in 3D space, given the array of points as a std::vector.
 
void drawCircle (irr::video::IVideoDriver *driver, double radius, ChCoordsys<> mpos=CSYSNORM, irr::video::SColor mcol=irr::video::SColor(255, 0, 0, 0), int mresolution=36, bool use_Zbuffer=false)
 Easy-to-use function to draw a circle line in 3D space, with given color. More...
 
void drawSpring (irr::video::IVideoDriver *driver, double radius, ChVector<> start, ChVector<> end, irr::video::SColor mcol=irr::video::SColor(255, 0, 0, 0), int mresolution=65, double turns=5, bool use_Zbuffer=false)
 Easy-to-use function to draw a spring in 3D space, with given color. More...
 
void drawGrid (irr::video::IVideoDriver *driver, double ustep=0.1, double vstep=0.1, int nu=20, int nv=20, ChCoordsys<> mpos=CSYSNORM, irr::video::SColor mcol=irr::video::SColor(50, 80, 110, 110), bool use_Zbuffer=false)
 Easy-to-use function to draw grids in 3D space, with given orientation, color and spacing.
 
void drawColorbar (double vmin, double vmax, const std::string &label, IrrlichtDevice *mdevice, int mx, int my, int sx, int sy)
 Easy-to-use function to draw color map 2D legend.
 
void drawCollisionShapes (ChSystem &asystem, irr::IrrlichtDevice *mdevice, irr::video::SColor mcol=irr::video::SColor(50, 0, 0, 110))
 Draw the collision shapes as wireframe, overlayed to shapes. More...
 
void drawPlot3D (irr::video::IVideoDriver *driver, ChMatrixConstRef X, ChMatrixConstRef Y, ChMatrixConstRef Z, ChCoordsys<> mpos=CSYSNORM, irr::video::SColor mcol=irr::video::SColor(50, 80, 110, 110), bool use_Zbuffer=false)
 
 
void drawProfilerRecursive (utils::ChProfileIterator *profileIterator, irr::IrrlichtDevice *device, int mx, int my, int sx, int sy, int xspacing, int &ypos)
 
void drawProfiler (irr::IrrlichtDevice *device)
 Draw run-time profiler infos.
 
ChApiIrr void alignIrrlichtNodeToChronoCsys (irr::scene::ISceneNode *mnode, const ChCoordsys<> &mcoords)
 Function to align an Irrlicht object to a Chrono coordsys.
 
ChApiIrr void drawHUDviolation (irr::video::IVideoDriver *driver, irr::IrrlichtDevice *mdevice, ChSystem &asystem, int mx=10, int my=290, int sx=300, int sy=100, double spfact=100.0)
 
 
ChApiIrr void drawChFunction (irr::IrrlichtDevice *mdevice, ChFunction *fx, double xmin=0, double xmax=1, double ymin=-1, double ymax=1, int mx=10, int my=290, int sx=300, int sy=100)
 
 
ChApiIrr void drawColorbar (double vmin, double vmax, const std::string &label, irr::IrrlichtDevice *mdevice, int mx=740, int my=20, int sx=30, int sy=300)
 Easy-to-use function to draw color bar with a color map and 2D legend.
 
void add_typical_Logo (IrrlichtDevice *device, const std::string &mlogofilename)
 
void add_typical_Lights (IrrlichtDevice *device, irr::core::vector3df pos1, irr::core::vector3df pos2, double rad1, double rad2, irr::video::SColorf col1, irr::video::SColorf col2)
 
void add_typical_Sky (IrrlichtDevice *device, bool y_up, const std::string &mtexturedir)
 
void add_typical_Camera (IrrlichtDevice *device, irr::core::vector3df pos, irr::core::vector3df targ, bool y_up)
 
ChApiIrr void add_typical_Logo (irr::IrrlichtDevice *device, const std::string &mlogofilename=GetChronoDataFile("logo_chronoengine_alpha.png"))
 A very basic and simple function which is just a shortcut to avoid lot of typing when someone wants to add a logo in a 3D scene, using Irrlicht.
 
ChApiIrr void add_typical_Lights (irr::IrrlichtDevice *device, irr::core::vector3df pos1=irr::core::vector3df(30.f, 100.f, 30.f), irr::core::vector3df pos2=irr::core::vector3df(30.f, 80.f, -30.f), double rad1=290, double rad2=190, irr::video::SColorf col1=irr::video::SColorf(0.7f, 0.7f, 0.7f, 1.0f), irr::video::SColorf col2=irr::video::SColorf(0.7f, 0.8f, 0.8f, 1.0f))
 A very basic and simple function which is just a shortcut to avoid lot of typing when someone wants to add two lights in a 3D scene, using Irrlicht. More...
 
ChApiIrr void add_typical_Sky (irr::IrrlichtDevice *device, bool y_up=true, const std::string &mtexturedir=GetChronoDataFile("skybox/"))
 A very basic and simple function which is just a shortcut to avoid lot of typing when someone wants to add a sky dome (sky box) in a 3D scene, using Irrlicht. More...
 
ChApiIrr void add_typical_Camera (irr::IrrlichtDevice *device, irr::core::vector3df pos=irr::core::vector3df(0, 0, -8), irr::core::vector3df targ=irr::core::vector3df(0, 0, 0), bool y_up=true)
 A very basic and simple function which is just a shortcut to avoid lot of typing when someone wants to add a Maya-like camera in a Irrlicht 3D scene. More...
 

Function Documentation

◆ drawAllContactPoints()

ChApiIrr int chrono::irrlicht::tools::drawAllContactPoints ( std::shared_ptr< ChContactContainer mcontactcontainer,
irr::video::IVideoDriver *  driver,
double  mlen = 1.0,
IrrContactsDrawMode  drawtype = IrrContactsDrawMode::CONTACT_NORMALS 
)

Easy-to-use function which draws contact points used by a ChSystem in the current Irrlicht viewer (the IVideoDriver).

The contact points are visually represented with short lines, of length mlen, aligned to contact normals.

◆ drawCircle()

ChApiIrr void chrono::irrlicht::tools::drawCircle ( irr::video::IVideoDriver *  driver,
double  radius,
ChCoordsys<>  mpos = CSYSNORM,
irr::video::SColor  mcol = irr::video::SColor(255, 0, 0, 0),
int  mresolution = 36,
bool  use_Zbuffer = false 
)

Easy-to-use function to draw a circle line in 3D space, with given color.

Specify the center as coordsys position. Orientation as coordsys quaternion (default in xy plane)

◆ drawCollisionShapes()

ChApiIrr void chrono::irrlicht::tools::drawCollisionShapes ( ChSystem asystem,
irr::IrrlichtDevice *  mdevice,
irr::video::SColor  mcol = irr::video::SColor(50, 0, 0, 110) 
)

Draw the collision shapes as wireframe, overlayed to shapes.

Note: this works only for the Bullet collision system (i.e. not working for Chrono::Multicore)

◆ drawSpring()

ChApiIrr void chrono::irrlicht::tools::drawSpring ( irr::video::IVideoDriver *  driver,
double  radius,
ChVector<>  start,
ChVector<>  end,
irr::video::SColor  mcol = irr::video::SColor(255, 0, 0, 0),
int  mresolution = 65,
double  turns = 5,
bool  use_Zbuffer = false 
)

Easy-to-use function to draw a spring in 3D space, with given color.

Specify the radius, the end points in absolute space, the resolution (i.e. the number of segments approximating the helix) and the number of turns.