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

Prefab parameters for a rod actor. More...

#include <mochi_prefab.h>

Inheritance diagram for superdex::prefab::RodActorPrefab:
superdex::RodActorParams

Public Member Functions

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

Public Attributes

std::optional< DynamicString > comment = std::nullopt
 Optional serialized comment.
std::optional< RodPose > pose = std::nullopt
 Optional initial pose.
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 polyline 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::RodActorParams
ColliderType colliderType = ColliderType::None
 Collider type.
ContactParams contact
 Contact properties for interactions with volume actors.
ActorSegmentElementType contactElementType = ActorSegmentElementType::Default
 Element type controlling the number of contact samples per segment.
ActorBoundaryElementType contactSkinElementType = ActorBoundaryElementType::Default
 Triangle element type for contact-skin quadrature.
bool hasGravity = true
 Enables gravity.
DynamicString layer
 Contact layer name.
RodMaterialParams material = {}
 Rod material properties.
DynamicString name
 Actor name.
PointCloudColliderParams pointCloudCollider = {}
 Geometric and logical properties of the point-cloud collider.
ShapeHandle shape
 Shape handle defining the rod geometry.
bool useContactSkin = false
 Use the rod shape's contact skin for contact instead of its centerline.
TransformRT worldFromLocal = TransformRT::Identity()
 World-from-local transform applied to the shape.

Detailed Description

Prefab parameters for a rod actor.

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

Note
The rod is created in its rest configuration, then pose is applied if set. Use Actor::SetRecenteringParams after instantiation to change recentering.
The inherited RodActorParams::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 141 of file mochi_prefab.h.

Member Function Documentation

◆ operator==()

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

Member Data Documentation

◆ comment

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

Optional serialized comment.

Definition at line 142 of file mochi_prefab.h.

◆ pose

std::optional<RodPose> superdex::prefab::RodActorPrefab::pose = std::nullopt

Optional initial pose.

Applied right after the actor is created, see Actor::SetRodPose.

Definition at line 153 of file mochi_prefab.h.

◆ renderModelFile

DynamicString superdex::prefab::RodActorPrefab::renderModelFile

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

.glb) for visualization.

Note
Reserved visualization metadata. SuperDex Physics does not use it for simulation. Ignored if empty.

Definition at line 149 of file mochi_prefab.h.

◆ renderModelRotation

Quaternion superdex::prefab::RodActorPrefab::renderModelRotation

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

Note
Ignored if renderModelFile is empty.

Definition at line 151 of file mochi_prefab.h.

◆ renderModelScale

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

◆ renderModelTranslation

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

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

Note
Ignored if renderModelFile is empty.

Definition at line 152 of file mochi_prefab.h.

◆ rotation

Quaternion superdex::prefab::RodActorPrefab::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 147 of file mochi_prefab.h.

◆ scale

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

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

Applies to the rod geometry: node positions, element frame axes (transformed by the inverse transpose and renormalized), and the visual and contact-skin meshes. Also applies to PointCloudColliderParams::radius, which is authored for the unscaled shape and is multiplied by the absolute value of the uniform scale. Does not apply to RodActorParams::material, RodActorParams::contact, or the other RodActorParams::pointCloudCollider parameters.

Note
All components must be non-zero and finite. Negative components mirror the corresponding model-space axes.
Must be uniform by absolute value when the rod has a point-cloud collider (see RodActorParams::colliderType).
See also
PrefabParams::scale

Definition at line 144 of file mochi_prefab.h.

◆ shapeFile

DynamicString superdex::prefab::RodActorPrefab::shapeFile {}

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

Definition at line 143 of file mochi_prefab.h.

◆ shapeRotation

Quaternion superdex::prefab::RodActorPrefab::shapeRotation {}

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

Definition at line 145 of file mochi_prefab.h.

◆ shapeTranslation

Real3 superdex::prefab::RodActorPrefab::shapeTranslation {}

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

Definition at line 146 of file mochi_prefab.h.

◆ translation

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


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