constructor(handle: HandleSnapshot)
View sourceCreates persistence data for a mesh component handle.
The supplied HandleSnapshot is stored as-is; this constructor
does not restore or clone a live handle.
Class
Holds serializable persistence data for a Meshed component.
This value stores a handle snapshot rather than a live asset handle, so it can be persisted and later used to rebuild the component. It is not an ECS component.
constructor(handle: HandleSnapshot)Creates persistence data for a mesh component handle.
The supplied HandleSnapshot is stored as-is; this constructor
does not restore or clone a live handle.
Snapshot of the live handle held by Meshed.
The nested HandleSnapshot carries either a path for
AssetServer restoration or a numeric index for a scene-local
asset mapping.
default(): MeshedSnapshotfromSnapshot(snapshot: MeshedSnapshot, world: World, sceneAssetId?: AssetId): MeshedRestores a live Meshed component from this persistence data.
This delegates to Handle#fromSnapshot and requires the
world to contain an AssetServer resource. A string locator uses
the server to load or reserve the asset; a numeric locator requires
sceneAssetId and a matching scene asset mapping. If nested restoration
returns undefined, this method still returns a Meshed whose
handle is undefined; a missing server or asset pool throws.
const serial = MeshedSnapshot.serialize(Meshed.toSnapshot(meshed, world))
const restored = Meshed.fromSnapshot(MeshedSnapshot.deserialize(serial), world, sceneAssetId)serialize(value: MeshedSnapshot): MeshedSnapshotSerialConverts a MeshedSnapshot to plain persistence data.
The nested HandleSnapshot.serialize call preserves the handle
type and its path or scene-local index. This method does not access a
World, load through an AssetServer, or restore a live
handle.
deserialize(value: MeshedSnapshotSerial, out?: MeshedSnapshot): MeshedSnapshotRehydrates a MeshedSnapshot from plain persistence data.
The nested HandleSnapshot.deserialize call copies the serialized
type and path or scene-local index into out.handle. It does not access a
World or AssetServer; live-handle restoration happens
only through Meshed#fromSnapshot.