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

Prefab parameters for a rigid actor. More...

#include <mochi_prefab.h>

Inheritance diagram for superdex::prefab::RigidActorPrefab:
superdex::RigidActorParams

Public Attributes

std::optional< DynamicStringcomment = std::nullopt
 Optional serialized comment.
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.
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).
Public Attributes inherited from superdex::RigidActorParams
std::optional< Real3angularVelocity
 Optional initial angular velocity in world frame [rad/s], zero otherwise.
ActorBoundaryElementType boundaryElementType = ActorBoundaryElementType::Default
 Finite element type for boundary discretization.
std::optional< BoundarySubsamplingParamsboundarySubsampling
 Optional subsampling for boundary integrals such as contact.
std::optional< Real3centerOfMass
 Position [m] of the center of mass in the actor's local frame.
ColliderType colliderType = ColliderType::Auto
 Collision detection geometry.
ContactParams contact
 Contact mechanics parameters.
std::optional< realdensity
 Uniform density [kg/m³] of the actor.
bool hasGravity = true
 If true, actor is affected by gravity.
bool isStatic = false
 If true, actor will be static (fixed in space).
DynamicString layer
 Contact layer name for filtering contacts between actors.
std::optional< Real3linearVelocity
 Optional initial linear velocity of the center of mass in world frame [m/s], zero otherwise.
std::optional< realmass
 Total mass [kg] of the actor.
std::optional< Real6momentOfInertia
 Moment of inertia tensor [kg·m²] at the center of mass in the actor's local frame.
DynamicString name
 Optional actor name.
GridSdfParams sdf
 Parameters used to construct a grid-based Signed Distance Field (SDF) if the shape doesn't already have one.
ShapeHandle shape
 Shape handle defining the actor's geometry and other metadata.
TransformRT worldFromLocal
 Initial rotation and translation of the actor's local frame with respect to world frame.

Additional Inherited Members

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

Detailed Description

Prefab parameters for a rigid actor.

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

Note
The inherited RigidActorParams::name field need not be unique, but a name shared by more than one actor cannot be referenced by a constraint, pose controller, or contact filter.

Definition at line 72 of file mochi_prefab.h.

Member Data Documentation

◆ comment

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

Optional serialized comment.

Definition at line 73 of file mochi_prefab.h.

◆ renderModelFile

DynamicString superdex::prefab::RigidActorPrefab::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 80 of file mochi_prefab.h.

◆ renderModelRotation

Quaternion superdex::prefab::RigidActorPrefab::renderModelRotation

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

Note
Ignored if renderModelFile is empty.

Definition at line 82 of file mochi_prefab.h.

◆ renderModelScale

Real3 superdex::prefab::RigidActorPrefab::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 81 of file mochi_prefab.h.

◆ renderModelTranslation

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

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

Note
Ignored if renderModelFile is empty.

Definition at line 83 of file mochi_prefab.h.

◆ rotation

Quaternion superdex::prefab::RigidActorPrefab::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.

Definition at line 78 of file mochi_prefab.h.

◆ scale

Real3 superdex::prefab::RigidActorPrefab::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 scale mirrors the shape.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected when the shape is loaded.
Precomputed grid SDF data is preserved only when scale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider is used, SuperDex Physics regenerates the SDF from the transformed mesh at runtime, which may be expensive.

Definition at line 75 of file mochi_prefab.h.

◆ shapeFile

DynamicString superdex::prefab::RigidActorPrefab::shapeFile {}

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

Definition at line 74 of file mochi_prefab.h.

◆ shapeRotation

Quaternion superdex::prefab::RigidActorPrefab::shapeRotation {}

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

Definition at line 76 of file mochi_prefab.h.

◆ shapeTranslation

Real3 superdex::prefab::RigidActorPrefab::shapeTranslation {}

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

Definition at line 77 of file mochi_prefab.h.

◆ translation

Real3 superdex::prefab::RigidActorPrefab::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.

Definition at line 79 of file mochi_prefab.h.


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