Release Healer Man 0.1.49
This commit is contained in:
1 parent
39425f2494
commit
612170afd0
91 files changed
+2278
-263
No files matched your search
@@ -3,6 +3,7 @@ import {
|
||||
spectatorCameraBoosted,
|
||||
spectatorCameraTranslation,
|
||||
spectatorKeyboardAxes,
|
||||
spectatorKeyboardLookDelta,
|
||||
} from "./spectatorCameraMath";
|
||||
|
||||
describe("dungeon spectator free camera", () => {
|
||||
@@ -27,6 +28,21 @@ describe("dungeon spectator free camera", () => {
|
||||
expect(pitched[2]).toBeCloseTo(Math.sqrt(3) / 2, 6);
|
||||
});
|
||||
|
||||
it("strafes A left and D right in screen space", () => {
|
||||
expect(spectatorCameraTranslation(0, 0, { forward: 0, right: 1, vertical: 0 }, 0.1, false))
|
||||
.toEqual([-1, 0, 0]);
|
||||
expect(spectatorCameraTranslation(0, 0, { forward: 0, right: -1, vertical: 0 }, 0.1, false))
|
||||
.toEqual([1, 0, 0]);
|
||||
});
|
||||
|
||||
it("turns with held arrow keys using bounded frame deltas", () => {
|
||||
expect(spectatorKeyboardLookDelta(new Set(["ArrowRight", "ArrowUp"]), 0.1))
|
||||
.toEqual([0.225, -0.15500000000000003]);
|
||||
expect(spectatorKeyboardLookDelta(new Set(["ArrowLeft", "ArrowDown"]), 1))
|
||||
.toEqual([-0.225, 0.15500000000000003]);
|
||||
expect(spectatorKeyboardLookDelta(new Set(["ArrowLeft"]), Number.NaN)).toEqual([-0, 0]);
|
||||
});
|
||||
|
||||
it("normalizes diagonal speed and clamps long render-frame gaps", () => {
|
||||
const diagonal = spectatorCameraTranslation(0, 0, { forward: 1, right: 1, vertical: 1 }, 1, false);
|
||||
expect(Math.hypot(...diagonal)).toBeCloseTo(1, 6);
|
||||
|
||||
Reference in new issue
Block a user