Description
Translate a Chrono system's visual shapes into a MetalRenderScene.
Split into a full build and a per-frame refresh because the two have very different costs. Build reads meshes from disk, resolves textures and populates the geometry cache; Refresh only recomputes instance transforms and re-extracts the meshes that deform. A simulation calls Build once and Refresh every frame.
#include <ChMetalSceneBuilder.h>
Public Member Functions | |
| ChMetalSceneBuilder (ChSystem *sys) | |
| bool | TopologyChanged () const |
| Whether the number of visual shapes has changed since the last build. More... | |
| void | Build (MetalRenderScene &scene) |
| Populate the scene's geometries, instances and texture paths from the Chrono system. More... | |
| void | Refresh (MetalRenderScene &scene) |
| Recompute instance world transforms from the current body poses, and re-extract any deforming geometry in place. More... | |
Member Function Documentation
◆ Build()
| void chrono::sensor::ChMetalSceneBuilder::Build | ( | MetalRenderScene & | scene | ) |
Populate the scene's geometries, instances and texture paths from the Chrono system.
Also records, per instance, how to update it later, which is what makes Refresh cheap.
◆ Refresh()
| void chrono::sensor::ChMetalSceneBuilder::Refresh | ( | MetalRenderScene & | scene | ) |
Recompute instance world transforms from the current body poses, and re-extract any deforming geometry in place.
Cheap enough to call every frame.
◆ TopologyChanged()
| bool chrono::sensor::ChMetalSceneBuilder::TopologyChanged | ( | ) | const |
Whether the number of visual shapes has changed since the last build.
True when bodies or shapes were added or removed, which is the case Refresh cannot absorb: the instance list itself is a different length, so the scene needs rebuilding.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono_sensor/metal/ChMetalSceneBuilder.h
- /builds/uwsbel/chrono/src/chrono_sensor/metal/ChMetalSceneBuilder.cpp