@pinkaphant/kolmo 0.2.0 → 0.2.2
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/README.md +3 -4
- package/dist/engine/kolmoActor.js +60 -59
- package/dist/engine/kolmoInput.d.ts +1 -1
- package/dist/engine/kolmoInput.js +53 -1
- package/dist/engine/kolmoLongDrive.js +52 -52
- package/dist/engine/kolmoVehicle.d.ts +1 -1
- package/dist/engine/kolmoVehicle.js +80 -79
- package/dist/engine/shiftedFixedBody.js +12 -28
- package/dist/importer/DomainWorkshopPanel.js +97 -98
- package/dist/importer/ImperativeVehicleRig.js +1 -3
- package/dist/importer/khrCompiler.js +0 -2
- package/dist/importer/universalGateBake.js +1 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +21 -24
- package/dist/junk/DestructibleTarget.js +1 -1
- package/dist/junk/targetHitLogic.js +0 -1
- package/dist/shaders/celestialBackdrop.d.ts +2 -2
- package/dist/shaders/celestialBackdrop.js +1 -1
- package/dist/shaders/plumeAndSparkle.d.ts +2 -2
- package/dist/shaders/plumeAndSparkle.js +4 -3
- package/dist/shaders/ps2RoadWebGL.js +1 -1
- package/dist/shaders/retroShader.d.ts +1 -1
- package/dist/shaders/retroShader.js +23 -31
- package/package.json +5 -9
- package/dist/body/HeldItem.d.ts +0 -22
- package/dist/body/HeldItem.js +0 -171
- package/dist/body/KhrBody.d.ts +0 -26
- package/dist/body/KhrBody.js +0 -171
- package/dist/body/bodySi.d.ts +0 -48
- package/dist/body/bodySi.js +0 -52
- package/dist/body/index.d.ts +0 -3
- package/dist/body/index.js +0 -4
package/dist/body/bodySi.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SI first-person and third-person body dimensions and zero-allocation camera helpers
|
|
3
|
-
* for `@pinkaphant/ecctrl` `<Ecctrl>` and `<EcctrlCameraControls>`.
|
|
4
|
-
*/
|
|
5
|
-
export interface BodySiConstants {
|
|
6
|
-
/** `<Ecctrl capsuleHalfHeight>` in metres. */
|
|
7
|
-
readonly capsuleHalfHeight: number;
|
|
8
|
-
/** `<Ecctrl capsuleRadius>` in metres. */
|
|
9
|
-
readonly capsuleRadius: number;
|
|
10
|
-
/** `<Ecctrl floatHeight>` in metres. */
|
|
11
|
-
readonly floatHeight: number;
|
|
12
|
-
/** Eye height above the floor in metres. */
|
|
13
|
-
readonly eyeHeight: number;
|
|
14
|
-
/** Camera dolly distance in first person (metres). */
|
|
15
|
-
readonly firstPersonDistance: number;
|
|
16
|
-
/** Camera dolly distance in third person (metres). */
|
|
17
|
-
readonly thirdPersonDistance: number;
|
|
18
|
-
}
|
|
19
|
-
/** 1.75 m standing adult: 2 * 0.50 + 2 * 0.30 + 0.15. */
|
|
20
|
-
export declare const BODY_SI: BodySiConstants;
|
|
21
|
-
export type BodySocketId = "Socket_Hand_R" | "Socket_Hand_L" | "Socket_Head" | "Socket_Back";
|
|
22
|
-
export declare const BODY_SOCKET_IDS: readonly BodySocketId[];
|
|
23
|
-
/** Rigid-body centre height when standing at rest on flat ground. */
|
|
24
|
-
export declare function bodyRestCenterY(b?: BodySiConstants): number;
|
|
25
|
-
/** Total standing height from floor to the top of the capsule. */
|
|
26
|
-
export declare function bodyStandingHeight(b?: BodySiConstants): number;
|
|
27
|
-
/** Camera target offset above the rigid-body centre. */
|
|
28
|
-
export declare function bodyEyeOffsetY(b?: BodySiConstants): number;
|
|
29
|
-
/** Spawn position whose feet rest on `floorY`. */
|
|
30
|
-
export declare function bodySpawnPosition(x: number, floorY: number, z: number, b?: BodySiConstants): [number, number, number];
|
|
31
|
-
/**
|
|
32
|
-
* Merges `ecctrl.excludeCharacterRay: true` into a RigidBody `userData` object for held-item colliders
|
|
33
|
-
* so `@pinkaphant/ecctrl` ground casts ignore held items (`collider.parent()?.userData`).
|
|
34
|
-
*/
|
|
35
|
-
export declare function withExcludeCharacterRay(userData?: Record<string, unknown>): Record<string, unknown>;
|
|
36
|
-
/** Zero-allocation camera step sync from live handle position (and optional local Y axis) to camera controls at eye height. */
|
|
37
|
-
export declare function stepCameraSync(controls: {
|
|
38
|
-
moveTo?: (x: number, y: number, z: number, smooth: boolean) => unknown;
|
|
39
|
-
update?: (dt: number) => unknown;
|
|
40
|
-
} | null, pos: {
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
|
-
z: number;
|
|
44
|
-
}, eyeOffsetY: number, smooth: boolean, bodyYAxis?: {
|
|
45
|
-
x: number;
|
|
46
|
-
y: number;
|
|
47
|
-
z: number;
|
|
48
|
-
}): void;
|
package/dist/body/bodySi.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// src/body/bodySi.ts
|
|
2
|
-
var e = Object.freeze({
|
|
3
|
-
capsuleHalfHeight: .5,
|
|
4
|
-
capsuleRadius: .3,
|
|
5
|
-
floatHeight: .15,
|
|
6
|
-
eyeHeight: 1.62,
|
|
7
|
-
firstPersonDistance: .02,
|
|
8
|
-
thirdPersonDistance: 3.2
|
|
9
|
-
}), t = Object.freeze([
|
|
10
|
-
"Socket_Hand_R",
|
|
11
|
-
"Socket_Hand_L",
|
|
12
|
-
"Socket_Head",
|
|
13
|
-
"Socket_Back"
|
|
14
|
-
]);
|
|
15
|
-
function n(e) {
|
|
16
|
-
for (let [t, n] of Object.entries(e)) if (!(typeof n == "number" && Number.isFinite(n) && n >= 0)) throw RangeError(`kolmo/body: ${t} must be a finite non-negative number, got ${String(n)}`);
|
|
17
|
-
if (!(e.capsuleRadius > 0)) throw RangeError("kolmo/body: capsuleRadius must be > 0");
|
|
18
|
-
}
|
|
19
|
-
function r(t = e) {
|
|
20
|
-
return n(t), t.floatHeight + t.capsuleRadius + t.capsuleHalfHeight;
|
|
21
|
-
}
|
|
22
|
-
function i(t = e) {
|
|
23
|
-
return r(t) + t.capsuleHalfHeight + t.capsuleRadius;
|
|
24
|
-
}
|
|
25
|
-
function a(t = e) {
|
|
26
|
-
let n = t.eyeHeight - r(t);
|
|
27
|
-
if (!(n > 0)) throw RangeError("kolmo/body: eyeHeight must sit above the body centre");
|
|
28
|
-
return n;
|
|
29
|
-
}
|
|
30
|
-
function o(t, n, i, a = e) {
|
|
31
|
-
return [
|
|
32
|
-
t,
|
|
33
|
-
n + r(a),
|
|
34
|
-
i
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
function s(e) {
|
|
38
|
-
let t = e?.ecctrl ?? {};
|
|
39
|
-
return {
|
|
40
|
-
...e ?? {},
|
|
41
|
-
ecctrl: {
|
|
42
|
-
...t,
|
|
43
|
-
excludeCharacterRay: !0
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function c(e, t, n, r, i) {
|
|
48
|
-
if (!e) return;
|
|
49
|
-
let a = i ? t.x + i.x * n : t.x, o = i ? t.y + i.y * n : t.y + n, s = i ? t.z + i.z * n : t.z;
|
|
50
|
-
e.moveTo?.(a, o, s, r);
|
|
51
|
-
}
|
|
52
|
-
export { e as BODY_SI, t as BODY_SOCKET_IDS, a as bodyEyeOffsetY, r as bodyRestCenterY, o as bodySpawnPosition, i as bodyStandingHeight, c as stepCameraSync, s as withExcludeCharacterRay };
|
package/dist/body/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { BODY_SI, BODY_SOCKET_IDS, bodyEyeOffsetY, bodyRestCenterY, bodySpawnPosition, bodyStandingHeight, stepCameraSync, withExcludeCharacterRay, type BodySiConstants, type BodySocketId, } from "./bodySi.js";
|
|
2
|
-
export { KhrBody, type KhrBodyHandle, type KhrBodyProps } from "./KhrBody.js";
|
|
3
|
-
export { HeldItem, type HeldItemHandle, type HeldItemProps } from "./HeldItem.js";
|
package/dist/body/index.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { BODY_SI as e, BODY_SOCKET_IDS as t, bodyEyeOffsetY as n, bodyRestCenterY as r, bodySpawnPosition as i, bodyStandingHeight as a, stepCameraSync as o, withExcludeCharacterRay as s } from "./bodySi.js";
|
|
2
|
-
import { KhrBody as c } from "./KhrBody.js";
|
|
3
|
-
import { HeldItem as l } from "./HeldItem.js";
|
|
4
|
-
export { e as BODY_SI, t as BODY_SOCKET_IDS, l as HeldItem, c as KhrBody, n as bodyEyeOffsetY, r as bodyRestCenterY, i as bodySpawnPosition, a as bodyStandingHeight, o as stepCameraSync, s as withExcludeCharacterRay };
|