@plupin/character 0.2.0 → 0.3.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/anime-face.d.ts +42 -0
- package/dist/anime-face.js +14 -0
- package/dist/blob.d.ts +32 -0
- package/dist/blob.js +18 -0
- package/dist/body-presets.d.ts +85 -0
- package/dist/canvas.js +7 -7
- package/dist/chunk-09c5tps4.js +337 -0
- package/dist/chunk-60p135hw.js +103 -0
- package/dist/chunk-dpb0rnw9.js +37 -0
- package/dist/chunk-g1c0wdcj.js +825 -0
- package/dist/chunk-kber92gm.js +415 -0
- package/dist/{chunk-k5gwaq6t.js → chunk-sa2r1cxz.js} +30 -3
- package/dist/chunk-yd5zzkkg.js +313 -0
- package/dist/clips.d.ts +40 -0
- package/dist/dress.d.ts +4 -0
- package/dist/emote.d.ts +5 -3
- package/dist/gaze.d.ts +81 -0
- package/dist/gaze.js +113 -0
- package/dist/hair3d.d.ts +3 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +84 -10
- package/dist/listing.d.ts +1 -1
- package/dist/listing.js +16 -6
- package/dist/platform-body-data.d.ts +9 -0
- package/dist/platform-body.d.ts +91 -0
- package/dist/plup3d.d.ts +75 -27
- package/dist/png.d.ts +19 -2
- package/dist/pose.d.ts +7 -1
- package/dist/pose.js +1 -1
- package/dist/proportions.d.ts +31 -0
- package/dist/ragdoll.d.ts +51 -0
- package/dist/resolution.d.ts +21 -0
- package/dist/skin-map.d.ts +155 -0
- package/dist/skin-map.js +55 -0
- package/dist/skin-native.d.ts +55 -6
- package/dist/texture.d.ts +8 -0
- package/dist/three.d.ts +3 -0
- package/dist/three.js +1909 -188
- package/dist/wear3d.d.ts +99 -0
- package/dist/wearables.d.ts +203 -0
- package/dist/wearables.js +26 -0
- package/package.json +21 -1
- package/dist/chunk-ae7gp5cc.js +0 -101
- package/dist/chunk-wpbgtn0y.js +0 -179
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/blob.ts
|
|
2
|
+
import { SphereGeometry } from "three";
|
|
3
|
+
var BLOB_RADIUS = { x: 0.6, y: 0.56, z: 0.58 };
|
|
4
|
+
var BLOB_HEIGHT = BLOB_RADIUS.y * (1 + 0.62 + (1 - 0.62) * 0.3);
|
|
5
|
+
var ROUND = { shoulders: 1, waist: 1, hips: 1 };
|
|
6
|
+
var bump = (at, centre, spread) => Math.exp(-(((at - centre) / spread) ** 2));
|
|
7
|
+
function silhouetteAt(unitY, silhouette = ROUND) {
|
|
8
|
+
const shoulders = bump(unitY, -0.2, 0.2);
|
|
9
|
+
const waist = bump(unitY, -0.42, 0.12);
|
|
10
|
+
const hips = bump(unitY, -0.58, 0.14);
|
|
11
|
+
const rest = 0.35;
|
|
12
|
+
return (rest + shoulders * silhouette.shoulders + waist * silhouette.waist + hips * silhouette.hips) / (rest + shoulders + waist + hips);
|
|
13
|
+
}
|
|
14
|
+
var BLOB_SEAT = BLOB_RADIUS.y * (0.62 + (1 - 0.62) * 0.3);
|
|
15
|
+
function blobRadiusAt(y, silhouette = ROUND) {
|
|
16
|
+
const unit = Math.max(-0.62, Math.min(1, (y - BLOB_SEAT) / BLOB_RADIUS.y));
|
|
17
|
+
return Math.sqrt(Math.max(0, 1 - unit * unit)) * (1 + 0.16 * -unit) * BLOB_RADIUS.x * silhouetteAt(unit, silhouette);
|
|
18
|
+
}
|
|
19
|
+
function buildBlobGeometry(silhouette = ROUND) {
|
|
20
|
+
const geometry = new SphereGeometry(1, 40, 28);
|
|
21
|
+
const position = geometry.attributes.position;
|
|
22
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
23
|
+
for (let i = 0;i < position.count; i += 1) {
|
|
24
|
+
let y = position.getY(i);
|
|
25
|
+
const spread = (1 + 0.16 * -y) * silhouetteAt(y, silhouette);
|
|
26
|
+
if (y < -0.62)
|
|
27
|
+
y = -0.62 + (y + 0.62) * 0.3;
|
|
28
|
+
position.setXYZ(i, position.getX(i) * spread * BLOB_RADIUS.x, y * BLOB_RADIUS.y, position.getZ(i) * spread * BLOB_RADIUS.z);
|
|
29
|
+
minY = Math.min(minY, y * BLOB_RADIUS.y);
|
|
30
|
+
}
|
|
31
|
+
geometry.translate(0, -minY, 0);
|
|
32
|
+
geometry.computeBoundingBox();
|
|
33
|
+
geometry.computeVertexNormals();
|
|
34
|
+
return geometry;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { BLOB_RADIUS, BLOB_HEIGHT, ROUND, silhouetteAt, BLOB_SEAT, blobRadiusAt, buildBlobGeometry };
|