|
SuperDex Physics C++ API
|
Functions | |
| AddToSceneResult | AddToScene (ScenePrefab const &prefab, Scene *scene, Error &error) |
| Overload of AddToScene that instantiates a ScenePrefab using default PrefabParams. | |
| AddToSceneResult | AddToScene (ScenePrefab const &prefab, Scene *scene, PrefabParams const ¶ms, Error &error) |
| Instantiate a ScenePrefab and add it to a Scene. | |
| AddToSceneResult | AddToScene (std::string_view prefabPath, std::string_view rootPath, Scene *scene, Error &error) |
| Overload of AddToScene that loads a prefab from a file and instantiates it using default PrefabParams. | |
| AddToSceneResult | AddToScene (std::string_view prefabPath, std::string_view rootPath, Scene *scene, PrefabParams const ¶ms, Error &error) |
| Load a scene prefab from a file and create an instance of it in the Scene. | |
| 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. | |
| void | ExportActor (Actor const *actor, std::string_view exportName, std::string_view outputDir, 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, Error &error) |
| Export a Scene to a folder containing a prefab file and all generated mesh files. | |
| void | ExportSceneExcluding (Scene const *scene, std::string_view exportName, std::string_view outputDir, Span< ActorHandle const > excludeActors, Error &error) |
| Export a Scene to a folder containing a prefab file and all generated mesh files, omitting a caller-provided set of actors. | |
| 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. | |
| 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 | LoadNestedPrefabs (ScenePrefab &prefab, std::string_view rootPath, Error &error) |
| Load nested prefab files recursively. | |
| 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. | |
| DynamicString | SaveToJsonString (ScenePrefab const &prefab, Error &error) |
| Serialize a ScenePrefab to a JSON string. | |
| ScenePrefab | ShallowLoadFromFile (std::string_view path, Error &error) |
| Deserialize a single ScenePrefab from a file, without loading any nested files. | |
| ScenePrefab | ShallowLoadFromJsonString (std::string_view json, Error &error) |
| Deserialize a single ScenePrefab from a JSON string, without loading any nested files. | |
|
inline |
Overload of AddToScene that instantiates a ScenePrefab using default PrefabParams.
| [in] | prefab | The fully loaded ScenePrefab to instantiate. |
| [in,out] | Scene | The Scene to add things to. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
Definition at line 27 of file mochi_prefab_inl.h.
| AddToSceneResult superdex::prefab::AddToScene | ( | ScenePrefab const & | prefab, |
| Scene * | scene, | ||
| PrefabParams const & | params, | ||
| Error & | error ) |
Instantiate a ScenePrefab and add it to a Scene.
Creates the prefab's actors, constraints, and controllers, applies any scene settings enabled by PrefabParams::applySceneSettings, and applies contact filter entries.
| [in] | prefab | The fully loaded ScenePrefab to instantiate. |
| [in,out] | Scene | The Scene to add things to. |
| [in] | params | Parameters for how and where to instantiate the prefab. Can optionally be omitted in Python. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
|
inline |
Overload of AddToScene that loads a prefab from a file and instantiates it using default PrefabParams.
| [in] | prefabPath | File path to the prefab file. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in,out] | Scene | The Scene to add things to. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
Definition at line 32 of file mochi_prefab_inl.h.
| AddToSceneResult superdex::prefab::AddToScene | ( | std::string_view | prefabPath, |
| std::string_view | rootPath, | ||
| Scene * | scene, | ||
| PrefabParams const & | params, | ||
| Error & | error ) |
Load a scene prefab from a file and create an instance of it in the Scene.
This is a convenience function that loads the prefab, including all nested prefabs and shapes, and immediately adds it to the scene. All loaded shape handles are released automatically afterward.
| [in] | prefabPath | File path to the prefab file. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in,out] | Scene | The Scene to add things to. |
| [in] | params | Parameters for how and where to instantiate the prefab. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::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.
| [in,out] | prefab | The ScenePrefab whose nested prefabs and shapes will be loaded. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in] | Context | The Context that owns the loaded resources. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::ExportActor | ( | Actor const * | actor, |
| std::string_view | exportName, | ||
| std::string_view | outputDir, | ||
| Error & | error ) |
Export a single actor to a prefab file under outputDir/exportName/<exportName>.mochi_scene.
Extracts creation parameters from the actor and writes the prefab plus any generated mesh assets to disk. Only supported for standalone rigid actors, soft actors and articulated actors.
| [in] | actor | The actor to export. Must not be null. |
| [in] | exportName | Label used for the actor's name, the export subdirectory, and the prefab filename (<exportName>.mochi_scene). |
| [in] | outputDir | Parent directory for the export. The subdirectories <outputDir>/<exportName> and <outputDir>/<exportName>/generated_assets are created automatically. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::ExportScene | ( | Scene const * | scene, |
| std::string_view | exportName, | ||
| std::string_view | outputDir, | ||
| Error & | error ) |
Export a Scene to a folder containing a prefab file and all generated mesh files.
| [in] | Scene | The Scene to export. |
| [in] | exportName | Name for the exported prefab. Used both for the export subdirectory and for the prefab filename (<exportName>.mochi_scene). |
| [in] | outputDir | Directory where the export folder will be created. The subdirectories <outputDir>/<exportName> and <outputDir>/<exportName>/generated_assets are created automatically. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::ExportSceneExcluding | ( | Scene const * | scene, |
| std::string_view | exportName, | ||
| std::string_view | outputDir, | ||
| Span< ActorHandle const > | excludeActors, | ||
| Error & | error ) |
Export a Scene to a folder containing a prefab file and all generated mesh files, omitting a caller-provided set of actors.
| [in] | Scene | The Scene to export. |
| [in] | exportName | Name for the exported prefab. Used both for the export subdirectory and for the prefab filename (<exportName>.mochi_scene). |
| [in] | outputDir | Directory where the export folder will be created. The subdirectories <outputDir>/<exportName> and <outputDir>/<exportName>/generated_assets are created automatically. |
| [in] | excludeActors | Handles of actors that should not be exported. Excluding an articulated actor also excludes all of its nested link actors. Excluding a soft-skinned actor also excludes all of its nested link and soft sub-actors. Any contact filter entries that reference excluded actors are dropped. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| DynamicString superdex::prefab::GetPrefabFullPath | ( | std::string_view | inputPath, |
| std::string_view | rootForRelativePath, | ||
| std::string_view | prefabFilePath ) |
Resolve a path referenced inside a prefab to a full path.
| [in] | inputPath | The path to resolve, as stored in the prefab (may be prefixed with "./" to indicate it is relative to the prefab file). |
| [in] | rootForRelativePath | Root directory used to resolve paths that are not prefixed with "./". |
| [in] | prefabFilePath | Path to the prefab file that references inputPath, used to resolve "./"-prefixed paths relative to its location. |
prefabFilePath when provided. Other relative paths are resolved against rootForRelativePath. | ScenePrefab superdex::prefab::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.
| [in] | prefabPath | File path to the prefab file. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in] | Context | The Context that owns the loaded resources. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| ScenePrefab superdex::prefab::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.
| [in] | json | JSON string containing the serialized prefab. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in] | Context | The Context that owns the loaded resources. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
json resolve against rootPath, not against a prefab directory. Nested prefabs that are loaded from files resolve their own "./"-prefixed paths relative to the directory containing the nested prefab file. Use LoadFromFile if you need prefab-relative resolution at the top level. | void superdex::prefab::LoadNestedPrefabs | ( | ScenePrefab & | prefab, |
| std::string_view | rootPath, | ||
| Error & | error ) |
Load nested prefab files recursively.
| [in,out] | prefab | The ScenePrefab whose nested prefab references will be loaded. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::LoadShapes | ( | ScenePrefab & | prefab, |
| std::string_view | rootPath, | ||
| Context * | context, | ||
| Error & | error ) |
Load shape files referenced by prefab and its loaded nested prefabs.
| [in,out] | prefab | The ScenePrefab whose shape references will be loaded. |
| [in] | rootPath | Root directory for resolving relative paths, except those resolved against a prefab file. |
| [in] | Context | The Context that owns the loaded resources. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| void superdex::prefab::SaveToJsonFile | ( | ScenePrefab const & | prefab, |
| std::string_view | path, | ||
| Error & | error ) |
Serialize a ScenePrefab to a JSON file.
| [in] | prefab | The ScenePrefab to serialize. |
| [in] | path | Output file path. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| DynamicString superdex::prefab::SaveToJsonString | ( | ScenePrefab const & | prefab, |
| Error & | error ) |
Serialize a ScenePrefab to a JSON string.
| [in] | prefab | The ScenePrefab to serialize. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| ScenePrefab superdex::prefab::ShallowLoadFromFile | ( | std::string_view | path, |
| Error & | error ) |
Deserialize a single ScenePrefab from a file, without loading any nested files.
| [in] | path | File path to the prefab file. |
| [in,out] | error | Error status. Check Error::IsOK for success. |
| ScenePrefab superdex::prefab::ShallowLoadFromJsonString | ( | std::string_view | json, |
| Error & | error ) |
Deserialize a single ScenePrefab from a JSON string, without loading any nested files.
| [in] | json | JSON string containing the serialized prefab. |
| [in,out] | error | Error status. Check Error::IsOK for success. |