Update test cases for collision world and scene document serialization
This commit is contained in:
@@ -214,9 +214,9 @@ describe("RapierCollisionWorld", () => {
|
|||||||
const wallBrush = createBoxBrush({
|
const wallBrush = createBoxBrush({
|
||||||
id: "brush-wall-rotated",
|
id: "brush-wall-rotated",
|
||||||
center: {
|
center: {
|
||||||
x: 1,
|
x: 1.2,
|
||||||
y: 1,
|
y: 1,
|
||||||
z: 1
|
z: 0
|
||||||
},
|
},
|
||||||
rotationDegrees: {
|
rotationDegrees: {
|
||||||
x: 0,
|
x: 0,
|
||||||
@@ -224,7 +224,7 @@ describe("RapierCollisionWorld", () => {
|
|||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
x: 0.5,
|
x: 0.4,
|
||||||
y: 2,
|
y: 2,
|
||||||
z: 4
|
z: 4
|
||||||
}
|
}
|
||||||
@@ -248,14 +248,14 @@ describe("RapierCollisionWorld", () => {
|
|||||||
{
|
{
|
||||||
x: 2,
|
x: 2,
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 2
|
z: 0
|
||||||
},
|
},
|
||||||
runtimeScene.playerCollider
|
runtimeScene.playerCollider
|
||||||
);
|
);
|
||||||
|
|
||||||
|
expect(blocked.collidedAxes.x).toBe(true);
|
||||||
expect(blocked.feetPosition.x).toBeLessThan(0.85);
|
expect(blocked.feetPosition.x).toBeLessThan(0.85);
|
||||||
expect(blocked.feetPosition.z).toBeLessThan(0.85);
|
expect(blocked.feetPosition.z).toBeCloseTo(0, 5);
|
||||||
expect(blocked.collidedAxes.x || blocked.collidedAxes.z).toBe(true);
|
|
||||||
} finally {
|
} finally {
|
||||||
collisionWorld.dispose();
|
collisionWorld.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ describe("scene document JSON", () => {
|
|||||||
|
|
||||||
const migratedDocument = migrateSceneDocument(legacyDocument);
|
const migratedDocument = migrateSceneDocument(legacyDocument);
|
||||||
|
|
||||||
expect(migratedDocument.version).toBe(PLAYER_START_COLLIDER_SETTINGS_SCENE_DOCUMENT_VERSION);
|
expect(migratedDocument.version).toBe(SCENE_DOCUMENT_VERSION);
|
||||||
expect(migratedDocument.entities[playerStart.id]).toEqual(
|
expect(migratedDocument.entities[playerStart.id]).toEqual(
|
||||||
createPlayerStartEntity({
|
createPlayerStartEntity({
|
||||||
...playerStart
|
...playerStart
|
||||||
|
|||||||
Reference in New Issue
Block a user