SuperDex Physics C++ API
Loading...
Searching...
No Matches
mochi_prefab.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Documentation for all public types and functions in this file lives:
18// mochi_physics/mochi_physics_prefab.mochi_gen
19
20#pragma once
21
23
27
29
30#include <optional>
31#include <string_view>
32
34
35/***********************************************************************************************
36 Prefab Types:
37*/
38
40 std::optional<DynamicString> comment = std::nullopt;
42 std::optional<Real3> gravity = std::nullopt;
43 std::optional<SolverParams> solver = std::nullopt;
44
45#if MOCHI_LANGUAGE_CPP20
46 bool operator==(SceneParams const&) const = default;
47#endif
48};
49
51 bool enable = true;
54
55#if MOCHI_LANGUAGE_CPP20
56 bool operator==(ActorContactEntry const&) const = default;
57#endif
58};
59
61 bool enable = true;
63
64#if MOCHI_LANGUAGE_CPP20
65 bool operator==(LayerContactEntry const&) const = default;
66#endif
67};
68
70 std::optional<DynamicString> comment = std::nullopt;
71 std::optional<DynamicArray<ActorContactEntry>> actorContactAsymmetric{};
72 std::optional<DynamicArray<ActorContactEntry>> actorContactSymmetric{};
73 std::optional<DynamicArray<LayerContactEntry>> layerContactAsymmetric{};
74 std::optional<DynamicArray<LayerContactEntry>> layerContactSymmetric{};
75
76#if MOCHI_LANGUAGE_CPP20
77 bool operator==(ContactFilter const&) const = default;
78#endif
79};
80
89
91 std::optional<DynamicString> comment = std::nullopt;
93 Real3 scale{1_r, 1_r, 1_r};
99 Real3 renderModelScale = {1_r, 1_r, 1_r};
102
103#if MOCHI_LANGUAGE_CPP20
104 bool operator==(RigidActorPrefab const&) const = default;
105#endif
106};
107
131
132struct RodPose {
135
136#if MOCHI_LANGUAGE_CPP20
137 bool operator==(RodPose const&) const = default;
138#endif
139};
140
142 std::optional<DynamicString> comment = std::nullopt;
144 Real3 scale{1_r, 1_r, 1_r};
150 Real3 renderModelScale = {1_r, 1_r, 1_r};
153 std::optional<RodPose> pose = std::nullopt;
154
155#if MOCHI_LANGUAGE_CPP20
156 bool operator==(RodActorPrefab const&) const = default;
157#endif
158};
159
161#if MOCHI_LANGUAGE_CPP20
162 bool operator==(ArticulatedJointPrefab const&) const = default;
163#endif
164};
165
180
183
184 // TODO[T265138451]: Add support for baked-in transform
185 // Real3 shapeScale = {1_r, 1_r, 1_r};
186 // Quaternion shapeRotation;
187 // Real3 shapeTranslation = {};
188
190 Real3 renderModelScale = {1_r, 1_r, 1_r};
193 std::optional<DynamicArray<DynamicString>> hiddenLinks;
194
195#if MOCHI_LANGUAGE_CPP20
196 bool operator==(ArticulatedSkinPrefab const&) const = default;
197#endif
198};
199
201 std::optional<DynamicString> comment = std::nullopt;
203 real scale = 1_r;
209 std::optional<ArticulatedSkinPrefab> skin;
210 std::optional<DynamicArray<real>> jointVelocities;
211 std::optional<DynamicArray<real>> jointPose;
212
213#if MOCHI_LANGUAGE_CPP20
214 bool operator==(ArticulatedActorPrefab const&) const = default;
215#endif
216};
217
219 std::optional<DynamicString> comment = std::nullopt;
224 bool hasGravity = false;
225 bool hasInertia = false;
226 bool hasStress = false;
227
228#if MOCHI_LANGUAGE_CPP20
229 bool operator==(SoftSkinnedActorPrefab const&) const = default;
230#endif
231};
232
245
254
263
273
282
291
294
295#if MOCHI_LANGUAGE_CPP20
296 bool operator==(RigidPivotPositionConstraintPrefab const&) const = default;
297#endif
298};
299
307
310
311#if MOCHI_LANGUAGE_CPP20
312 bool operator==(RigidPivotRotationConstraintPrefab const&) const = default;
313#endif
314};
315
323
332
341
350
359
368
371
372#if MOCHI_LANGUAGE_CPP20
373 bool operator==(RodElementRotationConstraintPrefab const&) const = default;
374#endif
375};
376
386
387/////////////////
388
390 std::optional<DynamicString> comment = std::nullopt;
407
408#if MOCHI_LANGUAGE_CPP20
409 bool operator==(ConstraintLists const&) const = default;
410#endif
411};
412
424
425struct ScenePrefab;
426
428 std::optional<DynamicString> comment = std::nullopt;
431 real scale = 1_r;
434
435 // Loaded prefab. Runtime state, not serialized.
437
438#if MOCHI_LANGUAGE_CPP20
439 bool operator==(PrefabReference const&) const = default;
440#endif
441};
442
444 std::optional<DynamicString> comment = std::nullopt;
449 std::optional<SceneParams> scene = std::nullopt;
450 std::optional<DynamicString> sourceFilePath = std::nullopt;
451 std::optional<ContactFilter> contactFilter = std::nullopt;
452 std::optional<DynamicArray<ContactPairParamsOverrideEntry>> contactPairParamsOverrides =
453 std::nullopt;
454
455#if MOCHI_LANGUAGE_CPP20
456 bool operator==(ScenePrefab const&) const = default;
457#endif
458};
459
460/***********************************************************************************************
461 Prefab Serialization:
462*/
463
465 std::string_view prefabPath,
466 std::string_view rootPath,
467 Context* context,
468 Error& error);
469
471 std::string_view json,
472 std::string_view rootPath,
473 Context* context,
474 Error& error);
475
476MOCHI_API void SaveToJsonFile(ScenePrefab const& prefab, std::string_view path, Error& error);
477
479
480/***********************************************************************************************
481 Prefab Instantiation:
482*/
483
491
499
501AddToScene(ScenePrefab const& prefab, Scene* scene, PrefabParams const& params, Error& error);
502
504
506 std::string_view prefabPath,
507 std::string_view rootPath,
508 Scene* scene,
509 PrefabParams const& params,
510 Error& error);
511
513AddToScene(std::string_view prefabPath, std::string_view rootPath, Scene* scene, Error& error);
514
515/***********************************************************************************************
516 Prefab Utilities:
517*/
518
520 std::string_view inputPath,
521 std::string_view rootForRelativePath,
522 std::string_view prefabFilePath);
523
524MOCHI_API void
526
527MOCHI_API ScenePrefab ShallowLoadFromFile(std::string_view path, Error& error);
528
530
531MOCHI_API void LoadNestedPrefabs(ScenePrefab& prefab, std::string_view rootPath, Error& error);
532
533MOCHI_API void
534LoadShapes(ScenePrefab& prefab, std::string_view rootPath, Context* context, Error& error);
535
536MOCHI_API void
537EnsureFullyLoaded(ScenePrefab& prefab, std::string_view rootPath, Context* context, Error& error);
538
543
545 Scene const* scene,
546 std::string_view exportName,
547 std::string_view outputDir,
548 ExportParams const& params,
549 Error& error);
550
552 Scene const* scene,
553 std::string_view exportName,
554 std::string_view outputDir,
555 Error& error);
556
558 Actor const* actor,
559 std::string_view exportName,
560 std::string_view outputDir,
561 ExportParams const& params,
562 Error& error);
563
565 Actor const* actor,
566 std::string_view exportName,
567 std::string_view outputDir,
568 Error& error);
569
570} // namespace superdex::prefab
571
573
574#if MOCHI_USE_REFLECTION
576#endif
Represents a simulated body (actor) in a scene.
Definition mochi_actor.h:49
Main entry point for SuperDex Physics simulation.
A dynamically resizable array with syntax and behavior similar to std::pmr::vector.
Represents a simulation scene.
Definition mochi_scene.h:45
#define MOCHI_API
void ScaleArticulatedActorParams(ArticulatedActorParams &params, real scale, Error &error)
Uniformly scale the geometry of articulated actor params in place, as instantiating an ArticulatedAct...
void LoadNestedPrefabs(ScenePrefab &prefab, std::string_view rootPath, Error &error)
Load nested prefab files recursively.
AddToSceneResult AddToScene(ScenePrefab const &prefab, Scene *scene, PrefabParams const &params, Error &error)
Instantiate a ScenePrefab and add it to a Scene.
DynamicString SaveToJsonString(ScenePrefab const &prefab, Error &error)
Serialize a ScenePrefab to a JSON string.
ScenePrefab ShallowLoadFromJsonString(std::string_view json, Error &error)
Deserialize a single ScenePrefab from a JSON string, without loading any nested files.
DynamicString GetPrefabFullPath(std::string_view inputPath, std::string_view rootForRelativePath, std::string_view prefabFilePath)
Resolve a path referenced inside a prefab to a full path.
void LoadShapes(ScenePrefab &prefab, std::string_view rootPath, Context *context, Error &error)
Load shape files referenced by prefab and its loaded nested prefabs.
void SaveToJsonFile(ScenePrefab const &prefab, std::string_view path, Error &error)
Serialize a ScenePrefab to a JSON file.
ScenePrefab ShallowLoadFromFile(std::string_view path, Error &error)
Deserialize a single ScenePrefab from a file, without loading any nested files.
ScenePrefab LoadFromFile(std::string_view prefabPath, std::string_view rootPath, Context *context, Error &error)
Fully load a ScenePrefab from a file, including all nested prefabs and shapes.
ScenePrefab LoadFromJsonString(std::string_view json, std::string_view rootPath, Context *context, Error &error)
Fully load a ScenePrefab from a JSON string, including all nested prefabs and shapes.
void ExportActor(Actor const *actor, std::string_view exportName, std::string_view outputDir, ExportParams const &params, Error &error)
Export a single actor to a prefab file under outputDir/exportName/<exportName>.mochi_scene.
void ExportScene(Scene const *scene, std::string_view exportName, std::string_view outputDir, ExportParams const &params, Error &error)
Export a Scene to a folder containing a prefab file and all generated mesh files.
void EnsureFullyLoaded(ScenePrefab &prefab, std::string_view rootPath, Context *context, Error &error)
Ensure that all nested prefabs and shape files are loaded, skipping any that are already loaded.
NdArray< real, 3 > Real3
Definition nd_array.h:115
ConstraintType
Type of constraint acting on actors' degrees of freedom.
Definition mochi_enums.h:79
ColliderType
Collision detection geometry for an Actor.
@ None
No collision representation.
std::basic_string< char, std::char_traits< char >, StlAllocator< char > > DynamicString
Alias for std::string using a polymorphic superdex::Allocator pointer.
ActorType
Type of actor.
Definition mochi_enums.h:25
Parameters for creating a range constraint on a 3D-rotation articulated joint.
Parameters for creating a target constraint on 3D rotation DoFs of an articulated actor.
Parameters to create an articulated actor.
Parameters describing a single joint within an articulated actor.
Parameters describing a single rigid link within an articulated actor.
Parameters for creating a range constraint on a single articulated DoF.
Parameters for creating a target constraint on a single articulated DoF.
Optional skinned mesh attached to an articulated actor for collision and rendering.
Optional contact-response parameter replacements for an unordered actor pair.
Parameters for creating a position constraint on a deformable actor node.
Parameters for creating a constraint coupling a node in a deformable actor to a node in another defor...
Parameters for creating a constraint coupling a deformable node to a rigid actor.
Parameters controlling the resolution of grid-based Signed Distance Fields (SDF).
Parameters for creating a joint rotation range constraint between two rigid actors.
Parameters for creating a joint rotation tracking constraint between two rigid actors.
Runtime handle to a loaded nested prefab (the resolved target of a prefab::PrefabReference).
Parameters to create a rigid body actor.
Parameters for creating a position constraint on a rigid actor's pivot point.
Parameters for creating a rotation constraint on a rigid actor's pivot frame.
Parameters for creating a constraint on a rigid actor's pivot point.
Parameters for creating a prismatic joint between two rigid actors.
Parameters for creating a spherical joint between two rigid actors.
Parameters to create a rod actor.
Parameters for creating a tracking constraint on the world rotation of a rod element.
Parameters for creating a tracking constraint on the relative rotation between a rigid actor and a ro...
Handle to a shape (mesh, sphere, plane, etc.) within a Context.
Parameters to create a soft deformable actor.
Used by ContactFilter to enable or disable contact for a pair of actors.
bool enable
Enable (true) or disable (false) contact for the specified pair of actors.
DynamicArray< DynamicString > actors
Identifies two actors by name or hierarchy path.
bool includeNestedActors
Whether expandable parent actor names should include nested actors.
bool operator==(ActorContactEntry const &) const =default
Lists of actors grouped by type.
DynamicArray< RodActorPrefab > rod
Rod actors.
DynamicArray< ArticulatedActorPrefab > articulated
Articulated actors.
std::optional< DynamicString > comment
Optional serialized comment.
bool operator==(ActorLists const &) const =default
DynamicArray< RigidActorPrefab > rigid
Rigid actors.
DynamicArray< SoftActorPrefab > soft
Soft actors.
DynamicArray< SoftSkinnedActorPrefab > softSkinned
Soft-skinned actors.
Struct used to return all created actors and constraints from AddToScene.
DynamicArray< Actor * > Filter(ActorType type) const
Return all the newly created actors of a particular type, in order.
DynamicArray< Constraint * > constraints
All newly created constraints.
DynamicArray< Constraint * > Filter(ConstraintType type) const
Return all the newly created constraints of a particular type, in order.
DynamicArray< Actor * > actors
All newly created actors.
Prefab parameters for a Articulated3dRotationRangeConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the articulated actor.
bool operator==(Articulated3dRotationRangeConstraintPrefab const &) const =default
Prefab parameters for a Articulated3dRotationTargetConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the articulated actor.
bool operator==(Articulated3dRotationTargetConstraintPrefab const &) const =default
Prefab parameters for an articulated actor.
real scale
Uniform scale baked into all link and skin shapes when the prefab is instantiated.
bool operator==(ArticulatedActorPrefab const &) const =default
DynamicArray< ArticulatedLinkPrefab > links
Link parameters (one per link).
DynamicString name
Optional actor name.
std::optional< DynamicString > comment
Optional serialized comment.
Real3 translation
Actor translation [x, y, z] relative to the prefab's local frame (i.e., the prefab-from-root translat...
DynamicArray< ArticulatedJointPrefab > joints
Joint parameters (one per joint).
DynamicArray< ArticulatedCycleJointParams > cycles
Cycle joints creating closed kinematic loops.
Quaternion rotation
Actor rotation quaternion [x, y, z, w] relative to the prefab's local frame (i.e.,...
std::optional< DynamicArray< real > > jointPose
Optional initial joint pose, one value per DoF in joint order.
std::optional< DynamicArray< real > > jointVelocities
Optional initial velocity per DoF.
std::optional< ArticulatedSkinPrefab > skin
Optional skinned mesh parameters.
Joint parameters for an articulated actor prefab.
bool operator==(ArticulatedJointPrefab const &) const =default
Link parameters for an articulated actor prefab.
bool operator==(ArticulatedLinkPrefab const &) const =default
DynamicString shapeFile
Path to a simulation model file defining the geometry of the rigid link actor.
Real3 shapeScale
Scale [x, y, z] to bake into the shape file.
Real3 shapeTranslation
Translation [x, y, z] to bake into the shape file.
Quaternion renderModelRotation
Rotation quaternion [x, y, z, w] to apply to the render model.
Quaternion shapeRotation
Rotation quaternion [x, y, z, w] to bake into the shape file.
Real3 renderModelTranslation
Translation [x, y, z] to apply to the render model.
DynamicString renderModelFile
Optional path to a render model file (e.g.
Real3 renderModelScale
Scale [x, y, z] to apply to the render model.
Prefab parameters for a ArticulatedSingleDofRangeConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the articulated actor.
bool operator==(ArticulatedSingleDofRangeConstraintPrefab const &) const =default
Prefab parameters for a ArticulatedSingleDofTargetConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the articulated actor.
bool operator==(ArticulatedSingleDofTargetConstraintPrefab const &) const =default
Skin parameters for an articulated actor prefab.
Real3 renderModelScale
Scale [x, y, z] to apply to the render model.
DynamicString renderModelFile
Optional path to a render model file (e.g.
bool operator==(ArticulatedSkinPrefab const &) const =default
Quaternion renderModelRotation
Rotation quaternion [x, y, z, w] to apply to the render model.
Real3 renderModelTranslation
Translation [x, y, z] to apply to the render model.
std::optional< DynamicArray< DynamicString > > hiddenLinks
Local names of links whose render models the skin's render model stands in for.
DynamicString shapeFile
Path to the model file containing a skinned mesh.
Lists of constraints grouped by type.
DynamicArray< RigidPivotToRigidTargetConstraintPrefab > rigidPivotToRigidTarget
Position constraints attaching a rigid actor's pivot point to a rigid target.
DynamicArray< RigidPivotPositionConstraintPrefab > rigidPivotPosition
Position constraints on a rigid actor's pivot point.
bool operator==(ConstraintLists const &) const =default
DynamicArray< RigidPrismaticJointConstraintPrefab > rigidPrismaticJoint
Prismatic joint constraints between two rigid actors.
DynamicArray< Articulated3dRotationTargetConstraintPrefab > articulated3dRotationTarget
3D rotation target constraints on articulated actors.
DynamicArray< RodElementRotationToRigidConstraintPrefab > rodElementRotationToRigid
Relative-rotation tracking constraints between rod elements and rigid actors.
DynamicArray< JointRotationTrackingConstraintPrefab > jointRotationTracking
Joint rotation tracking constraints.
DynamicArray< ArticulatedSingleDofRangeConstraintPrefab > articulatedSingleDofRange
Single-DoF range constraints on articulated actors.
DynamicArray< JointRotationRangeConstraintPrefab > jointRotationRange
Joint rotation range constraints.
DynamicArray< RigidSphericalJointConstraintPrefab > rigidSphericalJoint
Spherical joint constraints between two rigid actors.
DynamicArray< Articulated3dRotationRangeConstraintPrefab > articulated3dRotationRange
3D rotation range constraints on articulated actors.
DynamicArray< ArticulatedSingleDofTargetConstraintPrefab > articulatedSingleDofTarget
Single-DoF target constraints on articulated actors.
DynamicArray< RodElementRotationConstraintPrefab > rodElementRotation
World-rotation tracking constraints on rod elements.
std::optional< DynamicString > comment
Optional serialized comment.
DynamicArray< RigidPivotRotationConstraintPrefab > rigidPivotRotation
Rotation constraints on a rigid actor's pivot frame.
DynamicArray< DeformableNodeToRigidConstraintPrefab > deformableNodeToRigid
Constraints connecting a deformable node to a rigid actor.
DynamicArray< DeformableNodeToDeformableNodeConstraintPrefab > deformableNodeToDeformableNode
Constraints connecting two deformable actor nodes.
DynamicArray< DeformableNodePositionConstraintPrefab > deformableNodePosition
Position constraints on a deformable actor node.
Contact filtering parameters for a prefab.
std::optional< DynamicArray< LayerContactEntry > > layerContactAsymmetric
Enables or disables contact asymmetrically for each ordered pair of layers.
std::optional< DynamicString > comment
Optional serialized comment.
std::optional< DynamicArray< LayerContactEntry > > layerContactSymmetric
Enables or disables contact symmetrically for each pair of layers.
std::optional< DynamicArray< ActorContactEntry > > actorContactAsymmetric
Enables or disables contact asymmetrically for each ordered pair of actors.
bool operator==(ContactFilter const &) const =default
std::optional< DynamicArray< ActorContactEntry > > actorContactSymmetric
Enables or disables contact symmetrically for each pair of actors.
Overrides selected contact parameters for an unordered actor pair.
ContactPairParamsOverride paramsOverride
Partial contact parameter override for the actor pair.
bool operator==(ContactPairParamsOverrideEntry const &) const =default
DynamicArray< DynamicString > actors
Identifies two actors by name or hierarchy path.
Prefab parameters for a DeformableNodePositionConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the deformable actor.
bool operator==(DeformableNodePositionConstraintPrefab const &) const =default
Prefab parameters for a DeformableNodeToDeformableNodeConstraintParams.
DynamicString actorNameA
Name or hierarchy path identifying deformable actor A.
DynamicString actorNameB
Name or hierarchy path identifying deformable actor B.
bool operator==(DeformableNodeToDeformableNodeConstraintPrefab const &) const =default
Prefab parameters for a DeformableNodeToRigidConstraintParams.
DynamicString rigidActorName
Name or hierarchy path identifying the rigid actor.
DynamicString deformableActorName
Name or hierarchy path identifying the deformable actor.
bool operator==(DeformableNodeToRigidConstraintPrefab const &) const =default
Options for ExportScene and ExportActor.
DynamicArray< ActorHandle > excludeActors
Handles of actors that ExportScene should not export.
bool exportCurrentPose
Whether to export the current pose of soft, articulated, and rod actors.
Prefab parameters for a JointRotationRangeConstraintParams.
DynamicString actorNameB
Name or hierarchy path identifying rigid actor B.
bool operator==(JointRotationRangeConstraintPrefab const &) const =default
DynamicString actorNameA
Name or hierarchy path identifying rigid actor A.
Prefab parameters for a JointRotationTrackingConstraintParams.
DynamicString actorNameB
Name or hierarchy path identifying rigid actor B.
DynamicString actorNameA
Name or hierarchy path identifying rigid actor A.
bool operator==(JointRotationTrackingConstraintPrefab const &) const =default
Used by ContactFilter to enable or disable contact for a pair of layers.
bool enable
Enable (true) or disable (false) contact for the specified pair of contact layer names.
DynamicArray< DynamicString > layers
Identifies two contact layer names.
bool operator==(LayerContactEntry const &) const =default
Prefab parameters for an articulated pose controller.
DynamicArray< PoseTrackingParams > linkRotTracking
Per-link rotation tracking parameters.
DynamicString articulatedActor
Name or hierarchy path of the articulated actor to control.
DynamicArray< PoseTrackingParams > jointTracking
Per-joint pose tracking parameters.
bool operator==(PoseControllerPrefab const &) const =default
std::optional< DynamicString > comment
Optional serialized comment.
DynamicArray< PoseTrackingParams > linkPosTracking
Per-link position tracking parameters.
Parameters for instantiating a ScenePrefab into a Scene.
Real3 translation
Translation (position) of the new prefab in world-space.
Quaternion rotation
Rotation quaternion [x, y, z, w] of the new prefab in world-space.
real scale
Uniform scale of the new prefab in world-space.
bool applySceneSettings
Whether to apply top-level scene settings.
DynamicString name
Optional name prefix for created actors.
Reference to another prefab (scene or actor) for prefab nesting.
real scale
Uniform scale of the nested prefab, relative to the parent prefab.
std::optional< DynamicString > comment
Optional serialized comment.
Real3 translation
Translation [x, y, z] of the nested prefab in the parent's local space.
bool operator==(PrefabReference const &) const =default
DynamicString path
Path to the nested prefab file.
Quaternion rotation
Rotation quaternion [x, y, z, w] of the nested prefab in the parent's local space.
PrefabHandle prefab
Handle to the loaded nested prefab.
DynamicString name
Name of the nested prefab instance.
Prefab parameters for a rigid actor.
Real3 translation
Actor translation [x, y, z] relative to the prefab's local frame (i.e., the prefab-from-local transla...
Real3 renderModelScale
Scale [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.,...
bool operator==(RigidActorPrefab const &) const =default
Real3 shapeTranslation
Translation [x, y, z] to bake into the shape file.
Real3 renderModelTranslation
Translation [x, y, z] to apply to the render model.
Quaternion renderModelRotation
Rotation quaternion [x, y, z, w] to apply to the render model.
Real3 scale
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.
std::optional< DynamicString > comment
Optional serialized comment.
DynamicString renderModelFile
Optional path to a render model file (e.g.
Quaternion shapeRotation
Rotation quaternion [x, y, z, w] to bake into the shape file.
Prefab parameters for a RigidPivotPositionConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the rigid actor.
bool operator==(RigidPivotPositionConstraintPrefab const &) const =default
Prefab parameters for a RigidPivotRotationConstraintParams.
bool operator==(RigidPivotRotationConstraintPrefab const &) const =default
DynamicString actorName
Name or hierarchy path identifying the rigid actor.
Prefab parameters for a RigidPivotToRigidTargetConstraintParams.
DynamicString actorName
Name or hierarchy path identifying the rigid actor.
bool operator==(RigidPivotToRigidTargetConstraintPrefab const &) const =default
Prefab parameters for a RigidPrismaticJointConstraintParams.
bool operator==(RigidPrismaticJointConstraintPrefab const &) const =default
DynamicString actorNameB
Name or hierarchy path identifying rigid actor B.
DynamicString actorNameA
Name or hierarchy path identifying rigid actor A.
Prefab parameters for a RigidSphericalJointConstraintParams.
bool operator==(RigidSphericalJointConstraintPrefab const &) const =default
DynamicString actorNameA
Name or hierarchy path identifying rigid actor A.
DynamicString actorNameB
Name or hierarchy path identifying rigid actor B.
Prefab parameters for a rod actor.
Real3 renderModelTranslation
Translation [x, y, z] to apply to the render model.
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.
std::optional< RodPose > pose
Optional initial pose.
Quaternion shapeRotation
Rotation quaternion [x, y, z, w] 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 transla...
Real3 scale
Scale [x, y, z] to bake into the shape file.
Real3 shapeTranslation
Translation [x, y, z] to bake into the shape file.
bool operator==(RodActorPrefab const &) const =default
Quaternion rotation
Actor rotation quaternion [x, y, z, w] relative to the prefab's local frame (i.e.,...
std::optional< DynamicString > comment
Optional serialized comment.
Real3 renderModelScale
Scale [x, y, z] to apply to the render model.
DynamicString shapeFile
Path to a polyline model file that will be loaded and referenced via ShapeHandle.
Prefab parameters for a RodElementRotationConstraintParams.
bool operator==(RodElementRotationConstraintPrefab const &) const =default
DynamicString actorName
Name or hierarchy path identifying the rod actor.
Prefab parameters for a RodElementRotationToRigidConstraintParams.
bool operator==(RodElementRotationToRigidConstraintPrefab const &) const =default
DynamicString rodActorName
Name or hierarchy path identifying the rod actor.
DynamicString rigidActorName
Name or hierarchy path identifying the rigid actor.
A rod pose: node displacements and element frame axes.
DynamicArray< real > nodeDisplacements
Node displacements relative to the rest node positions, flattened as [x0, y0, z0, x1,...
bool operator==(RodPose const &) const =default
DynamicArray< real > elementFrameAxes
Element frame axes, flattened as [x0, y0, z0, x1, y1, z1, ...].
Parameters that are global to the Scene in which this prefab will be instantiated.
std::optional< Real3 > gravity
Optional gravity vector [m/s^2] in world frame.
std::optional< DynamicString > comment
Optional serialized comment.
DynamicString description
Human-readable description of the scene.
bool operator==(SceneParams const &) const =default
std::optional< SolverParams > solver
Optional solver parameters.
Top-level prefab describing a complete or partial physics scene (possibly just one actor).
std::optional< ContactFilter > contactFilter
Contact filter settings for selective contact filtering.
std::optional< SceneParams > scene
Global scene parameters (top-level prefab only).
bool operator==(ScenePrefab const &) const =default
DynamicArray< PrefabReference > prefabs
List of nested prefab references.
DynamicArray< PoseControllerPrefab > controllers
List of pose controllers.
ActorLists actors
Lists of actors by type.
std::optional< DynamicArray< ContactPairParamsOverrideEntry > > contactPairParamsOverrides
Optional actor-pair contact parameter overrides.
ConstraintLists constraints
Lists of constraints by type.
std::optional< DynamicString > comment
Optional serialized comment.
std::optional< DynamicString > sourceFilePath
Path this prefab was loaded from, exactly as passed to the loading function.
Prefab parameters for a soft actor.
DynamicString renderModelFile
Optional path to a render model file (e.g.
std::optional< DynamicArray< real > > nodeDisplacements
Optional initial nodal displacements in model space, flattened as [x0, y0, z0, x1,...
ShapeHandle flow
[Experimental] Optional deep flow shape handle loaded from flowFile.
Quaternion shapeRotation
Rotation quaternion [x, y, z, w] to bake into the shape file.
DynamicString shapeFile
Path to a model file that will be loaded and referenced via ShapeHandle.
Real3 translation
Actor translation [x, y, z] relative to the prefab's local frame (i.e., the prefab-from-local transla...
bool operator==(SoftActorPrefab const &) const =default
Real3 shapeTranslation
Translation [x, y, z] to bake into the shape file.
Quaternion renderModelRotation
Rotation quaternion [x, y, z, w] to apply to the render model.
bool useRecentering
[Experimental] Enable automatic recentering of the local coordinate system.
Real3 scale
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...
Real3 renderModelTranslation
Translation [x, y, z] to apply to the render model.
DynamicString flowFile
[Experimental] Optional path to a deep flow shape handle for collision detection.
ColliderType colliderType
[Experimental] Collision detection geometry.
std::optional< DynamicString > comment
Optional serialized comment.
Quaternion rotation
Actor rotation quaternion [x, y, z, w] relative to the prefab's local frame (i.e.,...
Real3 renderModelScale
Scale [x, y, z] to apply to the render model.
Prefab parameters for a soft-skinned actor.
DynamicArray< SoftActorPrefab > softParams
Parameters for each nested soft actor.
ArticulatedActorPrefab skeletonParams
Articulated actor parameters for the skeleton.
bool operator==(SoftSkinnedActorPrefab const &) const =default
bool enableCollidingLinks
Whether links can collide with each other.
bool hasInertia
Whether inertia is applied.
std::optional< DynamicString > comment
Optional serialized comment.
DynamicArray< DynamicString > softAttachLinks
Local link names to attach each nested soft actor to.
bool hasStress
Whether soft material stress is applied.
bool hasGravity
Whether gravity is applied.