SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::prefab::SoftActorPrefab Struct Reference

Prefab parameters for a soft actor. More...

#include <mochi_prefab.h>

Inheritance diagram for superdex::prefab::SoftActorPrefab:
superdex::SoftActorParams

Public Member Functions

bool operator== (SoftActorPrefab const &) const =default
Public Member Functions inherited from superdex::SoftActorParams
bool operator== (SoftActorParams const &) const =default

Public Attributes

ColliderType colliderType = ColliderType::None
 [Experimental] Collision detection geometry.
std::optional< DynamicString > comment = std::nullopt
 Optional serialized comment.
ShapeHandle flow
 [Experimental] Optional deep flow shape handle loaded from flowFile.
DynamicString flowFile {}
 [Experimental] Optional path to a deep flow shape handle for collision detection.
std::optional< DynamicArray< real > > nodeDisplacements
 Optional initial nodal displacements in model space, flattened as [x0, y0, z0, x1, y1, z1, ...].
DynamicString renderModelFile
 Optional path to a render model file (e.g.
Quaternion renderModelRotation
 Rotation quaternion [x, y, z, w] to apply to the render model.
Real3 renderModelScale = {1_r, 1_r, 1_r}
 Scale [x, y, z] to apply to the render model.
Real3 renderModelTranslation = {}
 Translation [x, y, z] to apply to the render model.
Quaternion rotation {}
 Actor rotation quaternion [x, y, z, w] relative to the prefab's local frame (i.e., the prefab-from-local rotation).
Real3 scale {1_r, 1_r, 1_r}
 Scale [x, y, z] to bake into the shape file.
GridSdfParams sdf
 [Experimental] Parameters used to construct a grid-based Signed Distance Field (SDF) from the shape's surface mesh.
DynamicString shapeFile {}
 Path to a model file that will be loaded and referenced via ShapeHandle.
Quaternion shapeRotation {}
 Rotation quaternion [x, y, z, w] to bake into the shape file.
Real3 shapeTranslation {}
 Translation [x, y, z] to bake into the shape file.
Real3 translation {}
 Actor translation [x, y, z] relative to the prefab's local frame (i.e., the prefab-from-local translation).
bool useRecentering = true
 [Experimental] Enable automatic recentering of the local coordinate system.
Public Attributes inherited from superdex::SoftActorParams
ActorBoundaryElementType boundaryElementType = ActorBoundaryElementType::Default
 Finite element type for contact discretization.
ContactParams contact
 Contact mechanics parameters.
bool hasGravity = true
 If true, actor is affected by gravity.
bool hasInertia = true
 If true, actor is affected by inertial forces.
bool hasStress = true
 If true, actor is affected by internal stress/strain forces.
DynamicString layer
 Contact layer name for filtering contacts between actors.
SoftMaterialParams material = {}
 Uniform material properties.
DynamicString name
 Optional actor name.
ShapeHandle shape
 Shape handle defining the actor's geometry and other metadata.
bool useContactSkin = false
 [Experimental] Use the shape's authored contact skin for colliding contact samples.
TransformRT worldFromLocal
 Initial rotation and translation of the actor's local frame with respect to world frame.

Detailed Description

Prefab parameters for a soft actor.

Extends SoftActorParams. The inherited SoftActorParams::worldFromLocal is replaced by the prefab-relative rotation and translation fields, and the inherited SoftActorParams::shape (a runtime ShapeHandle) is replaced by shapeFile (a path serialized to JSON. The shape is loaded at instantiation time).

Note
When used as a standalone soft actor prefab, the inherited SoftActorParams::name field need not be unique, but a name shared by more than one actor cannot be used by name-based prefab references.

Definition at line 108 of file mochi_prefab.h.

Member Function Documentation

◆ operator==()

bool superdex::prefab::SoftActorPrefab::operator== ( SoftActorPrefab const & ) const
default

Member Data Documentation

◆ colliderType

ColliderType superdex::prefab::SoftActorPrefab::colliderType = ColliderType::None

[Experimental] Collision detection geometry.

Note
Determines how OTHER actors detect contact with this actor. It does not affect how this actor detects contact with other actors.
Warning
This is an experimental feature. It may be changed or removed in the future. Use at your own risk.

Definition at line 111 of file mochi_prefab.h.

◆ comment

std::optional<DynamicString> superdex::prefab::SoftActorPrefab::comment = std::nullopt

Optional serialized comment.

Definition at line 109 of file mochi_prefab.h.

◆ flow

ShapeHandle superdex::prefab::SoftActorPrefab::flow

[Experimental] Optional deep flow shape handle loaded from flowFile.

Warning
This is an experimental feature. It may be changed or removed in the future. Use at your own risk.

Definition at line 114 of file mochi_prefab.h.

◆ flowFile

DynamicString superdex::prefab::SoftActorPrefab::flowFile {}

[Experimental] Optional path to a deep flow shape handle for collision detection.

Warning
This is an experimental feature. It may be changed or removed in the future. Use at your own risk.

Definition at line 113 of file mochi_prefab.h.

◆ nodeDisplacements

std::optional<DynamicArray<real> > superdex::prefab::SoftActorPrefab::nodeDisplacements

Optional initial nodal displacements in model space, flattened as [x0, y0, z0, x1, y1, z1, ...].

Values are expressed in the model frame of shapeFile, the same frame as its node positions. The model transform baked into the shape (scale, shapeRotation, and the effective prefab scale) is applied to the displacements too. shapeTranslation does not affect them. Displacements for a preset SoftActorParams::shape are applied unchanged, like its geometry. Applied right after the actor is created, see Actor::SetDisplacements.

Note
Ignored if unset or empty. Otherwise, must contain 3 finite values per simulation node.
For nested soft actors in SoftSkinnedActorPrefab::softParams, values are the soft displacements in the unposed (bind-pose) frame, before skinning is applied.

Definition at line 125 of file mochi_prefab.h.

◆ renderModelFile

DynamicString superdex::prefab::SoftActorPrefab::renderModelFile

Optional path to a render model file (e.g.

.glb) for visualization.

Note
SuperDex Physics does not use this field for simulation. It provides additional metadata for visualization in supported tools. Ignored if empty.

Definition at line 121 of file mochi_prefab.h.

◆ renderModelRotation

Quaternion superdex::prefab::SoftActorPrefab::renderModelRotation

Rotation quaternion [x, y, z, w] to apply to the render model.

Note
Ignored if renderModelFile is empty.

Definition at line 123 of file mochi_prefab.h.

◆ renderModelScale

Real3 superdex::prefab::SoftActorPrefab::renderModelScale = {1_r, 1_r, 1_r}

Scale [x, y, z] to apply to the render model.

Note
Ignored if renderModelFile is empty.

Definition at line 122 of file mochi_prefab.h.

◆ renderModelTranslation

Real3 superdex::prefab::SoftActorPrefab::renderModelTranslation = {}

Translation [x, y, z] to apply to the render model.

Note
Ignored if renderModelFile is empty.

Definition at line 124 of file mochi_prefab.h.

◆ rotation

Quaternion superdex::prefab::SoftActorPrefab::rotation {}

Actor rotation quaternion [x, y, z, w] relative to the prefab's local frame (i.e., the prefab-from-local rotation).

Composes with PrefabParams::rotation to produce the final world-from-local rotation.

Note
Must be finite and non-zero when used in ActorLists::soft.
Ignored when used in SoftSkinnedActorPrefab::softParams.

Definition at line 119 of file mochi_prefab.h.

◆ scale

Real3 superdex::prefab::SoftActorPrefab::scale {1_r, 1_r, 1_r}

Scale [x, y, z] to bake into the shape file.

Note
All components must be non-zero and finite. Negative components mirror the corresponding model-space axes, including nodeDisplacements.
When used in SoftSkinnedActorPrefab::softParams, all components must be equal and strictly positive.
If flowFile is set, scale must be (1, 1, 1).
Non-uniform scale is supported only for shape data that supports arbitrary per-axis bake scale. Unsupported scale values are rejected when the shape is loaded.

Definition at line 116 of file mochi_prefab.h.

◆ sdf

GridSdfParams superdex::prefab::SoftActorPrefab::sdf

[Experimental] Parameters used to construct a grid-based Signed Distance Field (SDF) from the shape's surface mesh.

Note
Ignored unless colliderType is ColliderType::Sdf or ColliderType::Auto.
The SDF is computed when the actor is created, even if the shape already has one.
Warning
This is an experimental feature. It may be changed or removed in the future. Use at your own risk.

Definition at line 112 of file mochi_prefab.h.

◆ shapeFile

DynamicString superdex::prefab::SoftActorPrefab::shapeFile {}

Path to a model file that will be loaded and referenced via ShapeHandle.

Definition at line 110 of file mochi_prefab.h.

◆ shapeRotation

Quaternion superdex::prefab::SoftActorPrefab::shapeRotation {}

Rotation quaternion [x, y, z, w] to bake into the shape file.

Definition at line 117 of file mochi_prefab.h.

◆ shapeTranslation

Real3 superdex::prefab::SoftActorPrefab::shapeTranslation {}

Translation [x, y, z] to bake into the shape file.

Definition at line 118 of file mochi_prefab.h.

◆ translation

Real3 superdex::prefab::SoftActorPrefab::translation {}

Actor translation [x, y, z] relative to the prefab's local frame (i.e., the prefab-from-local translation).

Composes with PrefabParams::scale, PrefabParams::rotation, and PrefabParams::translation to produce the final world-from-local translation.

Note
Must be finite when used in ActorLists::soft.
Ignored when used in SoftSkinnedActorPrefab::softParams.

Definition at line 120 of file mochi_prefab.h.

◆ useRecentering

bool superdex::prefab::SoftActorPrefab::useRecentering = true

[Experimental] Enable automatic recentering of the local coordinate system.

Note
Recentering updates the root transform as the actor moves, keeping local-space displacements small. This improves numerical stability for actors that move far from their initial position.
Ignored for nested soft actors in soft-skinned actors, which do not support recentering.
Warning
This is an experimental feature. It may be changed or removed in the future. Use at your own risk.

Definition at line 115 of file mochi_prefab.h.


The documentation for this struct was generated from the following files: