Add model asset and update tests for scene document JSON
This commit is contained in:
@@ -1017,9 +1017,29 @@ describe("scene document JSON", () => {
|
|||||||
const brush = createBoxBrush({
|
const brush = createBoxBrush({
|
||||||
id: "brush-authored-state-legacy"
|
id: "brush-authored-state-legacy"
|
||||||
});
|
});
|
||||||
|
const modelAsset: ModelAssetRecord = {
|
||||||
|
id: "asset-model-authored-state-legacy",
|
||||||
|
kind: "model",
|
||||||
|
sourceName: "legacy-authored-state.glb",
|
||||||
|
mimeType: "model/gltf-binary",
|
||||||
|
storageKey: createProjectAssetStorageKey("asset-model-authored-state-legacy"),
|
||||||
|
byteLength: 2048,
|
||||||
|
metadata: {
|
||||||
|
kind: "model",
|
||||||
|
format: "glb",
|
||||||
|
sceneName: null,
|
||||||
|
nodeCount: 1,
|
||||||
|
meshCount: 1,
|
||||||
|
materialNames: [],
|
||||||
|
textureNames: [],
|
||||||
|
animationNames: [],
|
||||||
|
boundingBox: null,
|
||||||
|
warnings: []
|
||||||
|
}
|
||||||
|
};
|
||||||
const modelInstance = createModelInstance({
|
const modelInstance = createModelInstance({
|
||||||
id: "model-instance-authored-state-legacy",
|
id: "model-instance-authored-state-legacy",
|
||||||
assetId: "asset-model-authored-state-legacy"
|
assetId: modelAsset.id
|
||||||
});
|
});
|
||||||
const interactable = createInteractableEntity({
|
const interactable = createInteractableEntity({
|
||||||
id: "entity-interactable-authored-state-legacy",
|
id: "entity-interactable-authored-state-legacy",
|
||||||
@@ -1057,6 +1077,9 @@ describe("scene document JSON", () => {
|
|||||||
const migratedDocument = migrateSceneDocument({
|
const migratedDocument = migrateSceneDocument({
|
||||||
...createEmptySceneDocument({ name: "Legacy Authored State Scene" }),
|
...createEmptySceneDocument({ name: "Legacy Authored State Scene" }),
|
||||||
version: PLAYER_START_AIR_DIRECTION_CONTROL_SCENE_DOCUMENT_VERSION,
|
version: PLAYER_START_AIR_DIRECTION_CONTROL_SCENE_DOCUMENT_VERSION,
|
||||||
|
assets: {
|
||||||
|
[modelAsset.id]: modelAsset
|
||||||
|
},
|
||||||
brushes: {
|
brushes: {
|
||||||
[brush.id]: legacyBrush
|
[brush.id]: legacyBrush
|
||||||
},
|
},
|
||||||
@@ -2016,11 +2039,14 @@ describe("scene document JSON", () => {
|
|||||||
expect(migratedDocument.entities["entity-sound-main"]).toEqual({
|
expect(migratedDocument.entities["entity-sound-main"]).toEqual({
|
||||||
id: "entity-sound-main",
|
id: "entity-sound-main",
|
||||||
kind: "soundEmitter",
|
kind: "soundEmitter",
|
||||||
|
name: undefined,
|
||||||
position: {
|
position: {
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 2,
|
y: 2,
|
||||||
z: 3
|
z: 3
|
||||||
},
|
},
|
||||||
|
visible: true,
|
||||||
|
enabled: true,
|
||||||
audioAssetId: null,
|
audioAssetId: null,
|
||||||
volume: 0.4,
|
volume: 0.4,
|
||||||
refDistance: 9,
|
refDistance: 9,
|
||||||
|
|||||||
Reference in New Issue
Block a user