@pinkaphant/kolmo 0.2.0 → 0.2.1

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.
@@ -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 };
@@ -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";
@@ -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 };