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

Reference to another prefab file (scene or actor) for prefab nesting. More...

#include <mochi_prefab.h>

Public Member Functions

bool operator== (PrefabReference const &) const =default

Public Attributes

std::optional< DynamicStringcomment = std::nullopt
 Optional serialized comment.
DynamicString name {}
 Name of the nested prefab instance.
DynamicString path {}
 File path of the nested prefab.
PrefabHandle prefab {}
 Handle to the loaded nested prefab.
Quaternion rotation {}
 Rotation quaternion [x, y, z, w] of the nested prefab in the parent's local space.
real scale = 1_r
 Uniform scale of the nested prefab, relative to the parent prefab.
Real3 translation {}
 Translation [x, y, z] of the nested prefab in the parent's local space.

Detailed Description

Reference to another prefab file (scene or actor) for prefab nesting.

Definition at line 279 of file mochi_prefab.h.

Member Function Documentation

◆ operator==()

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

Member Data Documentation

◆ comment

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

Optional serialized comment.

Definition at line 280 of file mochi_prefab.h.

◆ name

DynamicString superdex::prefab::PrefabReference::name {}

Name of the nested prefab instance.

Used to format the names of nested actors in the form "prefabName/actorName".

Note
Name-reference ambiguity is evaluated per nested subtree. A nested prefab's own references (from its constraints, pose controllers, and contact filters) resolve within its own instance first, so a name reused across independent sibling instances is not ambiguous for each instance's internal references. It becomes ambiguous only for a reference written at the enclosing (parent) scope or above.

Definition at line 281 of file mochi_prefab.h.

◆ path

DynamicString superdex::prefab::PrefabReference::path {}

File path of the nested prefab.

Definition at line 282 of file mochi_prefab.h.

◆ prefab

PrefabHandle superdex::prefab::PrefabReference::prefab {}

Handle to the loaded nested prefab.

Runtime state, populated at load time and never serialized.

Definition at line 288 of file mochi_prefab.h.

◆ rotation

Quaternion superdex::prefab::PrefabReference::rotation {}

Rotation quaternion [x, y, z, w] of the nested prefab in the parent's local space.

Note
Must be finite and non-zero.

Definition at line 284 of file mochi_prefab.h.

◆ scale

real superdex::prefab::PrefabReference::scale = 1_r

Uniform scale of the nested prefab, relative to the parent prefab.

The scale applied to this nested prefab is this value multiplied by PrefabParams::scale and each enclosing PrefabReference::scale. See PrefabParams::scale for what scaling affects.

Note
Set this value before loading shapes. If changed later, call LoadShapes on the top-level ScenePrefab before adding it to a Scene.
Must be strictly positive and finite. Negative or zero scale is invalid and rejected at AddToScene.
See also
PrefabParams::scale

Definition at line 283 of file mochi_prefab.h.

◆ translation

Real3 superdex::prefab::PrefabReference::translation {}

Translation [x, y, z] of the nested prefab in the parent's local space.

Note
Must be finite.

Definition at line 285 of file mochi_prefab.h.


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