simvx.core.resource¶
Resource system — URI-based resource resolution with caching.
Mesh resource identifiers: “mesh://cube” → Mesh.cube() “mesh://sphere?radius=2&rings=16” → Mesh.sphere(radius=2, rings=16) “mesh://obj?path=models/ship.obj” → Mesh.from_obj(“models/ship.obj”)
Audio resource identifiers: “audio://music/theme.ogg” → AudioStream(“music/theme.ogg”) “audio://sfx/explosion.wav” → AudioStream(“sfx/explosion.wav”)
Public API: ResourceCache.get().resolve_mesh(uri) ResourceCache.get().resolve_audio(uri)
Module Contents¶
Classes¶
Builder for mesh resource URIs. |
|
Singleton cache that resolves resource URIs to objects. |
Data¶
API¶
- class simvx.core.resource.MeshURI[source]¶
Builder for mesh resource URIs.
Usage: MeshURI.CUBE # “mesh://cube” MeshURI.SPHERE # “mesh://sphere” MeshURI.cube(size=0.5) # “mesh://cube?size=0.5” MeshURI.sphere(radius=2, rings=32) # “mesh://sphere?radius=2&rings=32” MeshURI.obj(“models/ship.obj”) # “mesh://obj?path=models/ship.obj”
- CUBE¶
‘mesh://cube’
- SPHERE¶
‘mesh://sphere’
- CONE¶
‘mesh://cone’
- CYLINDER¶
‘mesh://cylinder’
- class simvx.core.resource.ResourceCache[source]¶
Singleton cache that resolves resource URIs to objects.
Initialization
- classmethod get() simvx.core.resource.ResourceCache[source]¶
Return the singleton instance, creating it if needed.
- resolve_mesh(uri: str) simvx.core.graphics.mesh.Mesh[source]¶
Resolve a mesh:// URI to a Mesh object. Results are cached by URI.
- resolve_audio(uri: str) simvx.core.audio.AudioStream[source]¶
Resolve an audio:// URI to an AudioStream object. Results are cached by URI.