chrono::irrlicht::tools Namespace Reference

Description

Utilities for interfacing Chrono and Irrlicht.

Functions

video::SColorf ToIrrlichtSColorf (const ChColor &col)
 Convert a ChColor to an Irrlicht SColorf.
 
video::SColor ToIrrlichtSColor (const ChColor &col, float alpha=1.0)
 Convert an RGB set and an opacity value to an Irrlicht SColor.
 
video::SMaterial ToIrrlichtMaterial (std::shared_ptr< ChVisualMaterial > mat, video::IVideoDriver *driver)
 
void alignIrrlichtNode (scene::ISceneNode *mnode, const ChCoordsys<> &mcoords)
 
int drawAllContactPoints (ChVisualSystemIrrlicht *vis, double mlen=1.0, ContactsDrawMode drawtype=ContactsDrawMode::CONTACT_NORMALS)
 Draw contact points used by a ChSystem in the current Irrlicht viewer. More...
 
int drawAllContactLabels (ChVisualSystemIrrlicht *vis, ContactsLabelMode labeltype=ContactsLabelMode::CONTACT_FORCES_N_VAL, ChColor col=ChColor(1, 1, 1))
 Draw contact informations as labels at the contact point.
 
int drawAllLinks (ChVisualSystemIrrlicht *vis, double mlen=1.0, LinkDrawMode drawtype=LinkDrawMode::LINK_REACT_FORCE)
 Draw reaction forces in all contacts in current Irrlicht viewer.
 
int drawAllLinkLabels (ChVisualSystemIrrlicht *vis, LinkLabelMode labeltype=LinkLabelMode::LINK_REACT_FORCE_X, ChColor col=ChColor(1, 1, 1))
 Draw contact informations as labels at the contact point.
 
int drawAllBoundingBoxes (ChVisualSystemIrrlicht *vis)
 Draw collision objects bounding boxes for rigid bodies (if they have a collision shape).
 
int drawAllCOGs (ChVisualSystemIrrlicht *vis, double scale=0.01)
 Draw coordinate systems of ChBody objects.
 
int drawAllLinkframes (ChVisualSystemIrrlicht *vis, double scale=0.01)
 Draw coordinate systems of link frames.
 
void drawHUDviolation (ChVisualSystemIrrlicht *vis, int mx, int my, int sx, int sy, double spfact)
 
void drawChFunction (ChVisualSystemIrrlicht *vis, std::shared_ptr< chrono::ChFunction > fx, double xmin, double xmax, double ymin, double ymax, int mx, int my, int sx, int sy, chrono::ChColor col, const char *title)
 
void drawSegment (ChVisualSystemIrrlicht *vis, ChVector3d start, ChVector3d end, ChColor col=ChColor(1, 1, 1), bool use_Zbuffer=false)
 Draw line segments in 3D space with given color.
 
void drawPolyline (ChVisualSystemIrrlicht *vis, std::vector< ChVector3d > &points, ChColor col=ChColor(1, 1, 1), bool use_Zbuffer=false)
 Draw a polyline in 3D space, given the array of points.
 
void drawCircle (ChVisualSystemIrrlicht *vis, double radius, ChCoordsys<> pos=CSYSNORM, ChColor col=ChColor(1, 1, 1), int resolution=36, bool use_Zbuffer=false)
 Draw a circle line in 3D space with given color. More...
 
void drawSpring (ChVisualSystemIrrlicht *vis, double radius, ChVector3d start, ChVector3d end, ChColor col=ChColor(1, 1, 1), int resolution=65, double turns=5, bool use_Zbuffer=false)
 Draw a spring in 3D space with given color. More...
 
void drawRotSpring (ChVisualSystemIrrlicht *vis, ChCoordsys<> pos, double radius, double start_angle, double end_angle, chrono::ChColor col, int resolution, bool use_Zbuffer)
 
void drawGrid (ChVisualSystemIrrlicht *vis, double ustep=0.1, double vstep=0.1, int nu=20, int nv=20, ChCoordsys<> pos=CSYSNORM, ChColor col=ChColor(0.7f, 0.7f, 0.7f), bool use_Zbuffer=false)
 Draw grids in 3D space with given orientation, color, and spacing.
 
void drawColorbar (ChVisualSystemIrrlicht *vis, double vmin, double vmax, const std::string &label, int mx=740, int my=20, int sx=30, int sy=300)
 Draw color bar with a color map and 2D legend.
 
void drawPlot3D (ChVisualSystemIrrlicht *vis, ChMatrixConstRef X, ChMatrixConstRef Y, ChMatrixConstRef Z, ChCoordsys<> pos, chrono::ChColor col, bool use_Zbuffer)
 
void drawProfilerRecursive (utils::ChProfileIterator *profileIterator, irr::IrrlichtDevice *device, int mx, int my, int sx, int sy, int xspacing, int &ypos)
 
void drawProfiler (ChVisualSystemIrrlicht *vis)
 Render run-time profiler info.
 
void drawCoordsys (ChVisualSystemIrrlicht *vis, const ChCoordsys<> &coord=CSYSNORM, double scale=1)
 Draw RGB coordinate system.
 
void drawArrow (ChVisualSystemIrrlicht *vis, ChVector3d start, ChVector3d end, ChVector3d plane_normal=VECT_Y, bool sharp=false, ChColor col=ChColor(1.f, 1.f, 1.f), bool use_Zbuffer=false)
 Draw a line arrow in 3D space with given color. More...
 
ChApiIrr irr::video::SMaterial ToIrrlichtMaterial (std::shared_ptr< ChVisualMaterial > mat, irr::video::IVideoDriver *driver)
 Convert a ChVisualMaterial to an Irrlicht material.
 
ChApiIrr void alignIrrlichtNode (irr::scene::ISceneNode *mnode, const ChCoordsys<> &mcoords)
 Align an Irrlicht object to a the specified coordinate system.
 
ChApiIrr void drawChFunction (ChVisualSystemIrrlicht *vis, std::shared_ptr< 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, ChColor col=ChColor(1, 0, 0), const char *title=0)
 

Function Documentation

◆ drawAllContactPoints()

ChApiIrr int chrono::irrlicht::tools::drawAllContactPoints ( ChVisualSystemIrrlicht vis,
double  mlen = 1.0,
ContactsDrawMode  drawtype = ContactsDrawMode::CONTACT_NORMALS 
)

Draw contact points used by a ChSystem in the current Irrlicht viewer.

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

◆ drawArrow()

ChApiIrr void chrono::irrlicht::tools::drawArrow ( ChVisualSystemIrrlicht vis,
ChVector3d  start,
ChVector3d  end,
ChVector3d  plane_normal,
bool  sharp,
ChColor  col,
bool  use_Zbuffer 
)

Draw a line arrow in 3D space with given color.

Parameters
visvisual system
startarrow start point
endarrow end point
plane_normalnormal to plane containing arrow segments
sharpset arrow shape as 'sharp' or 'wide'
colcolor
use_Zbufferuse Z buffer

◆ drawCircle()

ChApiIrr void chrono::irrlicht::tools::drawCircle ( ChVisualSystemIrrlicht vis,
double  radius,
ChCoordsys<>  pos = CSYSNORM,
ChColor  col = ChColor(1, 1, 1),
int  resolution = 36,
bool  use_Zbuffer = false 
)

Draw a circle line in 3D space with given color.

The circle is centered in the X-Y plane of the provided coordinate system.

◆ drawSpring()

ChApiIrr void chrono::irrlicht::tools::drawSpring ( ChVisualSystemIrrlicht vis,
double  radius,
ChVector3d  start,
ChVector3d  end,
ChColor  col = ChColor(1, 1, 1),
int  resolution = 65,
double  turns = 5,
bool  use_Zbuffer = false 
)

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.