Add scene path creation and update tests
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
|
|||||||
import { BoxGeometry, PlaneGeometry } from "three";
|
import { BoxGeometry, PlaneGeometry } from "three";
|
||||||
|
|
||||||
import { createBoxBrush } from "../../src/document/brushes";
|
import { createBoxBrush } from "../../src/document/brushes";
|
||||||
|
import { createScenePath } from "../../src/document/paths";
|
||||||
import { createDefaultProjectTimeSettings } from "../../src/document/project-time-settings";
|
import { createDefaultProjectTimeSettings } from "../../src/document/project-time-settings";
|
||||||
import { createEmptySceneDocument } from "../../src/document/scene-document";
|
import { createEmptySceneDocument } from "../../src/document/scene-document";
|
||||||
import {
|
import {
|
||||||
@@ -253,12 +254,45 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
z: 2
|
z: 2
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const path = createScenePath({
|
||||||
|
id: "path-lobby-route",
|
||||||
|
name: "Lobby Route",
|
||||||
|
points: [
|
||||||
|
{
|
||||||
|
id: "path-point-a",
|
||||||
|
position: {
|
||||||
|
x: -2,
|
||||||
|
y: 0,
|
||||||
|
z: -2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "path-point-b",
|
||||||
|
position: {
|
||||||
|
x: -2,
|
||||||
|
y: 0,
|
||||||
|
z: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "path-point-c",
|
||||||
|
position: {
|
||||||
|
x: 2,
|
||||||
|
y: 0,
|
||||||
|
z: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
const document = {
|
const document = {
|
||||||
...createEmptySceneDocument({ name: "Runtime Slice" }),
|
...createEmptySceneDocument({ name: "Runtime Slice" }),
|
||||||
brushes: {
|
brushes: {
|
||||||
[brush.id]: brush
|
[brush.id]: brush
|
||||||
},
|
},
|
||||||
|
paths: {
|
||||||
|
[path.id]: path
|
||||||
|
},
|
||||||
assets: {
|
assets: {
|
||||||
[audioAsset.id]: audioAsset,
|
[audioAsset.id]: audioAsset,
|
||||||
[modelAsset.id]: modelAsset,
|
[modelAsset.id]: modelAsset,
|
||||||
|
|||||||
Reference in New Issue
Block a user