@relu-interactives/spatial-ecs 0.3.18 → 0.3.20
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/{XRHandPose-B8xxFb9A.d.cts → XRHandPose-CLl4MiHx.d.cts} +12 -2
- package/dist/{XRHandPose-ubMe5Igc.d.ts → XRHandPose-CrzI57JA.d.ts} +12 -2
- package/dist/{chunk-7SSOZWXM.js → chunk-CDSE7476.js} +82 -6
- package/dist/chunk-CDSE7476.js.map +1 -0
- package/dist/{chunk-PFE2SDXR.js → chunk-D6KXWNYT.js} +3 -3
- package/dist/{chunk-PFE2SDXR.js.map → chunk-D6KXWNYT.js.map} +1 -1
- package/dist/{chunk-J3EUNW57.js → chunk-H6DQ7JRE.js} +48 -18
- package/dist/chunk-H6DQ7JRE.js.map +1 -0
- package/dist/{chunk-KRWBNC6Y.js → chunk-P42OE3RU.js} +4 -4
- package/dist/{chunk-KRWBNC6Y.js.map → chunk-P42OE3RU.js.map} +1 -1
- package/dist/components/index.cjs +33 -10
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.js +1 -1
- package/dist/docs/guide/vr-and-hand-poses.md +167 -0
- package/dist/factories/index.cjs +8 -0
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -2
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +3 -3
- package/dist/{handPose-dFxqbFFY.d.cts → handPose-DlcTtqgx.d.cts} +26 -1
- package/dist/{handPose-dFxqbFFY.d.ts → handPose-DlcTtqgx.d.ts} +26 -1
- package/dist/{index-D7aSZ-e9.d.ts → index-6l4hn2Sh.d.ts} +15 -1
- package/dist/{index-7CFf45fo.d.cts → index-C2I5PxCI.d.cts} +15 -1
- package/dist/{index-DhWfxUgL.d.ts → index-JRcoel9F.d.ts} +3 -2
- package/dist/{index-CA9fqh4Z.d.cts → index-g777AmFv.d.cts} +3 -2
- package/dist/index.cjs +123 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +8 -8
- package/dist/systems/index.cjs +114 -16
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.ts +2 -2
- package/dist/systems/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-7SSOZWXM.js.map +0 -1
- package/dist/chunk-J3EUNW57.js.map +0 -1
|
@@ -2008,22 +2008,27 @@ function fingers(thumb, index, middle, ring, pinky) {
|
|
|
2008
2008
|
__name(fingers, "fingers");
|
|
2009
2009
|
function handPoseFromCurls(id, name, curls, options) {
|
|
2010
2010
|
const tolerance = options?.tolerance ?? NARROW;
|
|
2011
|
-
const target = /* @__PURE__ */ __name((curl) =>
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2011
|
+
const target = /* @__PURE__ */ __name((finger, curl) => {
|
|
2012
|
+
const directions = options?.directions?.[finger];
|
|
2013
|
+
return {
|
|
2014
|
+
curl: Math.min(1, Math.max(0, curl)),
|
|
2015
|
+
tolerance,
|
|
2016
|
+
...directions && directions.length > 0 ? { directions } : {}
|
|
2017
|
+
};
|
|
2018
|
+
}, "target");
|
|
2015
2019
|
return {
|
|
2016
2020
|
id,
|
|
2017
2021
|
name,
|
|
2018
2022
|
fingers: {
|
|
2019
|
-
thumb: target(curls.thumb),
|
|
2020
|
-
index: target(curls.index),
|
|
2021
|
-
middle: target(curls.middle),
|
|
2022
|
-
ring: target(curls.ring),
|
|
2023
|
-
pinky: target(curls.pinky)
|
|
2023
|
+
thumb: target("thumb", curls.thumb),
|
|
2024
|
+
index: target("index", curls.index),
|
|
2025
|
+
middle: target("middle", curls.middle),
|
|
2026
|
+
ring: target("ring", curls.ring),
|
|
2027
|
+
pinky: target("pinky", curls.pinky)
|
|
2024
2028
|
},
|
|
2025
2029
|
pinch: options?.pinch,
|
|
2026
2030
|
orientation: options?.orientation,
|
|
2031
|
+
directionToleranceDegrees: options?.directionToleranceDegrees,
|
|
2027
2032
|
hand: options?.hand
|
|
2028
2033
|
};
|
|
2029
2034
|
}
|
|
@@ -2037,6 +2042,13 @@ var DEFAULT_POSE_CURLS = {
|
|
|
2037
2042
|
ring: 0,
|
|
2038
2043
|
pinky: 0
|
|
2039
2044
|
};
|
|
2045
|
+
var DEFAULT_POSE_DIRECTIONS = {
|
|
2046
|
+
thumb: [],
|
|
2047
|
+
index: [],
|
|
2048
|
+
middle: [],
|
|
2049
|
+
ring: [],
|
|
2050
|
+
pinky: []
|
|
2051
|
+
};
|
|
2040
2052
|
function createHandPoseEntry(partial) {
|
|
2041
2053
|
return {
|
|
2042
2054
|
id: partial.id,
|
|
@@ -2044,6 +2056,14 @@ function createHandPoseEntry(partial) {
|
|
|
2044
2056
|
preset: partial.preset ?? null,
|
|
2045
2057
|
curls: { ...DEFAULT_POSE_CURLS, ...partial.curls },
|
|
2046
2058
|
tolerance: partial.tolerance ?? 0.25,
|
|
2059
|
+
directions: {
|
|
2060
|
+
thumb: [...partial.directions?.thumb ?? []],
|
|
2061
|
+
index: [...partial.directions?.index ?? []],
|
|
2062
|
+
middle: [...partial.directions?.middle ?? []],
|
|
2063
|
+
ring: [...partial.directions?.ring ?? []],
|
|
2064
|
+
pinky: [...partial.directions?.pinky ?? []]
|
|
2065
|
+
},
|
|
2066
|
+
directionTolerance: partial.directionTolerance ?? 45,
|
|
2047
2067
|
hand: partial.hand ?? null,
|
|
2048
2068
|
orientation: partial.orientation ?? null,
|
|
2049
2069
|
minHoldSeconds: partial.minHoldSeconds ?? 0.15,
|
|
@@ -2066,7 +2086,9 @@ function handPoseDefinitionFor(entry, resolvePreset) {
|
|
|
2066
2086
|
return handPoseFromCurls(entry.id, entry.name, entry.curls, {
|
|
2067
2087
|
tolerance: entry.tolerance,
|
|
2068
2088
|
orientation: entry.orientation ?? void 0,
|
|
2069
|
-
hand: entry.hand ?? void 0
|
|
2089
|
+
hand: entry.hand ?? void 0,
|
|
2090
|
+
directions: entry.directions,
|
|
2091
|
+
directionToleranceDegrees: entry.directionTolerance
|
|
2070
2092
|
});
|
|
2071
2093
|
}
|
|
2072
2094
|
__name(handPoseDefinitionFor, "handPoseDefinitionFor");
|
|
@@ -2090,6 +2112,7 @@ exports.DEFAULT_INSTANCE_TRANSFORM = DEFAULT_INSTANCE_TRANSFORM;
|
|
|
2090
2112
|
exports.DEFAULT_MESH_GEOMETRY_PARAMETERS = DEFAULT_MESH_GEOMETRY_PARAMETERS;
|
|
2091
2113
|
exports.DEFAULT_PHYSICS_STATE = DEFAULT_PHYSICS_STATE;
|
|
2092
2114
|
exports.DEFAULT_POSE_CURLS = DEFAULT_POSE_CURLS;
|
|
2115
|
+
exports.DEFAULT_POSE_DIRECTIONS = DEFAULT_POSE_DIRECTIONS;
|
|
2093
2116
|
exports.DEFAULT_POSTPROCESSING_STATE = DEFAULT_POSTPROCESSING_STATE;
|
|
2094
2117
|
exports.DEFAULT_RIGIDBODY_STATE = DEFAULT_RIGIDBODY_STATE;
|
|
2095
2118
|
exports.EntityType = EntityType;
|