Parameters for instantiating a ScenePrefab into a Scene.
More...
#include <mochi_prefab.h>
Parameters for instantiating a ScenePrefab into a Scene.
Definition at line 330 of file mochi_prefab.h.
◆ applySceneSettings
| bool superdex::prefab::PrefabParams::applySceneSettings = true |
Whether to apply top-level scene settings.
When true, AddToScene applies gravity and solver overrides from the SceneParams of the top-level prefab. Omitted overrides preserve existing scene values. When false, neither override is applied. Scene settings from nested prefabs are always ignored.
Definition at line 335 of file mochi_prefab.h.
◆ name
Optional name prefix for created actors.
Actor names are formatted based on their hierarchy paths. If this string is not empty, it will be used as the first token in the path ("prefabName/actorName", "prefabName/nestedPrefabName/actorName", etc.)
Definition at line 331 of file mochi_prefab.h.
◆ rotation
| Quaternion superdex::prefab::PrefabParams::rotation {} |
Rotation quaternion [x, y, z, w] of the new prefab in world-space.
- Note
- Must be finite and non-zero.
Definition at line 333 of file mochi_prefab.h.
◆ scale
| real superdex::prefab::PrefabParams::scale = 1_r |
Uniform scale of the new prefab in world-space.
Composes multiplicatively with any nested PrefabReference::scale and any per-actor scale (e.g. ArticulatedActorPrefab::scale) to give the cumulative "effective scale" baked into each actor when the prefab is instantiated.
The effective scale is applied to:
- Mesh geometry (link / actor shapes are loaded at the cumulative scale)
- Joint and link translations, cycle joint anchors
- Prismatic joint position limits (Real3, in meters)
- Constraint geometric target and limit distances [m], including rigid prismatic joint limits, world-space position targets, rigid actor-local pivot/joint positions in RigidPivotPositionConstraintPrefab, RigidPivotToRigidTargetConstraintPrefab, and RigidSphericalJointConstraintPrefab; the rigid-local attachment/search point in DeformableNodeToRigidConstraintPrefab; and translational single-DoF target/range values in ArticulatedSingleDofTargetConstraintPrefab and ArticulatedSingleDofRangeConstraintPrefab. Actor-local constraint distances use the referenced actor's prefab metric scale, so standalone rigid/soft shape-bake scale fields are not applied again.
- User-supplied inertia overrides on rigid and articulated link actors: center of mass scales componentwise by the signed effective scale, mass scales by the absolute effective volume scale, moment of inertia uses the corresponding diagonal inertia transform. For a purely uniform effective scale s, this reduces to:
centerOfMass *= s
mass *= s^3
momentOfInertia *= s^5
The mass and moment of inertia formulas preserve the user's authored density.
The effective scale is NOT applied to:
- density (intrinsic material property; mass/density are mutually exclusive in the prefab API, so no double-application)
- linearVelocity / angularVelocity / jointVelocities
- Constraint stiffness/damping coefficients and saturation thresholds inherited from ConstraintParams. These parameters define the constraint's response, not just geometry: different goals (preserving material behavior, damping ratio, actuator limits, or closed-loop response) imply different scale laws, so prefab scaling preserves authored values.
- Joint inertia, friction, limit stiffness/damping, cycle joint stiffness (characterized actuator / tuned-penalty parameters; bring your own actuator model when scaling a robot)
- Revolute and spherical joint angular limits, rotation-valued targets and ranges in Articulated3dRotationTargetConstraintPrefab and Articulated3dRotationRangeConstraintPrefab, and rotational single-DoF target/range values in ArticulatedSingleDofTargetConstraintPrefab and ArticulatedSingleDofRangeConstraintPrefab (scale invariant)
- Note
- Must be strictly positive and finite. Negative or zero scale is invalid and rejected at AddToScene. The ScenePrefab overload additionally requires scale == 1; use the file-path AddToScene overload, nested PrefabReference::scale, or per-actor scale for non-identity scaling.
-
Authoring with RigidActorParams::mass = M is equivalent to authoring with the implied density M / V_unit; under prefab scale the density is preserved and mass scales with the absolute volume scale, so the result is "the same material at a bigger size." For a purely uniform effective scale s, this mass factor is s^3. If you need a fixed mass that does NOT scale with the prefab, set the mass at runtime via Actor::SetDensity after the actor is instantiated.
Definition at line 332 of file mochi_prefab.h.
◆ translation
| Real3 superdex::prefab::PrefabParams::translation {} |
Translation (position) of the new prefab in world-space.
- Note
- Must be finite.
Definition at line 334 of file mochi_prefab.h.
The documentation for this struct was generated from the following files: