@geoblocks/cesium-walk 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { Cartesian3 } from "@cesium/core";
|
|
2
|
+
import { ObstacleProbe } from "@geoblocks/cesium-obstacles";
|
|
3
|
+
/** @satisfies {Record<string, import("@geoblocks/cesium-input").Binding>} */
|
|
4
|
+
export declare const WALK_BINDINGS: {
|
|
5
|
+
move: {
|
|
6
|
+
type: "vector";
|
|
7
|
+
keys: {
|
|
8
|
+
up: string[];
|
|
9
|
+
down: string[];
|
|
10
|
+
left: string[];
|
|
11
|
+
right: string[];
|
|
12
|
+
};
|
|
13
|
+
stick: "left";
|
|
14
|
+
};
|
|
15
|
+
sprint: {
|
|
16
|
+
type: "button";
|
|
17
|
+
keys: string[];
|
|
18
|
+
buttons: number[];
|
|
19
|
+
};
|
|
20
|
+
jump: {
|
|
21
|
+
type: "button";
|
|
22
|
+
keys: string[];
|
|
23
|
+
buttons: number[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type WalkIntent = {
|
|
27
|
+
move: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
sprint: boolean;
|
|
32
|
+
jump: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** @typedef {{move: {x: number, y: number}, sprint: boolean, jump: boolean}} WalkIntent */
|
|
35
|
+
declare const CONTROLLER_SETTINGS: readonly ["enableTranslate", "enableZoom", "enableRotate", "enableTilt", "enableCollisionDetection"];
|
|
36
|
+
export default class CesiumWalk {
|
|
37
|
+
/**
|
|
38
|
+
* @type {import('@cesium/engine').CesiumWidget}
|
|
39
|
+
*/
|
|
40
|
+
viewer: import('@cesium/engine').CesiumWidget;
|
|
41
|
+
/**
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
speed: number;
|
|
45
|
+
/**
|
|
46
|
+
* Speed while sprinting, in meters per second.
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
sprintSpeed: number;
|
|
50
|
+
/**
|
|
51
|
+
* Upward speed at the start of a jump, in meters per second.
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
jumpSpeed: number;
|
|
55
|
+
/**
|
|
56
|
+
* The gravity of jumps and falls, in meters per second squared.
|
|
57
|
+
* @type {number}
|
|
58
|
+
*/
|
|
59
|
+
gravity: number;
|
|
60
|
+
/**
|
|
61
|
+
* How fast the walker reaches its speed, stops and turns, in meters per second squared; at once by
|
|
62
|
+
* default.
|
|
63
|
+
* @type {number}
|
|
64
|
+
*/
|
|
65
|
+
acceleration: number;
|
|
66
|
+
/**
|
|
67
|
+
* The deepest drop of the ground the walker steps down, in meters: deeper, off a ledge or a roof, it
|
|
68
|
+
* falls. By default it follows the ground whatever the drop.
|
|
69
|
+
* @type {number}
|
|
70
|
+
*/
|
|
71
|
+
stepHeight: number;
|
|
72
|
+
/**
|
|
73
|
+
* @type {number}
|
|
74
|
+
*/
|
|
75
|
+
height: number;
|
|
76
|
+
/**
|
|
77
|
+
* @type {boolean}
|
|
78
|
+
*/
|
|
79
|
+
active_: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @type {number}
|
|
82
|
+
*/
|
|
83
|
+
lastTick_: number;
|
|
84
|
+
/**
|
|
85
|
+
* Where the walker's intent comes from, read on each tick: {move: {x, y}, sprint, jump}, move no longer
|
|
86
|
+
* than 1, x right and y forward. The keyboard and the first gamepad by default, with WALK_BINDINGS; any
|
|
87
|
+
* object with a read() method otherwise: touch controls, an AI, a replay. The walk turns its active on
|
|
88
|
+
* and off with its own: replace it while the walk is not active.
|
|
89
|
+
* @type {{read(): WalkIntent, active?: boolean}}
|
|
90
|
+
*/
|
|
91
|
+
input: {
|
|
92
|
+
read(): WalkIntent;
|
|
93
|
+
active?: boolean;
|
|
94
|
+
};
|
|
95
|
+
velocity_: Cartesian3;
|
|
96
|
+
/** @type {number | undefined} */
|
|
97
|
+
ground_: number | undefined;
|
|
98
|
+
jumpOffset_: number;
|
|
99
|
+
jumpVelocity_: number;
|
|
100
|
+
jumpHeld_: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the camera bobs at each step and dips on landing, as in GTA 5's first person.
|
|
103
|
+
* @type {boolean}
|
|
104
|
+
*/
|
|
105
|
+
headBob: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Whether the walker stops at the obstacles in view at eye height: opaque 3D tiles or primitives.
|
|
108
|
+
* @type {boolean}
|
|
109
|
+
*/
|
|
110
|
+
collision: boolean;
|
|
111
|
+
obstacleProbe_: ObstacleProbe;
|
|
112
|
+
/**
|
|
113
|
+
* The obstacle ahead of the walker in a direction, a point of its plane and its normal toward the walker,
|
|
114
|
+
* if any; asked for each step while collision is on. By default the obstacles in view, read in the depth
|
|
115
|
+
* of the last frame, which waits for the GPU; for a world known on the CPU, a ray cast in every direction.
|
|
116
|
+
* @type {(toward: Cartesian3, key: string) => import('@geoblocks/cesium-obstacles').Obstacle | undefined}
|
|
117
|
+
*/
|
|
118
|
+
obstacleAhead: (toward: Cartesian3, key: string) => import('@geoblocks/cesium-obstacles').Obstacle | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* The walker's body: how far from the walls it keeps, in meters, pushed out of any it walks past, sideways
|
|
121
|
+
* or at a corner, where no ray ahead meets it; 0 by default, a walker without a body.
|
|
122
|
+
* @type {number}
|
|
123
|
+
*/
|
|
124
|
+
radius: number;
|
|
125
|
+
/**
|
|
126
|
+
* The surface nearest the walker's body, within its radius: a point of it, the surface's normal toward the
|
|
127
|
+
* body, and the point of the body it is nearest, if any; asked after each step while collision is on. None by
|
|
128
|
+
* default, as the obstacles in view tell nothing about what is beside the walker; walkOn gives the mesh's.
|
|
129
|
+
* @type {() => {point: Cartesian3, normal: Cartesian3, origin: Cartesian3} | undefined}
|
|
130
|
+
*/
|
|
131
|
+
surfaceNear: () => {
|
|
132
|
+
point: Cartesian3;
|
|
133
|
+
normal: Cartesian3;
|
|
134
|
+
origin: Cartesian3;
|
|
135
|
+
} | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The height of the ground under a position, in meters above the ellipsoid, or undefined when unknown
|
|
138
|
+
* yet. The terrain by default, none without a globe; a model's floors otherwise, for a walker on several levels.
|
|
139
|
+
* @type {(position: import('@cesium/core').Cartographic) => number | undefined}
|
|
140
|
+
*/
|
|
141
|
+
groundHeight: (position: import('@cesium/core').Cartographic) => number | undefined;
|
|
142
|
+
sprinting_: boolean;
|
|
143
|
+
/** @type {Partial<Record<typeof CONTROLLER_SETTINGS[number], boolean>>} */
|
|
144
|
+
controllerSettings_: Partial<Record<typeof CONTROLLER_SETTINGS[number], boolean>>;
|
|
145
|
+
bob_: number;
|
|
146
|
+
stepPhase_: number;
|
|
147
|
+
landing_: number;
|
|
148
|
+
handleTickFunction_: () => void;
|
|
149
|
+
/**
|
|
150
|
+
* @param {import('@cesium/engine').CesiumWidget} viewer
|
|
151
|
+
* @param {number} [speed=1.6] Walk speed in meters per second.
|
|
152
|
+
* @param {number} [height=2.0] Height of the camera above the terrain.
|
|
153
|
+
*/
|
|
154
|
+
constructor(viewer: import('@cesium/engine').CesiumWidget, speed?: number, height?: number);
|
|
155
|
+
get active(): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Whether the walker is sprinting.
|
|
158
|
+
* @return {boolean}
|
|
159
|
+
*/
|
|
160
|
+
get sprinting(): boolean;
|
|
161
|
+
set active(active: boolean);
|
|
162
|
+
handleTick_(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Moves the camera a step, stopping at obstacles or sliding along them; a slide is checked against the obstacles
|
|
165
|
+
* ahead of it in turn, so that at a concave corner it stops at the second wall rather than going through it.
|
|
166
|
+
* @param {Cartesian3} direction The unit direction of the step, level.
|
|
167
|
+
* @param {number} step The length of the step, negative backward, in meters.
|
|
168
|
+
* @param {string} kind Which steps these are, for the obstacle looked for last time.
|
|
169
|
+
*/
|
|
170
|
+
step_(direction: Cartesian3, step: number, kind: string): void;
|
|
171
|
+
/**
|
|
172
|
+
* Pushes the camera level out of the walls the walker's body is in, each in turn.
|
|
173
|
+
*/
|
|
174
|
+
keepClear_(): void;
|
|
175
|
+
clampCameraToTerrain_(): void;
|
|
176
|
+
/**
|
|
177
|
+
* @return {import('@cesium/core').Cartesian3} The ellipsoid surface normal at the camera position.
|
|
178
|
+
*/
|
|
179
|
+
surfaceNormal_(): import('@cesium/core').Cartesian3;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The heights above the floor the walls are looked for at: the knees, the waist and the eyes.
|
|
183
|
+
* @param {number} eye
|
|
184
|
+
* @param {number} step
|
|
185
|
+
* @return {number[]} In meters, from the lowest.
|
|
186
|
+
*/
|
|
187
|
+
export declare function rayHeights(eye: number, step: number): number[];
|
|
188
|
+
/**
|
|
189
|
+
* Walks a CesiumWalk on a triangle mesh of cesium-obstacles: it stands on the highest floor below its knees, up
|
|
190
|
+
* the stairs, under the arches, else on what it stood on before (the terrain); the walls ahead stop it, from rays
|
|
191
|
+
* cast at the knees, the waist and the eyes, the floors and stairs left to the ground below, in every direction;
|
|
192
|
+
* with a radius, its body at those heights is kept that far from the walls beside it too, a step's riser under
|
|
193
|
+
* the knees excepted.
|
|
194
|
+
* @param {CesiumWalk} walk
|
|
195
|
+
* @param {import("@geoblocks/cesium-obstacles").TriangleMesh} mesh
|
|
196
|
+
* @param {{eye: number, step: number, reach: number, radius?: number}} options In meters: the eyes above the
|
|
197
|
+
* floor, the highest step, how far ahead the walls are looked for, the body's radius (none by default).
|
|
198
|
+
*/
|
|
199
|
+
export declare function walkOn(walk: CesiumWalk, mesh: import("@geoblocks/cesium-obstacles").TriangleMesh, { eye, step, reach, radius }: {
|
|
200
|
+
eye: number;
|
|
201
|
+
step: number;
|
|
202
|
+
reach: number;
|
|
203
|
+
radius?: number;
|
|
204
|
+
}): void;
|
|
205
|
+
export {};
|
|
206
|
+
//# sourceMappingURL=c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,IAFF,OAAO,cAAc,EAAE,UAAU,CAK5C;CACF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAJnB,MAImB,EAAE,IAAI,EAHzB,MAGyB,GAFxB,MAAM,EAAE,CAInB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,IAAI,EALhB,UAKgB,EAAE,IAAI,EAJtB,OAAO,6BAA6B,EAAE,YAIhB,EAAE,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAU,EAAC,EAHtD;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAGJ,QA4BhE"}
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { Cartesian3, Ellipsoid, FixedFrameTransforms, Math as CesiumMath, Matrix4 } from "@cesium/core";
|
|
2
|
+
import Controls from "@geoblocks/cesium-input";
|
|
3
|
+
import { ObstacleProbe, blockedStep, meshGroundHeight, meshObstacleAhead } from "@geoblocks/cesium-obstacles";
|
|
4
|
+
// in seconds: a frame after a backgrounded tab must not walk or fall far
|
|
5
|
+
const MAX_DELTA = 0.1;
|
|
6
|
+
// the head bob: a dip of DIP meters at each step of STEP_LENGTH meters, twice as deep when sprinting,
|
|
7
|
+
// and of LANDING meters when landing from a jump; both settle in about BOB_TIME seconds
|
|
8
|
+
const STEP_LENGTH = 0.8;
|
|
9
|
+
const DIP = 0.03;
|
|
10
|
+
const LANDING = 0.15;
|
|
11
|
+
const BOB_TIME = 0.15;
|
|
12
|
+
// in meters: nearer its height, the camera stays, so that a walker standing still renders no frame
|
|
13
|
+
const SETTLED = 1e-3;
|
|
14
|
+
// at a concave corner the slide along one wall heads into the other: a step is checked again along its slide, this
|
|
15
|
+
// many times at most, before it is taken
|
|
16
|
+
const SLIDE_PASSES = 3;
|
|
17
|
+
// in a corner, pushed out of one wall, the body may be in the other: it is pushed again, this many times at most
|
|
18
|
+
const CLEAR_PASSES = 3;
|
|
19
|
+
// the default bindings: W, A, S, D or the arrows to walk, Shift to sprint and Space to jump; on a gamepad, the
|
|
20
|
+
// left stick, at any speed and in any direction, Cross to sprint and Square to jump, as in GTA 5. Keys by
|
|
21
|
+
// event.code, so that other keyboard layouts walk with the keys in the same place
|
|
22
|
+
/** @satisfies {Record<string, import("@geoblocks/cesium-input").Binding>} */
|
|
23
|
+
export const WALK_BINDINGS = {
|
|
24
|
+
move: { type: "vector", keys: { up: ["KeyW", "ArrowUp"], down: ["KeyS", "ArrowDown"], left: ["KeyA", "ArrowLeft"], right: ["KeyD", "ArrowRight"] }, stick: "left" },
|
|
25
|
+
sprint: { type: "button", keys: ["ShiftLeft", "ShiftRight"], buttons: [0] },
|
|
26
|
+
jump: { type: "button", keys: ["Space"], buttons: [2] },
|
|
27
|
+
};
|
|
28
|
+
/** @typedef {{move: {x: number, y: number}, sprint: boolean, jump: boolean}} WalkIntent */
|
|
29
|
+
// the camera controller's settings off while walking: its navigation, and its collision detection, which lifts
|
|
30
|
+
// the camera onto the 3D tiles under it, a roof or a coarse tile still loading over the street, whenever the
|
|
31
|
+
// camera moves; the walk keeps its own height
|
|
32
|
+
const CONTROLLER_SETTINGS = /** @type {const} */ (["enableTranslate", "enableZoom", "enableRotate", "enableTilt", "enableCollisionDetection"]);
|
|
33
|
+
const normalScratch = new Cartesian3();
|
|
34
|
+
const forwardScratch = new Cartesian3();
|
|
35
|
+
const stepScratch = new Cartesian3();
|
|
36
|
+
const allowedScratch = new Cartesian3();
|
|
37
|
+
const awayScratch = new Cartesian3();
|
|
38
|
+
const frameScratch = new Matrix4();
|
|
39
|
+
const bodyScratch = new Cartesian3();
|
|
40
|
+
const upScratch = new Cartesian3();
|
|
41
|
+
const targetScratch = new Cartesian3();
|
|
42
|
+
const changeScratch = new Cartesian3();
|
|
43
|
+
/**
|
|
44
|
+
* One step of a jump or a fall under gravity.
|
|
45
|
+
* @param {number} offset Height above the walk height, in meters.
|
|
46
|
+
* @param {number} velocity Upward speed, in meters per second.
|
|
47
|
+
* @param {number} dt Seconds.
|
|
48
|
+
* @param {number} gravity In meters per second squared.
|
|
49
|
+
* @return {[number, number]} The next offset and velocity, [0, 0] once landed.
|
|
50
|
+
*/
|
|
51
|
+
function jumpStep(offset, velocity, dt, gravity) {
|
|
52
|
+
const next = velocity - gravity * dt;
|
|
53
|
+
const height = offset + ((velocity + next) / 2) * dt;
|
|
54
|
+
return height <= 0 && next <= 0 ? [0, 0] : [height, next];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether a jump starts: on a new press only, so that holding the button does not jump again on landing.
|
|
58
|
+
* @param {boolean} pressed
|
|
59
|
+
* @param {boolean} wasPressed
|
|
60
|
+
* @param {boolean} grounded
|
|
61
|
+
* @return {boolean}
|
|
62
|
+
*/
|
|
63
|
+
function jumpStart(pressed, wasPressed, grounded) {
|
|
64
|
+
return pressed && !wasPressed && grounded;
|
|
65
|
+
}
|
|
66
|
+
export default class CesiumWalk {
|
|
67
|
+
/**
|
|
68
|
+
* @param {import('@cesium/engine').CesiumWidget} viewer
|
|
69
|
+
* @param {number} [speed=1.6] Walk speed in meters per second.
|
|
70
|
+
* @param {number} [height=2.0] Height of the camera above the terrain.
|
|
71
|
+
*/
|
|
72
|
+
constructor(viewer, speed = 1.6, height = 2.0) {
|
|
73
|
+
/**
|
|
74
|
+
* @type {import('@cesium/engine').CesiumWidget}
|
|
75
|
+
*/
|
|
76
|
+
this.viewer = viewer;
|
|
77
|
+
/**
|
|
78
|
+
* @type {number}
|
|
79
|
+
*/
|
|
80
|
+
this.speed = speed;
|
|
81
|
+
/**
|
|
82
|
+
* Speed while sprinting, in meters per second.
|
|
83
|
+
* @type {number}
|
|
84
|
+
*/
|
|
85
|
+
this.sprintSpeed = 3 * speed;
|
|
86
|
+
/**
|
|
87
|
+
* Upward speed at the start of a jump, in meters per second.
|
|
88
|
+
* @type {number}
|
|
89
|
+
*/
|
|
90
|
+
this.jumpSpeed = 4;
|
|
91
|
+
/**
|
|
92
|
+
* The gravity of jumps and falls, in meters per second squared.
|
|
93
|
+
* @type {number}
|
|
94
|
+
*/
|
|
95
|
+
this.gravity = 9.81;
|
|
96
|
+
/**
|
|
97
|
+
* How fast the walker reaches its speed, stops and turns, in meters per second squared; at once by
|
|
98
|
+
* default.
|
|
99
|
+
* @type {number}
|
|
100
|
+
*/
|
|
101
|
+
this.acceleration = Infinity;
|
|
102
|
+
/**
|
|
103
|
+
* The deepest drop of the ground the walker steps down, in meters: deeper, off a ledge or a roof, it
|
|
104
|
+
* falls. By default it follows the ground whatever the drop.
|
|
105
|
+
* @type {number}
|
|
106
|
+
*/
|
|
107
|
+
this.stepHeight = Infinity;
|
|
108
|
+
/**
|
|
109
|
+
* @type {number}
|
|
110
|
+
*/
|
|
111
|
+
this.height = height;
|
|
112
|
+
/**
|
|
113
|
+
* @type {boolean}
|
|
114
|
+
*/
|
|
115
|
+
this.active_ = false;
|
|
116
|
+
/**
|
|
117
|
+
* @type {number}
|
|
118
|
+
*/
|
|
119
|
+
this.lastTick_ = 0;
|
|
120
|
+
/**
|
|
121
|
+
* Where the walker's intent comes from, read on each tick: {move: {x, y}, sprint, jump}, move no longer
|
|
122
|
+
* than 1, x right and y forward. The keyboard and the first gamepad by default, with WALK_BINDINGS; any
|
|
123
|
+
* object with a read() method otherwise: touch controls, an AI, a replay. The walk turns its active on
|
|
124
|
+
* and off with its own: replace it while the walk is not active.
|
|
125
|
+
* @type {{read(): WalkIntent, active?: boolean}}
|
|
126
|
+
*/
|
|
127
|
+
this.input = new Controls(WALK_BINDINGS);
|
|
128
|
+
// the walker's velocity, level, on the globe
|
|
129
|
+
this.velocity_ = new Cartesian3();
|
|
130
|
+
// the ground under the walker on the last tick, which it keeps its height above while in the air
|
|
131
|
+
/** @type {number | undefined} */
|
|
132
|
+
this.ground_ = undefined;
|
|
133
|
+
// the jump or the fall: height above the walk height and upward speed; whether the jump input was down
|
|
134
|
+
// last tick
|
|
135
|
+
this.jumpOffset_ = 0;
|
|
136
|
+
this.jumpVelocity_ = 0;
|
|
137
|
+
this.jumpHeld_ = false;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the camera bobs at each step and dips on landing, as in GTA 5's first person.
|
|
140
|
+
* @type {boolean}
|
|
141
|
+
*/
|
|
142
|
+
this.headBob = false;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the walker stops at the obstacles in view at eye height: opaque 3D tiles or primitives.
|
|
145
|
+
* @type {boolean}
|
|
146
|
+
*/
|
|
147
|
+
this.collision = false;
|
|
148
|
+
this.obstacleProbe_ = new ObstacleProbe(viewer.scene);
|
|
149
|
+
/**
|
|
150
|
+
* The obstacle ahead of the walker in a direction, a point of its plane and its normal toward the walker,
|
|
151
|
+
* if any; asked for each step while collision is on. By default the obstacles in view, read in the depth
|
|
152
|
+
* of the last frame, which waits for the GPU; for a world known on the CPU, a ray cast in every direction.
|
|
153
|
+
* @type {(toward: Cartesian3, key: string) => import('@geoblocks/cesium-obstacles').Obstacle | undefined}
|
|
154
|
+
*/
|
|
155
|
+
this.obstacleAhead = (toward, key) => this.obstacleProbe_.ahead(toward, key);
|
|
156
|
+
/**
|
|
157
|
+
* The walker's body: how far from the walls it keeps, in meters, pushed out of any it walks past, sideways
|
|
158
|
+
* or at a corner, where no ray ahead meets it; 0 by default, a walker without a body.
|
|
159
|
+
* @type {number}
|
|
160
|
+
*/
|
|
161
|
+
this.radius = 0;
|
|
162
|
+
/**
|
|
163
|
+
* The surface nearest the walker's body, within its radius: a point of it, the surface's normal toward the
|
|
164
|
+
* body, and the point of the body it is nearest, if any; asked after each step while collision is on. None by
|
|
165
|
+
* default, as the obstacles in view tell nothing about what is beside the walker; walkOn gives the mesh's.
|
|
166
|
+
* @type {() => {point: Cartesian3, normal: Cartesian3, origin: Cartesian3} | undefined}
|
|
167
|
+
*/
|
|
168
|
+
this.surfaceNear = () => undefined;
|
|
169
|
+
/**
|
|
170
|
+
* The height of the ground under a position, in meters above the ellipsoid, or undefined when unknown
|
|
171
|
+
* yet. The terrain by default, none without a globe; a model's floors otherwise, for a walker on several levels.
|
|
172
|
+
* @type {(position: import('@cesium/core').Cartographic) => number | undefined}
|
|
173
|
+
*/
|
|
174
|
+
this.groundHeight = position => viewer.scene.globe?.getHeight(position);
|
|
175
|
+
// whether the walker sprinted on the last tick
|
|
176
|
+
this.sprinting_ = false;
|
|
177
|
+
// the camera controller's settings before walking
|
|
178
|
+
/** @type {Partial<Record<typeof CONTROLLER_SETTINGS[number], boolean>>} */
|
|
179
|
+
this.controllerSettings_ = {};
|
|
180
|
+
// the head bob: how deep, 0 standing to 2 sprinting, along the steps; the landing dip, 0 to 1
|
|
181
|
+
this.bob_ = 0;
|
|
182
|
+
this.stepPhase_ = 0;
|
|
183
|
+
this.landing_ = 0;
|
|
184
|
+
this.handleTickFunction_ = this.handleTick_.bind(this);
|
|
185
|
+
}
|
|
186
|
+
get active() {
|
|
187
|
+
return this.active_;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Whether the walker is sprinting.
|
|
191
|
+
* @return {boolean}
|
|
192
|
+
*/
|
|
193
|
+
get sprinting() {
|
|
194
|
+
return this.active_ && this.sprinting_;
|
|
195
|
+
}
|
|
196
|
+
set active(active) {
|
|
197
|
+
if (active === this.active_) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
this.active_ = active;
|
|
201
|
+
const controller = this.viewer.scene.screenSpaceCameraController;
|
|
202
|
+
if (this.active_) {
|
|
203
|
+
for (const setting of CONTROLLER_SETTINGS) {
|
|
204
|
+
this.controllerSettings_[setting] = controller[setting];
|
|
205
|
+
controller[setting] = false;
|
|
206
|
+
}
|
|
207
|
+
this.lastTick_ = performance.now();
|
|
208
|
+
this.input.active = true;
|
|
209
|
+
this.viewer.clock.onTick.addEventListener(this.handleTickFunction_);
|
|
210
|
+
this.clampCameraToTerrain_();
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
this.input.active = false;
|
|
214
|
+
this.viewer.clock.onTick.removeEventListener(this.handleTickFunction_);
|
|
215
|
+
this.jumpOffset_ = 0;
|
|
216
|
+
this.jumpVelocity_ = 0;
|
|
217
|
+
this.ground_ = undefined;
|
|
218
|
+
Cartesian3.clone(Cartesian3.ZERO, this.velocity_);
|
|
219
|
+
this.bob_ = 0;
|
|
220
|
+
this.landing_ = 0;
|
|
221
|
+
Object.assign(controller, this.controllerSettings_);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
handleTick_() {
|
|
225
|
+
const timestamp = performance.now();
|
|
226
|
+
const deltaTime = Math.min((timestamp - this.lastTick_) / 1000, MAX_DELTA);
|
|
227
|
+
this.lastTick_ = timestamp;
|
|
228
|
+
const { move, sprint, jump } = this.input.read();
|
|
229
|
+
let forward = move.y;
|
|
230
|
+
let right = move.x;
|
|
231
|
+
// walking diagonally is not faster
|
|
232
|
+
const magnitude = Math.hypot(forward, right);
|
|
233
|
+
if (magnitude > 1) {
|
|
234
|
+
forward /= magnitude;
|
|
235
|
+
right /= magnitude;
|
|
236
|
+
}
|
|
237
|
+
const grounded = this.jumpOffset_ === 0 && this.jumpVelocity_ === 0;
|
|
238
|
+
if (jumpStart(jump, this.jumpHeld_, grounded)) {
|
|
239
|
+
this.jumpVelocity_ = this.jumpSpeed;
|
|
240
|
+
}
|
|
241
|
+
this.jumpHeld_ = jump;
|
|
242
|
+
const airborne = this.jumpOffset_ > 0 || this.jumpVelocity_ > 0;
|
|
243
|
+
const moving = forward !== 0 || right !== 0;
|
|
244
|
+
// forward, no more sideways than diagonally, as in GTA 5
|
|
245
|
+
this.sprinting_ = sprint && forward > 0 && forward >= Math.abs(right);
|
|
246
|
+
const stopped = Cartesian3.equals(this.velocity_, Cartesian3.ZERO);
|
|
247
|
+
if (!moving && stopped && !airborne && this.bob_ === 0 && this.landing_ === 0) {
|
|
248
|
+
// standing: only the terrain refining under the walker moves it
|
|
249
|
+
this.clampCameraToTerrain_();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const camera = this.viewer.camera;
|
|
253
|
+
const speed = this.sprinting_ ? this.sprintSpeed : this.speed;
|
|
254
|
+
// walk along the view direction projected onto the ground plane,
|
|
255
|
+
// so that looking down does not push the camera into the terrain
|
|
256
|
+
const normal = this.surfaceNormal_();
|
|
257
|
+
const along = Cartesian3.subtract(camera.direction, Cartesian3.projectVector(camera.direction, normal, forwardScratch), forwardScratch);
|
|
258
|
+
const level = Cartesian3.magnitude(along) > CesiumMath.EPSILON6;
|
|
259
|
+
if (level) {
|
|
260
|
+
Cartesian3.normalize(along, along);
|
|
261
|
+
}
|
|
262
|
+
// the velocity, toward the intended one as fast as the acceleration allows
|
|
263
|
+
const target = Cartesian3.multiplyByScalar(camera.right, right * speed, targetScratch);
|
|
264
|
+
if (level) {
|
|
265
|
+
Cartesian3.add(target, Cartesian3.multiplyByScalar(along, forward * speed, changeScratch), target);
|
|
266
|
+
}
|
|
267
|
+
const change = Cartesian3.subtract(target, this.velocity_, changeScratch);
|
|
268
|
+
const needed = Cartesian3.magnitude(change);
|
|
269
|
+
const allowed = this.acceleration * deltaTime;
|
|
270
|
+
if (needed <= allowed) {
|
|
271
|
+
Cartesian3.clone(target, this.velocity_);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
Cartesian3.add(this.velocity_, Cartesian3.multiplyByScalar(change, allowed / needed, change), this.velocity_);
|
|
275
|
+
}
|
|
276
|
+
const forwardSpeed = level ? Cartesian3.dot(this.velocity_, along) : 0;
|
|
277
|
+
const rightSpeed = Cartesian3.dot(this.velocity_, camera.right);
|
|
278
|
+
if (forwardSpeed !== 0) {
|
|
279
|
+
this.step_(along, forwardSpeed * deltaTime, "forward");
|
|
280
|
+
}
|
|
281
|
+
if (rightSpeed !== 0) {
|
|
282
|
+
this.step_(camera.right, rightSpeed * deltaTime, "right");
|
|
283
|
+
}
|
|
284
|
+
if (airborne) {
|
|
285
|
+
[this.jumpOffset_, this.jumpVelocity_] = jumpStep(this.jumpOffset_, this.jumpVelocity_, deltaTime, this.gravity);
|
|
286
|
+
if (this.headBob && this.jumpOffset_ === 0) {
|
|
287
|
+
this.landing_ = 1;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// the head bob, which settles once turned off
|
|
291
|
+
const ease = 1 - Math.exp(-deltaTime / BOB_TIME);
|
|
292
|
+
const bob = this.headBob && moving && !airborne ? (this.sprinting_ ? 2 : 1) : 0;
|
|
293
|
+
this.bob_ += (bob - this.bob_) * ease;
|
|
294
|
+
this.landing_ -= this.landing_ * ease;
|
|
295
|
+
// the last thousandth in one step, so that the camera stops moving
|
|
296
|
+
if (bob === 0 && this.bob_ < 1e-3) {
|
|
297
|
+
this.bob_ = 0;
|
|
298
|
+
}
|
|
299
|
+
if (this.landing_ < 1e-3) {
|
|
300
|
+
this.landing_ = 0;
|
|
301
|
+
}
|
|
302
|
+
this.stepPhase_ += (Cartesian3.magnitude(this.velocity_) * deltaTime / STEP_LENGTH) * CesiumMath.PI;
|
|
303
|
+
this.clampCameraToTerrain_();
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Moves the camera a step, stopping at obstacles or sliding along them; a slide is checked against the obstacles
|
|
307
|
+
* ahead of it in turn, so that at a concave corner it stops at the second wall rather than going through it.
|
|
308
|
+
* @param {Cartesian3} direction The unit direction of the step, level.
|
|
309
|
+
* @param {number} step The length of the step, negative backward, in meters.
|
|
310
|
+
* @param {string} kind Which steps these are, for the obstacle looked for last time.
|
|
311
|
+
*/
|
|
312
|
+
step_(direction, step, kind) {
|
|
313
|
+
const camera = this.viewer.camera;
|
|
314
|
+
let toward = Cartesian3.multiplyByScalar(direction, Math.sign(step), stepScratch);
|
|
315
|
+
let length = Math.abs(step);
|
|
316
|
+
for (let pass = 0; pass < SLIDE_PASSES && length > 0; pass++) {
|
|
317
|
+
// a slide's look is its own, not the step's: the probe keeps its last look in each direction by its key
|
|
318
|
+
const obstacle = this.collision ? this.obstacleAhead(toward, `${kind}${Math.sign(step)}${pass ? "slide" : ""}`) : undefined;
|
|
319
|
+
const allowed = blockedStep(toward, length, camera.positionWC, obstacle, allowedScratch);
|
|
320
|
+
const same = Cartesian3.equalsEpsilon(allowed.direction, toward, CesiumMath.EPSILON9);
|
|
321
|
+
length = allowed.length;
|
|
322
|
+
toward = Cartesian3.clone(allowed.direction, stepScratch);
|
|
323
|
+
if (same) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (length > 0) {
|
|
328
|
+
camera.move(toward, length);
|
|
329
|
+
}
|
|
330
|
+
if (this.collision) {
|
|
331
|
+
this.keepClear_();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Pushes the camera level out of the walls the walker's body is in, each in turn.
|
|
336
|
+
*/
|
|
337
|
+
keepClear_() {
|
|
338
|
+
const camera = this.viewer.camera;
|
|
339
|
+
for (let pass = 0; pass < CLEAR_PASSES; pass++) {
|
|
340
|
+
const surface = this.surfaceNear();
|
|
341
|
+
if (!surface) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
const up = this.surfaceNormal_();
|
|
345
|
+
// level, from the surface to the body; a surface straight above or below it is left to the walker's ground
|
|
346
|
+
const away = Cartesian3.subtract(surface.origin, surface.point, awayScratch);
|
|
347
|
+
Cartesian3.subtract(away, Cartesian3.projectVector(away, up, stepScratch), away);
|
|
348
|
+
const distance = Cartesian3.magnitude(away);
|
|
349
|
+
if (distance >= this.radius) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (distance > CesiumMath.EPSILON6) {
|
|
353
|
+
Cartesian3.divideByScalar(away, distance, away);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
Cartesian3.subtract(surface.normal, Cartesian3.projectVector(surface.normal, up, stepScratch), away);
|
|
357
|
+
if (Cartesian3.magnitude(away) < CesiumMath.EPSILON6) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
Cartesian3.normalize(away, away);
|
|
361
|
+
}
|
|
362
|
+
camera.move(away, this.radius - distance);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
clampCameraToTerrain_() {
|
|
366
|
+
const camera = this.viewer.camera;
|
|
367
|
+
const terrainHeight = this.groundHeight(camera.positionCartographic);
|
|
368
|
+
if (terrainHeight === undefined) {
|
|
369
|
+
// ground not loaded yet at this position
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (this.ground_ !== undefined) {
|
|
373
|
+
// in the air, or off a drop deeper than a step, the walker keeps its height and falls the rest
|
|
374
|
+
const drop = this.ground_ - terrainHeight;
|
|
375
|
+
if (this.jumpOffset_ > 0 || this.jumpVelocity_ !== 0 || drop > this.stepHeight) {
|
|
376
|
+
this.jumpOffset_ += drop;
|
|
377
|
+
if (this.jumpOffset_ <= 0) {
|
|
378
|
+
// on the ground again: landed, or lifted by the ground while still going up
|
|
379
|
+
this.jumpOffset_ = 0;
|
|
380
|
+
if (this.jumpVelocity_ <= 0) {
|
|
381
|
+
this.jumpVelocity_ = 0;
|
|
382
|
+
if (this.headBob) {
|
|
383
|
+
this.landing_ = 1;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
this.ground_ = terrainHeight;
|
|
390
|
+
const cameraHeight = camera.positionCartographic.height;
|
|
391
|
+
// move along the surface normal, not the camera up vector, which is
|
|
392
|
+
// tilted when the camera is pitched
|
|
393
|
+
const bob = DIP * this.bob_ * Math.abs(Math.sin(this.stepPhase_)) + LANDING * this.landing_;
|
|
394
|
+
const offset = terrainHeight + this.height + this.jumpOffset_ - bob - cameraHeight;
|
|
395
|
+
if (Math.abs(offset) > SETTLED) {
|
|
396
|
+
camera.move(this.surfaceNormal_(), offset);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @return {import('@cesium/core').Cartesian3} The ellipsoid surface normal at the camera position.
|
|
401
|
+
*/
|
|
402
|
+
surfaceNormal_() {
|
|
403
|
+
const scene = this.viewer.scene;
|
|
404
|
+
return scene.ellipsoid.geodeticSurfaceNormal(scene.camera.position, normalScratch);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* The heights above the floor the walls are looked for at: the knees, the waist and the eyes.
|
|
409
|
+
* @param {number} eye
|
|
410
|
+
* @param {number} step
|
|
411
|
+
* @return {number[]} In meters, from the lowest.
|
|
412
|
+
*/
|
|
413
|
+
export function rayHeights(eye, step) {
|
|
414
|
+
return [step + 0.05, (step + eye) / 2, eye];
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Walks a CesiumWalk on a triangle mesh of cesium-obstacles: it stands on the highest floor below its knees, up
|
|
418
|
+
* the stairs, under the arches, else on what it stood on before (the terrain); the walls ahead stop it, from rays
|
|
419
|
+
* cast at the knees, the waist and the eyes, the floors and stairs left to the ground below, in every direction;
|
|
420
|
+
* with a radius, its body at those heights is kept that far from the walls beside it too, a step's riser under
|
|
421
|
+
* the knees excepted.
|
|
422
|
+
* @param {CesiumWalk} walk
|
|
423
|
+
* @param {import("@geoblocks/cesium-obstacles").TriangleMesh} mesh
|
|
424
|
+
* @param {{eye: number, step: number, reach: number, radius?: number}} options In meters: the eyes above the
|
|
425
|
+
* floor, the highest step, how far ahead the walls are looked for, the body's radius (none by default).
|
|
426
|
+
*/
|
|
427
|
+
export function walkOn(walk, mesh, { eye, step, reach, radius = 0 }) {
|
|
428
|
+
const camera = walk.viewer.scene.camera;
|
|
429
|
+
const fallback = walk.groundHeight;
|
|
430
|
+
const offsets = rayHeights(eye, step).map(height => new Cartesian3(0, 0, height - eye));
|
|
431
|
+
walk.obstacleAhead = meshObstacleAhead(mesh, () => camera.positionWC, { offsets, reach });
|
|
432
|
+
walk.radius = radius;
|
|
433
|
+
if (radius > 0) {
|
|
434
|
+
walk.surfaceNear = () => {
|
|
435
|
+
const position = camera.positionWC;
|
|
436
|
+
const frame = FixedFrameTransforms.eastNorthUpToFixedFrame(position, Ellipsoid.WGS84, frameScratch);
|
|
437
|
+
const up = Ellipsoid.WGS84.geodeticSurfaceNormal(position, upScratch);
|
|
438
|
+
let nearest;
|
|
439
|
+
for (const [k, offset] of offsets.entries()) {
|
|
440
|
+
const origin = Matrix4.multiplyByPoint(frame, offset, bodyScratch);
|
|
441
|
+
const hit = mesh.nearest(origin, radius, { walls: true });
|
|
442
|
+
// under the knees, a step's riser: climbed, not kept from
|
|
443
|
+
if (!hit || (k === 0 && Cartesian3.dot(Cartesian3.subtract(hit.position, origin, awayScratch), up) < 0)) {
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
if (!nearest || hit.distance < nearest.distance) {
|
|
447
|
+
nearest = { point: hit.position, normal: hit.normal, origin: Cartesian3.clone(origin), distance: hit.distance };
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
return nearest;
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
const ground = meshGroundHeight(mesh, { below: eye - step });
|
|
454
|
+
walk.groundHeight = cartographic => ground(cartographic) ?? fallback(cartographic);
|
|
455
|
+
}
|
|
456
|
+
//# sourceMappingURL=cesium-walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cesium-walk.js","sourceRoot":"","sources":["../src/cesium-walk.js"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,IAAI,UAAU,EAAE,OAAO,EAAC,MAAM,cAAc,CAAC;AACtG,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAC,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAE5G,yEAAyE;AACzE,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,sGAAsG;AACtG,wFAAwF;AACxF,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,GA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+1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoblocks/cesium-walk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -8,25 +8,36 @@
|
|
|
8
8
|
"url": "https://github.com/geoblocks/cesium-helpers/",
|
|
9
9
|
"directory": "packages/cesium-walk"
|
|
10
10
|
},
|
|
11
|
-
"main": "cesium-walk.js",
|
|
12
|
-
"module": "cesium-walk.js",
|
|
13
|
-
"
|
|
11
|
+
"main": "dist/cesium-walk.js",
|
|
12
|
+
"module": "dist/cesium-walk.js",
|
|
13
|
+
"types": "dist/cesium-walk.d.ts",
|
|
14
14
|
"exports": {
|
|
15
|
-
".":
|
|
15
|
+
".": {
|
|
16
|
+
"source": "./src/cesium-walk.js",
|
|
17
|
+
"types": "./dist/cesium-walk.d.ts",
|
|
18
|
+
"default": "./dist/cesium-walk.js"
|
|
19
|
+
}
|
|
16
20
|
},
|
|
21
|
+
"sideEffects": false,
|
|
17
22
|
"files": [
|
|
18
|
-
"
|
|
23
|
+
"dist",
|
|
24
|
+
"src",
|
|
25
|
+
"!src/**/*.test.js"
|
|
19
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p .",
|
|
29
|
+
"prepack": "npm run build"
|
|
30
|
+
},
|
|
20
31
|
"publishConfig": {
|
|
21
32
|
"access": "public"
|
|
22
33
|
},
|
|
23
34
|
"dependencies": {
|
|
24
|
-
"@geoblocks/cesium-input": "^0.
|
|
25
|
-
"@geoblocks/cesium-obstacles": "^0.
|
|
35
|
+
"@geoblocks/cesium-input": "^0.3.0",
|
|
36
|
+
"@geoblocks/cesium-obstacles": "^0.6.0"
|
|
26
37
|
},
|
|
27
38
|
"peerDependencies": {
|
|
28
39
|
"@cesium/core": ">=0.1.0",
|
|
29
40
|
"@cesium/engine": ">=10"
|
|
30
41
|
},
|
|
31
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "a6d8fdfe6b9ad266fd8a4593c38efd24e9a5546b"
|
|
32
43
|
}
|
|
File without changes
|