46 this->mesh.emplace(MeshDataView{*src.mesh});
49 this->visualMesh.emplace(MeshDataView{*src.visualMesh});
52 DynamicArray<BlendingDataView> blendingDataViewArray;
53 blendingDataViewArray.reserve(src.blending->size());
54 for (auto const& blendingData : *src.blending) {
55 blendingDataViewArray.emplace_back(BlendingDataView{blendingData});
57 this->blending.emplace(std::move(blendingDataViewArray));
59 if (src.constrainedNodes) {
60 this->constrainedNodes.emplace(Span<int const>{*src.constrainedNodes});
62 if (src.elementFrameAxes) {
63 this->elementFrameAxes.emplace(Span<real const>{*src.elementFrameAxes});
66 this->sdf.emplace(GridSdfDataView{*src.sdf});
69 this->material.emplace(PerElementSoftMaterialDataView{*src.material});
79 this->mesh.emplace(MeshData{*src.mesh});
82 this->visualMesh.emplace(MeshData{*src.visualMesh});
85 DynamicArray<BlendingData> blendingDataArray;
86 blendingDataArray.reserve(src.blending->size());
87 for (auto const& blendingData : *src.blending) {
88 blendingDataArray.emplace_back(BlendingData{blendingData});
90 this->blending.emplace(std::move(blendingDataArray));
92 if (src.constrainedNodes) {
93 this->constrainedNodes.emplace(DynamicArray<int>{*src.constrainedNodes});
95 if (src.elementFrameAxes) {
96 this->elementFrameAxes.emplace(DynamicArray<real>{*src.elementFrameAxes});
auto MakeConstSpan(ContainerT const &container)
A non-owning view of precomputed grid-based signed-distance-field data.
Aabb negativeValueBounds
Spatial bounds of the portion of the SDF grid with negative values.
Aabb bounds
Spatial bounds of the SDF grid.
std::optional< Real3 > translation
Optional parent-from-grid translation [m] to apply at runtime.
Span< real const > values
Signed distance values [m].
std::optional< Quaternion > rotation
Optional parent-from-grid rotation to apply at runtime.
std::optional< Real3 > scale
Optional parent-from-grid per-axis scale to apply at runtime.
GridSdfDataView()=default
Int3 dims
Dimensions of the SDF grid in X, Y, and Z.
Data for a pre-computed SDF grid.
DynamicArray< real > values
Signed distance values [m].
Aabb bounds
Spatial bounds of the SDF grid.
std::optional< Quaternion > rotation
Optional parent-from-grid rotation to apply at runtime.
Aabb negativeValueBounds
Spatial bounds of the portion of the SDF grid with negative values.
Int3 dims
Dimensions of the SDF grid in X, Y, and Z.
std::optional< Real3 > translation
Optional parent-from-grid translation [m] to apply at runtime.
std::optional< Real3 > scale
Optional parent-from-grid per-axis scale to apply at runtime.
A non-owning view of the contents of a Mochi model file.
std::optional< MeshDataView > mesh
std::optional< Sphere > sphere
std::optional< Plane > plane
bool experimentalDataDetected
True if the loaded model contains unsupported experimental data.
The contents of a Mochi model file.
std::optional< Sphere > sphere
bool experimentalDataDetected
True if the loaded model contains unsupported experimental data.
std::optional< MeshData > mesh
std::optional< Plane > plane
Per-element material parameters for a soft body in struct-of-arrays format.