Assets represent optional objects that can be attached to rigid bodies to provide access to information/data such as:
- Visualization shapes
- Custom user-defined data such as electric charge, costs, sounds, etc.
ChAsset
The ChAsset class is the base class for all types of assets. See chrono::ChAsset for API details.
Example: a custom-defined asset is introduced below to illustrate a case in which a user attaches 'electrical charge' to a rigid body.
Example: selecting all the assets of a certain type.
Visualization shapes
There are many ready-to-use assets that define visualization shapes. Note that multiple visualization shapes can be attached to one body.
Chrono is rendering engine agnostic. Indeed, if the IRRLICHT module is used, it is up to the Irrlicht module to convert the visualization assets into something that can be rendered in the OpenGL view of Irrlicht. Likewise, if the POSTPROCESS module is used instead, this unit is expected to convert the visualization assets into scripts with shapes for the POVray or some other rendering tool.
Visualization assets are inherited from a base class called ChVisualization. See chrono::ChVisualization for API details.
Each shape has a translation and a rotation defined with respect to the REF reference of the owner body. Note that this is not the COG frame, as shown in the figure below.
Examples of visualization assets:
- chrono::ChSphereShape
- chrono::ChBoxShape
- chrono::ChCylinderShape
- chrono::ChEllipsoidShape
- chrono::ChConeShape
- chrono::ChCapsuleShape
A special type of visualization asset is the chrono::ChAssetLevel. An object of this type does not represent a shape. Rather, it can contain other visualization assets as a group. This allows the creation of hierarchical models. When rotating or translating a ChAssetLevel object, all the shapes associated with that object are moved/rotated.
Other special assets are:
They affect all the assets belonging to the same level by coloring/texturing them.
Example.
Examples
See also: