Update player movement template in tests
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
|||||||
DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
||||||
createPointLightEntity,
|
createPointLightEntity,
|
||||||
createInteractableEntity,
|
createInteractableEntity,
|
||||||
|
createPlayerStartMovementTemplate,
|
||||||
createPlayerStartInputBindings,
|
createPlayerStartInputBindings,
|
||||||
createPlayerStartEntity,
|
createPlayerStartEntity,
|
||||||
createSceneEntryEntity,
|
createSceneEntryEntity,
|
||||||
@@ -23,6 +24,8 @@ import { createProjectAssetStorageKey, type AudioAssetRecord } from "../../src/a
|
|||||||
import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build";
|
import { buildRuntimeSceneFromDocument } from "../../src/runtime-three/runtime-scene-build";
|
||||||
import { createFixtureLoadedModelAssetFromGeometry } from "../helpers/model-collider-fixtures";
|
import { createFixtureLoadedModelAssetFromGeometry } from "../helpers/model-collider-fixtures";
|
||||||
|
|
||||||
|
const defaultMovementTemplate = createPlayerStartMovementTemplate();
|
||||||
|
|
||||||
describe("buildRuntimeSceneFromDocument", () => {
|
describe("buildRuntimeSceneFromDocument", () => {
|
||||||
it("builds runtime brush data, colliders, and an authored player spawn from the document", () => {
|
it("builds runtime brush data, colliders, and an authored player spawn from the document", () => {
|
||||||
const brush = createBoxBrush({
|
const brush = createBoxBrush({
|
||||||
@@ -400,7 +403,11 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
movement: {
|
movement: {
|
||||||
templateKind: "default",
|
templateKind: "default",
|
||||||
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
||||||
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES
|
maxSpeed: defaultMovementTemplate.maxSpeed,
|
||||||
|
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
||||||
|
jump: defaultMovementTemplate.jump,
|
||||||
|
sprint: defaultMovementTemplate.sprint,
|
||||||
|
crouch: defaultMovementTemplate.crouch
|
||||||
},
|
},
|
||||||
inputBindings: playerStart.inputBindings,
|
inputBindings: playerStart.inputBindings,
|
||||||
collider: {
|
collider: {
|
||||||
@@ -574,7 +581,11 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
movement: {
|
movement: {
|
||||||
templateKind: "default",
|
templateKind: "default",
|
||||||
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
||||||
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES
|
maxSpeed: defaultMovementTemplate.maxSpeed,
|
||||||
|
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
||||||
|
jump: defaultMovementTemplate.jump,
|
||||||
|
sprint: defaultMovementTemplate.sprint,
|
||||||
|
crouch: defaultMovementTemplate.crouch
|
||||||
},
|
},
|
||||||
inputBindings: playerStart.inputBindings,
|
inputBindings: playerStart.inputBindings,
|
||||||
collider: {
|
collider: {
|
||||||
@@ -599,7 +610,11 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
expect(runtimeScene.playerMovement).toEqual({
|
expect(runtimeScene.playerMovement).toEqual({
|
||||||
templateKind: "default",
|
templateKind: "default",
|
||||||
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
||||||
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES
|
maxSpeed: defaultMovementTemplate.maxSpeed,
|
||||||
|
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
||||||
|
jump: defaultMovementTemplate.jump,
|
||||||
|
sprint: defaultMovementTemplate.sprint,
|
||||||
|
crouch: defaultMovementTemplate.crouch
|
||||||
});
|
});
|
||||||
expect(runtimeScene.playerInputBindings).toEqual(playerStart.inputBindings);
|
expect(runtimeScene.playerInputBindings).toEqual(playerStart.inputBindings);
|
||||||
expect(runtimeScene.navigationMode).toBe("firstPerson");
|
expect(runtimeScene.navigationMode).toBe("firstPerson");
|
||||||
@@ -647,7 +662,11 @@ describe("buildRuntimeSceneFromDocument", () => {
|
|||||||
expect(runtimeScene.playerMovement).toEqual({
|
expect(runtimeScene.playerMovement).toEqual({
|
||||||
templateKind: "default",
|
templateKind: "default",
|
||||||
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
moveSpeed: DEFAULT_PLAYER_START_MOVE_SPEED,
|
||||||
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES
|
maxSpeed: defaultMovementTemplate.maxSpeed,
|
||||||
|
capabilities: DEFAULT_PLAYER_START_MOVEMENT_CAPABILITIES,
|
||||||
|
jump: defaultMovementTemplate.jump,
|
||||||
|
sprint: defaultMovementTemplate.sprint,
|
||||||
|
crouch: defaultMovementTemplate.crouch
|
||||||
});
|
});
|
||||||
expect(runtimeScene.playerInputBindings).toEqual(
|
expect(runtimeScene.playerInputBindings).toEqual(
|
||||||
createPlayerStartInputBindings()
|
createPlayerStartInputBindings()
|
||||||
|
|||||||
Reference in New Issue
Block a user