mujoco-react 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -20
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core/SceneLoader.ts +1 -3
- package/src/types.ts +3 -2
package/package.json
CHANGED
package/src/core/SceneLoader.ts
CHANGED
|
@@ -154,9 +154,7 @@ export async function loadScene(
|
|
|
154
154
|
try { mujoco.FS.unmount('/working'); } catch { /* ignore */ }
|
|
155
155
|
try { mujoco.FS.mkdir('/working'); } catch { /* ignore */ }
|
|
156
156
|
|
|
157
|
-
const baseUrl =
|
|
158
|
-
config.baseUrl ||
|
|
159
|
-
`https://raw.githubusercontent.com/google-deepmind/mujoco_menagerie/main/${config.modelId}/`;
|
|
157
|
+
const baseUrl = config.src.endsWith('/') ? config.src : config.src + '/';
|
|
160
158
|
|
|
161
159
|
const downloaded = new Set<string>();
|
|
162
160
|
const queue: string[] = [config.sceneFile];
|
package/src/types.ts
CHANGED
|
@@ -284,9 +284,10 @@ export interface XmlPatch {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
export interface SceneConfig {
|
|
287
|
-
|
|
287
|
+
/** Base URL for fetching model files. The loader fetches `src + sceneFile` and follows dependencies. */
|
|
288
|
+
src: string;
|
|
289
|
+
/** Entry MJCF XML file name, e.g. 'scene.xml'. */
|
|
288
290
|
sceneFile: string;
|
|
289
|
-
baseUrl?: string;
|
|
290
291
|
sceneObjects?: SceneObject[];
|
|
291
292
|
homeJoints?: number[];
|
|
292
293
|
xmlPatches?: XmlPatch[];
|