@adatechnology/game-player 0.11.0 → 0.12.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.global.js +6 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ type Walker = {
|
|
|
73
73
|
read(out: Float32Array | Float64Array): void;
|
|
74
74
|
/** The feet between the last two fixed steps, `alpha` (0 to 1) of the way: the scheduler's alpha, not the loop's (`stepFixed` zeroes that one). */
|
|
75
75
|
drawn(alpha: number, out: Float32Array | Float64Array): void;
|
|
76
|
+
/** Puts the feet here at once, with no sweep and no speed carried over, and the drawn feet with them (a respawn, a scripted step). Nothing happens while parked. */
|
|
77
|
+
teleport(feet: Vec3): void;
|
|
76
78
|
/** Takes the body out of the world (a seat, an aircraft, a vehicle): it no longer moves or blocks. */
|
|
77
79
|
park(): void;
|
|
78
80
|
/** Puts the body back at the first of `candidates` (feet) where the capsule overlaps nothing solid, in this order (the door, the far side, the roof); false, still parked, when none fits. */
|
package/dist/index.global.js
CHANGED
|
@@ -995,6 +995,12 @@ var GamePlayer = (() => {
|
|
|
995
995
|
const t = alpha < 0 ? 0 : alpha > 1 ? 1 : alpha;
|
|
996
996
|
for (let axis = 0; axis < 3; axis++) out[axis] = previous[axis] + (current[axis] - previous[axis]) * t;
|
|
997
997
|
},
|
|
998
|
+
teleport: (feet) => {
|
|
999
|
+
if (parked) return;
|
|
1000
|
+
world.teleportCharacter(id, feet);
|
|
1001
|
+
world.readCharacter(id, current, 0);
|
|
1002
|
+
previous.set(current);
|
|
1003
|
+
},
|
|
998
1004
|
park: () => {
|
|
999
1005
|
if (parked) return;
|
|
1000
1006
|
parked = true;
|