Refactor ground probing logic in first-person navigation controller tests
This commit is contained in:
@@ -51,13 +51,12 @@ function createRuntimeControllerContext(
|
|||||||
feetPosition: Vec3,
|
feetPosition: Vec3,
|
||||||
shape: FirstPersonPlayerShape
|
shape: FirstPersonPlayerShape
|
||||||
) => boolean;
|
) => boolean;
|
||||||
options.probePlayerGround?.(feetPosition, shape, maxDistance) ??
|
} = {}
|
||||||
{
|
) {
|
||||||
grounded: true,
|
const runtimeScene = buildRuntimeSceneFromDocument(
|
||||||
distance: 0,
|
{
|
||||||
normal: { x: 0, y: 1, z: 0 },
|
...createEmptySceneDocument({ name: "Pointer Lock Scene" }),
|
||||||
slopeDegrees: 0
|
entities: {
|
||||||
},
|
|
||||||
[playerStart.id]: playerStart
|
[playerStart.id]: playerStart
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -327,23 +326,11 @@ describe("FirstPersonNavigationController", () => {
|
|||||||
maxDistance: number
|
maxDistance: number
|
||||||
) => PlayerGroundProbeResult
|
) => PlayerGroundProbeResult
|
||||||
>()
|
>()
|
||||||
.mockReturnValueOnce({
|
|
||||||
grounded: true,
|
|
||||||
distance: 0,
|
|
||||||
normal: { x: 0, y: 1, z: 0 },
|
|
||||||
slopeDegrees: 0
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
grounded: true,
|
|
||||||
distance: 0,
|
|
||||||
normal: { x: 0, y: 1, z: 0 },
|
|
||||||
slopeDegrees: 0
|
|
||||||
})
|
|
||||||
.mockReturnValue({
|
.mockReturnValue({
|
||||||
grounded: false,
|
grounded: true,
|
||||||
distance: null,
|
distance: 0,
|
||||||
normal: null,
|
normal: { x: 0, y: 1, z: 0 },
|
||||||
slopeDegrees: null
|
slopeDegrees: 0
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user