chrono::irrlicht::ChIrrTools Class Reference

Description

Class with static functions which help with the integration of Chrono::Engine and Irrlicht 3D rendering library.

#include <ChIrrTools.h>

Public Types

enum  eCh_ContactsDrawMode {
  CONTACT_NORMALS = 0, CONTACT_DISTANCES, CONTACT_FORCES_N, CONTACT_FORCES,
  CONTACT_NONE
}
 
enum  eCh_ContactsLabelMode {
  CONTACT_DISTANCES_VAL, CONTACT_FORCES_VAL, CONTACT_FORCES_N_VAL, CONTACT_FORCES_T_VAL,
  CONTACT_TORQUES_VAL, CONTACT_TORQUES_S_VAL, CONTACT_TORQUES_R_VAL, CONTACT_NONE_VAL
}
 
enum  eCh_LinkDrawMode { LINK_REACT_FORCE = 0, LINK_REACT_TORQUE, LINK_NONE }
 
enum  eCh_LinkLabelMode {
  LINK_REACT_FORCE_VAL = 0, LINK_REACT_FORCE_X, LINK_REACT_FORCE_Y, LINK_REACT_FORCE_Z,
  LINK_REACT_TORQUE_VAL, LINK_REACT_TORQUE_X, LINK_REACT_TORQUE_Y, LINK_REACT_TORQUE_Z,
  LINK_NONE_VAL
}
 

Static Public Member Functions

static void alignIrrlichtNodeToChronoCsys (irr::scene::ISceneNode *mnode, const ChCoordsys<> &mcoords)
 Function to align an Irrlicht object to a Chrono::Engine coordsys.
 
static int drawAllContactPoints (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double mlen=1.0, eCh_ContactsDrawMode drawtype=CONTACT_NORMALS)
 Easy-to-use function which draws contact points used by a ChSystem in the current Irrlicht viewer (the IVideoDriver). More...
 
static int drawAllContactLabels (ChSystem &mphysicalSystem, irr::IrrlichtDevice *device, eCh_ContactsLabelMode labeltype=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.
 
static int drawAllLinks (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double mlen=1.0, eCh_LinkDrawMode drawtype=LINK_REACT_FORCE)
 Easy-to-use function which draws reaction forces in all contacts in current Irrlicht viewer (the IVideoDriver). More...
 
static int drawAllLinkLabels (ChSystem &mphysicalSystem, irr::IrrlichtDevice *device, eCh_LinkLabelMode labeltype=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.
 
static 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. More...
 
static int drawAllCOGs (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double scale=0.01)
 Easy-to-use function which draws coordinate systems of ChBody objects.
 
static int drawAllLinkframes (ChSystem &mphysicalSystem, irr::video::IVideoDriver *driver, double scale=0.01)
 Easy-to-use function which draws coordinate systems of link frames.
 
static 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, double posfact=500.0)
 
 
static 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)
 
 
static 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.
 
static 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. More...
 
static 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...
 
static 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...
 
static 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. More...
 
static 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. More...
 
static void drawPlot3D (irr::video::IVideoDriver *driver, ChMatrix<> X, ChMatrix<> Y, ChMatrix<> Z, ChCoordsys<> mpos=CSYSNORM, irr::video::SColor mcol=irr::video::SColor(50, 80, 110, 110), bool use_Zbuffer=false)
 
 

Member Function Documentation

int chrono::irrlicht::ChIrrTools::drawAllBoundingBoxes ( ChSystem mphysicalSystem,
irr::video::IVideoDriver *  driver 
)
static

Easy-to-use function which draws collision objects bounding boxes for rigid bodies - if they have a collision shape.

int chrono::irrlicht::ChIrrTools::drawAllContactPoints ( ChSystem mphysicalSystem,
irr::video::IVideoDriver *  driver,
double  mlen = 1.0,
eCh_ContactsDrawMode  drawtype = CONTACT_NORMALS 
)
static

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.

int chrono::irrlicht::ChIrrTools::drawAllLinks ( ChSystem mphysicalSystem,
irr::video::IVideoDriver *  driver,
double  mlen = 1.0,
eCh_LinkDrawMode  drawtype = LINK_REACT_FORCE 
)
static

Easy-to-use function which draws reaction forces in all contacts in current Irrlicht viewer (the IVideoDriver).

void chrono::irrlicht::ChIrrTools::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 
)
static

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)

void chrono::irrlicht::ChIrrTools::drawColorbar ( double  vmin,
double  vmax,
const std::string &  label,
irr::IrrlichtDevice *  mdevice,
int  mx = 740,
int  my = 20,
int  sx = 30,
int  sy = 300 
)
static

Easy-to-use function to draw color bar with a color map and 2D legend.

Easy-to-use function to draw color map 2D legend.

void chrono::irrlicht::ChIrrTools::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 
)
static

Easy-to-use function to draw grids in 3D space, with given orientation, color and spacing.

void chrono::irrlicht::ChIrrTools::drawPolyline ( irr::video::IVideoDriver *  driver,
std::vector< ChVector<> > &  mpoints,
irr::video::SColor  mcol = irr::video::SColor(255, 0, 0, 0),
bool  use_Zbuffer = false 
)
static

Easy-to-use function to draw a polyline in 3D space, given the array of points as a std::vector.

void chrono::irrlicht::ChIrrTools::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 
)
static

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.