@automovie/human 0.0.0 → 0.2.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/README.md +29 -16
- package/lib/generation/AutoMovieHumanDigitJoints.d.ts +8 -26
- package/lib/generation/AutoMovieHumanDigitJoints.js +9 -37
- package/lib/generation/AutoMovieHumanDigitJoints.js.map +1 -1
- package/lib/generation/{AutoMovieHumanLegSection.d.ts → AutoMovieHumanLegSectionProportion.d.ts} +1 -1
- package/lib/generation/{AutoMovieHumanLegSection.js → AutoMovieHumanLegSectionProportion.js} +17 -14
- package/lib/generation/AutoMovieHumanLegSectionProportion.js.map +1 -0
- package/lib/generation/arm/AutoMovieHumanArmFrame.js +2 -2
- package/lib/generation/arm/AutoMovieHumanArmFrame.js.map +1 -1
- package/lib/generation/arm/index.d.ts +28 -0
- package/lib/generation/arm/index.js +45 -0
- package/lib/generation/arm/index.js.map +1 -0
- package/lib/generation/conic/AutoMovieHumanConicLoft.d.ts +154 -0
- package/lib/generation/conic/AutoMovieHumanConicLoft.js +430 -0
- package/lib/generation/conic/AutoMovieHumanConicLoft.js.map +1 -0
- package/lib/generation/conic/AutoMovieHumanConicPose.d.ts +92 -0
- package/lib/generation/conic/AutoMovieHumanConicPose.js +202 -0
- package/lib/generation/conic/AutoMovieHumanConicPose.js.map +1 -0
- package/lib/generation/conic/AutoMovieHumanConicRelief.d.ts +52 -0
- package/lib/generation/conic/AutoMovieHumanConicRelief.js +88 -0
- package/lib/generation/conic/AutoMovieHumanConicRelief.js.map +1 -0
- package/lib/generation/conic/AutoMovieHumanConicSection.d.ts +252 -0
- package/lib/generation/conic/AutoMovieHumanConicSection.js +567 -0
- package/lib/generation/conic/AutoMovieHumanConicSection.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1.d.ts +265 -0
- package/lib/generation/f1/AutoMovieHumanF1.js +1254 -0
- package/lib/generation/f1/AutoMovieHumanF1.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Antihelix.d.ts +23 -0
- package/lib/generation/f1/AutoMovieHumanF1Antihelix.js +65 -0
- package/lib/generation/f1/AutoMovieHumanF1Antihelix.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Arm.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Arm.js +82 -0
- package/lib/generation/f1/AutoMovieHumanF1Arm.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Axilla.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Axilla.js +91 -0
- package/lib/generation/f1/AutoMovieHumanF1Axilla.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Breast.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Breast.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1Breast.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Concha.d.ts +40 -0
- package/lib/generation/f1/AutoMovieHumanF1Concha.js +81 -0
- package/lib/generation/f1/AutoMovieHumanF1Concha.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerIndex.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerIndex.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerIndex.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerMiddle.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerPinky.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerPinky.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerPinky.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerRing.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerRing.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerRing.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerThumb.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerThumb.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1FingerThumb.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Frames.d.ts +97 -0
- package/lib/generation/f1/AutoMovieHumanF1Frames.js +160 -0
- package/lib/generation/f1/AutoMovieHumanF1Frames.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Hand.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Hand.js +81 -0
- package/lib/generation/f1/AutoMovieHumanF1Hand.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Helix.d.ts +20 -0
- package/lib/generation/f1/AutoMovieHumanF1Helix.js +64 -0
- package/lib/generation/f1/AutoMovieHumanF1Helix.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Joints.d.ts +231 -0
- package/lib/generation/f1/AutoMovieHumanF1Joints.js +249 -0
- package/lib/generation/f1/AutoMovieHumanF1Joints.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Landmarks.d.ts +86 -0
- package/lib/generation/f1/AutoMovieHumanF1Landmarks.js +89 -0
- package/lib/generation/f1/AutoMovieHumanF1Landmarks.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Leg.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Leg.js +82 -0
- package/lib/generation/f1/AutoMovieHumanF1Leg.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Nose.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Nose.js +82 -0
- package/lib/generation/f1/AutoMovieHumanF1Nose.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Nostril.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Nostril.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1Nostril.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Placement.d.ts +75 -0
- package/lib/generation/f1/AutoMovieHumanF1Placement.js +151 -0
- package/lib/generation/f1/AutoMovieHumanF1Placement.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Placing.d.ts +45 -0
- package/lib/generation/f1/AutoMovieHumanF1Placing.js +301 -0
- package/lib/generation/f1/AutoMovieHumanF1Placing.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Plate.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Plate.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1Plate.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeBig.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeBig.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeBig.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeIndex.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeIndex.js +59 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeIndex.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeLittle.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeLittle.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeLittle.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeMiddle.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeRing.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeRing.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1ToeRing.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Trunk.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Trunk.js +79 -0
- package/lib/generation/f1/AutoMovieHumanF1Trunk.js.map +1 -0
- package/lib/generation/f1/AutoMovieHumanF1Vault.d.ts +18 -0
- package/lib/generation/f1/AutoMovieHumanF1Vault.js +75 -0
- package/lib/generation/f1/AutoMovieHumanF1Vault.js.map +1 -0
- package/lib/generation/foot/index.d.ts +51 -0
- package/lib/generation/foot/index.js +68 -0
- package/lib/generation/foot/index.js.map +1 -0
- package/lib/generation/frame/AutoMovieHumanSegmentFrame.d.ts +149 -0
- package/lib/generation/frame/AutoMovieHumanSegmentFrame.js +290 -0
- package/lib/generation/frame/AutoMovieHumanSegmentFrame.js.map +1 -0
- package/lib/generation/hand/index.d.ts +53 -0
- package/lib/generation/hand/index.js +70 -0
- package/lib/generation/hand/index.js.map +1 -0
- package/lib/generation/head/index.d.ts +37 -0
- package/lib/generation/head/index.js +54 -0
- package/lib/generation/head/index.js.map +1 -0
- package/lib/generation/index.d.ts +176 -0
- package/lib/generation/index.js +193 -0
- package/lib/generation/index.js.map +1 -0
- package/lib/generation/leg/AutoMovieHumanLegLaws.d.ts +1 -1
- package/lib/generation/leg/AutoMovieHumanLegLaws.js +23 -11
- package/lib/generation/leg/AutoMovieHumanLegLaws.js.map +1 -1
- package/lib/generation/leg/index.d.ts +34 -0
- package/lib/generation/leg/index.js +51 -0
- package/lib/generation/leg/index.js.map +1 -0
- package/lib/generation/limb/{AutoMovieHumanJointTurn.d.ts → AutoMovieHumanBendArc.d.ts} +1 -1
- package/lib/generation/limb/{AutoMovieHumanJointTurn.js → AutoMovieHumanBendArc.js} +12 -8
- package/lib/generation/limb/AutoMovieHumanBendArc.js.map +1 -0
- package/lib/generation/limb/AutoMovieHumanDigitWalk.js +2 -2
- package/lib/generation/limb/AutoMovieHumanDigitWalk.js.map +1 -1
- package/lib/generation/limb/AutoMovieHumanWalkPart.js +72 -17
- package/lib/generation/limb/AutoMovieHumanWalkPart.js.map +1 -1
- package/lib/generation/limb/index.d.ts +12 -0
- package/lib/generation/limb/index.js +29 -0
- package/lib/generation/limb/index.js.map +1 -0
- package/lib/generation/trunk/index.d.ts +17 -0
- package/lib/generation/trunk/index.js +34 -0
- package/lib/generation/trunk/index.js.map +1 -0
- package/lib/generation/web/index.d.ts +14 -0
- package/lib/generation/web/index.js +31 -0
- package/lib/generation/web/index.js.map +1 -0
- package/lib/index.d.ts +14 -4
- package/lib/index.js +14 -9
- package/lib/index.js.map +1 -1
- package/lib/lofting/index.d.ts +14 -0
- package/lib/lofting/index.js +31 -0
- package/lib/lofting/index.js.map +1 -0
- package/lib/skeleton/AutoMovieHumanCanonicalBody.d.ts +7 -3
- package/lib/skeleton/AutoMovieHumanCanonicalBody.js +31 -3
- package/lib/skeleton/AutoMovieHumanCanonicalBody.js.map +1 -1
- package/lib/skeleton/AutoMovieHumanCanonicalProfile.d.ts +22 -31
- package/lib/skeleton/AutoMovieHumanCanonicalProfile.js +112 -172
- package/lib/skeleton/AutoMovieHumanCanonicalProfile.js.map +1 -1
- package/lib/skeleton/AutoMovieHumanCanonicalSolids.d.ts +65 -0
- package/lib/skeleton/AutoMovieHumanCanonicalSolids.js +105 -0
- package/lib/skeleton/AutoMovieHumanCanonicalSolids.js.map +1 -0
- package/lib/skeleton/index.d.ts +29 -0
- package/lib/skeleton/index.js +46 -0
- package/lib/skeleton/index.js.map +1 -0
- package/lib/structures/index.d.ts +2 -2
- package/lib/structures/index.js +2 -2
- package/lib/structures/index.js.map +1 -1
- package/lib/typings/index.d.ts +1 -1
- package/lib/typings/index.js +1 -1
- package/lib/typings/index.js.map +1 -1
- package/package.json +21 -13
- package/src/generation/AutoMovieHumanDigitJoints.ts +12 -47
- package/src/generation/{AutoMovieHumanLegSection.ts → AutoMovieHumanLegSectionProportion.ts} +15 -6
- package/src/generation/arm/AutoMovieHumanArmFrame.ts +2 -2
- package/src/generation/arm/index.ts +28 -0
- package/src/generation/conic/AutoMovieHumanConicLoft.ts +566 -0
- package/src/generation/conic/AutoMovieHumanConicPose.ts +213 -0
- package/src/generation/conic/AutoMovieHumanConicRelief.ts +94 -0
- package/src/generation/conic/AutoMovieHumanConicSection.ts +609 -0
- package/src/generation/f1/AutoMovieHumanF1.ts +1448 -0
- package/src/generation/f1/AutoMovieHumanF1Antihelix.ts +64 -0
- package/src/generation/f1/AutoMovieHumanF1Arm.ts +82 -0
- package/src/generation/f1/AutoMovieHumanF1Axilla.ts +90 -0
- package/src/generation/f1/AutoMovieHumanF1Breast.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1Concha.ts +80 -0
- package/src/generation/f1/AutoMovieHumanF1FingerIndex.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1FingerMiddle.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1FingerPinky.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1FingerRing.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1FingerThumb.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1Frames.ts +191 -0
- package/src/generation/f1/AutoMovieHumanF1Hand.ts +81 -0
- package/src/generation/f1/AutoMovieHumanF1Helix.ts +63 -0
- package/src/generation/f1/AutoMovieHumanF1Joints.ts +319 -0
- package/src/generation/f1/AutoMovieHumanF1Landmarks.ts +101 -0
- package/src/generation/f1/AutoMovieHumanF1Leg.ts +82 -0
- package/src/generation/f1/AutoMovieHumanF1Nose.ts +82 -0
- package/src/generation/f1/AutoMovieHumanF1Nostril.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1Placement.ts +148 -0
- package/src/generation/f1/AutoMovieHumanF1Placing.ts +313 -0
- package/src/generation/f1/AutoMovieHumanF1Plate.ts +59 -0
- package/src/generation/f1/AutoMovieHumanF1ToeBig.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1ToeIndex.ts +58 -0
- package/src/generation/f1/AutoMovieHumanF1ToeLittle.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1ToeMiddle.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1ToeRing.ts +74 -0
- package/src/generation/f1/AutoMovieHumanF1Trunk.ts +79 -0
- package/src/generation/f1/AutoMovieHumanF1Vault.ts +74 -0
- package/src/generation/foot/index.ts +51 -0
- package/src/generation/frame/AutoMovieHumanSegmentFrame.ts +309 -0
- package/src/generation/hand/index.ts +53 -0
- package/src/generation/head/index.ts +37 -0
- package/src/generation/index.ts +176 -0
- package/src/generation/leg/AutoMovieHumanLegLaws.ts +80 -25
- package/src/generation/leg/index.ts +34 -0
- package/src/generation/limb/{AutoMovieHumanJointTurn.ts → AutoMovieHumanBendArc.ts} +39 -11
- package/src/generation/limb/AutoMovieHumanDigitWalk.ts +2 -2
- package/src/generation/limb/AutoMovieHumanWalkPart.ts +163 -41
- package/src/generation/limb/index.ts +12 -0
- package/src/generation/trunk/index.ts +17 -0
- package/src/generation/web/index.ts +14 -0
- package/src/index.ts +14 -4
- package/src/lofting/index.ts +14 -0
- package/src/skeleton/AutoMovieHumanCanonicalBody.ts +53 -3
- package/src/skeleton/AutoMovieHumanCanonicalProfile.ts +153 -358
- package/src/skeleton/AutoMovieHumanCanonicalSolids.ts +175 -0
- package/src/skeleton/index.ts +29 -0
- package/src/structures/index.ts +2 -2
- package/src/typings/index.ts +1 -1
- package/lib/generation/AutoMovieHumanLegSection.js.map +0 -1
- package/lib/generation/limb/AutoMovieHumanJointTurn.js.map +0 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Vector3,
|
|
3
|
+
physicalHullFaces,
|
|
4
|
+
physicalHullMass,
|
|
5
|
+
physicalHullNearest,
|
|
6
|
+
resolveAutoMovieHumanoidRingModules,
|
|
7
|
+
} from "@automovie/engine";
|
|
8
|
+
import type {
|
|
9
|
+
AutoMovieHumanoidBone,
|
|
10
|
+
IAutoMovieQuaternion,
|
|
11
|
+
IAutoMovieVector3,
|
|
12
|
+
} from "@automovie/interface";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The convex solids of a polygon man at the canonical T-pose rest: the
|
|
16
|
+
* convex hulls of the ring points its drawing is lofted through.
|
|
17
|
+
*
|
|
18
|
+
* The rings come from `resolveAutoMovieHumanoidRingModules`, the one owner
|
|
19
|
+
* the drawing reads too, so a solid's vertices are the drawn vertices. The
|
|
20
|
+
* owner works in Human's frame, so the canonical joints are reflected into
|
|
21
|
+
* it by `(x, y, z) -> (z, y, x)` and every ring point reflected back; a
|
|
22
|
+
* reflection keeps a convex hull a convex hull.
|
|
23
|
+
*
|
|
24
|
+
* A module is one hull while every ring point and every ring edge lies on
|
|
25
|
+
* that hull. Where a ring is narrower than the straight run between its
|
|
26
|
+
* neighbours the drawn surface is concave there, so the stack is cut at that
|
|
27
|
+
* ring and each run becomes its own hull, down to one hull for each pair of
|
|
28
|
+
* rings, which is always convex. A closing pole counts as a last ring of one
|
|
29
|
+
* point.
|
|
30
|
+
*
|
|
31
|
+
* The digits of the hand carry no solid here: a phalanx is a capsule, which
|
|
32
|
+
* a curl needs for its closed form contact.
|
|
33
|
+
*
|
|
34
|
+
* @evidence contracts/development/common.md#meaningful-documentation States the single ring owner, the frame reflection, when a module is cut into more than one hull and why the fingers are left out.
|
|
35
|
+
* @evidence contracts/development/design.md#principled-representation A solid is its hull points about its own centroid with the uniform solid's volume and principal inertia, on the rig bone that carries it; nothing is optional.
|
|
36
|
+
* @evidence contracts/development/design.md#minimal-and-owned-surface Owned by the canonical profile, its one consumer, which reads every member to make shapes and mass properties.
|
|
37
|
+
* @evidence contracts/development/design.md#prohibited-design-shortcuts No `any`, `unknown`, index signature or cast beyond naming a carrier; ring geometry and hull mathematics stay with their engine owners.
|
|
38
|
+
*/
|
|
39
|
+
export namespace AutoMovieHumanCanonicalSolids {
|
|
40
|
+
/** One drawn joint at the canonical rest. */
|
|
41
|
+
export interface IJoint {
|
|
42
|
+
/** Parent Human joint, or null at the root. */
|
|
43
|
+
parent: string | null;
|
|
44
|
+
|
|
45
|
+
/** The rig bone that carries this joint rigidly. */
|
|
46
|
+
carrier: AutoMovieHumanoidBone;
|
|
47
|
+
|
|
48
|
+
/** Rest joint centre, canonical metres. */
|
|
49
|
+
position: IAutoMovieVector3;
|
|
50
|
+
|
|
51
|
+
/** Rest tip of a leaf segment, canonical metres. */
|
|
52
|
+
tip: IAutoMovieVector3 | null;
|
|
53
|
+
|
|
54
|
+
/** Girth radius, metres. */
|
|
55
|
+
radius: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** One convex solid of the body. */
|
|
59
|
+
export interface ISolid {
|
|
60
|
+
/** Unique shape id: the module's joint, numbered when the module is cut. */
|
|
61
|
+
id: string;
|
|
62
|
+
|
|
63
|
+
/** The rig bone that carries the solid. */
|
|
64
|
+
carrier: AutoMovieHumanoidBone;
|
|
65
|
+
|
|
66
|
+
/** The solid's centroid, canonical metres. */
|
|
67
|
+
centre: IAutoMovieVector3;
|
|
68
|
+
|
|
69
|
+
/** The hull's points about the centroid, canonical axes, metres. */
|
|
70
|
+
points: IAutoMovieVector3[];
|
|
71
|
+
|
|
72
|
+
/** Volume, cubic metres. */
|
|
73
|
+
volume: number;
|
|
74
|
+
|
|
75
|
+
/** Principal moments of the uniform solid per unit mass, square metres. */
|
|
76
|
+
inertia: IAutoMovieVector3;
|
|
77
|
+
|
|
78
|
+
/** Rotation from the principal frame to the canonical axes. */
|
|
79
|
+
inertiaRotation: IAutoMovieQuaternion;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Build every solid of the body.
|
|
84
|
+
*
|
|
85
|
+
* @param joints Every drawn Human joint by id, parent before child.
|
|
86
|
+
* @returns The solids in the ring owner's module order.
|
|
87
|
+
*/
|
|
88
|
+
export function build(joints: ReadonlyMap<string, IJoint>): ISolid[] {
|
|
89
|
+
const tuple = (p: IAutoMovieVector3): [number, number, number] => [
|
|
90
|
+
p.z,
|
|
91
|
+
p.y,
|
|
92
|
+
p.x,
|
|
93
|
+
];
|
|
94
|
+
const reflect = (p: IAutoMovieVector3): IAutoMovieVector3 => ({
|
|
95
|
+
x: p.z,
|
|
96
|
+
y: p.y,
|
|
97
|
+
z: p.x,
|
|
98
|
+
});
|
|
99
|
+
// A run of rings is one hull when the hull's surface passes through
|
|
100
|
+
// every ring: no ring point is buried, and no ring edge either, since
|
|
101
|
+
// two points can lie on a hull whose surface cuts across between them.
|
|
102
|
+
const convex = (run: IAutoMovieVector3[][]): boolean => {
|
|
103
|
+
const points: IAutoMovieVector3[] = run.flat();
|
|
104
|
+
const hull: physicalHullFaces.IHull = physicalHullFaces(points);
|
|
105
|
+
return (
|
|
106
|
+
hull.buried <= hull.tolerance &&
|
|
107
|
+
run.every((ring: IAutoMovieVector3[]): boolean =>
|
|
108
|
+
ring.every(
|
|
109
|
+
(p: IAutoMovieVector3, index: number): boolean =>
|
|
110
|
+
physicalHullNearest(
|
|
111
|
+
points,
|
|
112
|
+
Vector3.lerp(p, ring[(index + 1) % ring.length]!, 0.5),
|
|
113
|
+
).distance >= -hull.tolerance,
|
|
114
|
+
),
|
|
115
|
+
)
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
const solids: ISolid[] = [];
|
|
119
|
+
for (const module of resolveAutoMovieHumanoidRingModules(
|
|
120
|
+
[...joints.entries()].map(
|
|
121
|
+
([bone, joint]): resolveAutoMovieHumanoidRingModules.IBone => ({
|
|
122
|
+
bone,
|
|
123
|
+
parent: joint.parent,
|
|
124
|
+
position: tuple(joint.position),
|
|
125
|
+
tip: joint.tip === null ? null : tuple(joint.tip),
|
|
126
|
+
radius: joint.radius,
|
|
127
|
+
}),
|
|
128
|
+
),
|
|
129
|
+
)) {
|
|
130
|
+
if (DIGIT.test(module.bone)) continue;
|
|
131
|
+
const carrier: AutoMovieHumanoidBone = joints.get(module.bone)!.carrier;
|
|
132
|
+
const layers: IAutoMovieVector3[][] = [
|
|
133
|
+
...module.rings.map(
|
|
134
|
+
(
|
|
135
|
+
ring: resolveAutoMovieHumanoidRingModules.IRing,
|
|
136
|
+
): IAutoMovieVector3[] => ring.points.map(reflect),
|
|
137
|
+
),
|
|
138
|
+
...(module.pole === null ? [] : [[reflect(module.pole)]]),
|
|
139
|
+
];
|
|
140
|
+
const runs: IAutoMovieVector3[][] = [];
|
|
141
|
+
let start: number = 0;
|
|
142
|
+
while (start + 1 < layers.length) {
|
|
143
|
+
let end: number = start + 1;
|
|
144
|
+
while (end + 1 < layers.length && convex(layers.slice(start, end + 2)))
|
|
145
|
+
end++;
|
|
146
|
+
runs.push(layers.slice(start, end + 1).flat());
|
|
147
|
+
start = end;
|
|
148
|
+
}
|
|
149
|
+
runs.forEach((points: IAutoMovieVector3[], index: number): void => {
|
|
150
|
+
const solid: ReturnType<typeof physicalHullMass> =
|
|
151
|
+
physicalHullMass(points);
|
|
152
|
+
solids.push({
|
|
153
|
+
id: runs.length === 1 ? module.bone : `${module.bone}.${index}`,
|
|
154
|
+
carrier,
|
|
155
|
+
centre: solid.centerOfMass,
|
|
156
|
+
points: points.map(
|
|
157
|
+
(p: IAutoMovieVector3): IAutoMovieVector3 => ({
|
|
158
|
+
x: p.x - solid.centerOfMass.x,
|
|
159
|
+
y: p.y - solid.centerOfMass.y,
|
|
160
|
+
z: p.z - solid.centerOfMass.z,
|
|
161
|
+
}),
|
|
162
|
+
),
|
|
163
|
+
volume: solid.volume,
|
|
164
|
+
inertia: solid.inertia,
|
|
165
|
+
inertiaRotation: solid.inertiaRotation,
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return solids;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** A phalanx of the hand, whose collider stays a capsule. */
|
|
174
|
+
const DIGIT: RegExp =
|
|
175
|
+
/(?:Thumb|Index|Middle|Ring|Little)(?:Metacarpal|Proximal|Intermediate|Distal)$/;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./AutoMovieHumanBindingInputs";
|
|
2
|
+
export * from "./AutoMovieHumanCanonicalBody";
|
|
3
|
+
export * from "./AutoMovieHumanCanonicalProfile";
|
|
4
|
+
export * from "./AutoMovieHumanCanonicalSolids";
|
|
5
|
+
export * from "./AutoMovieHumanCrotchBinding";
|
|
6
|
+
export * from "./AutoMovieHumanJointCentres";
|
|
7
|
+
export * from "./AutoMovieHumanJointTransition";
|
|
8
|
+
export * from "./AutoMovieHumanJointTurn";
|
|
9
|
+
export * from "./AutoMovieHumanLimbCapsule";
|
|
10
|
+
export * from "./AutoMovieHumanNeutral";
|
|
11
|
+
export * from "./AutoMovieHumanNeutralAnkle";
|
|
12
|
+
export * from "./AutoMovieHumanNeutralForearm";
|
|
13
|
+
export * from "./AutoMovieHumanNeutralHip";
|
|
14
|
+
export * from "./AutoMovieHumanNeutralKnuckle";
|
|
15
|
+
export * from "./AutoMovieHumanNeutralShoulder";
|
|
16
|
+
export * from "./AutoMovieHumanNeutralThumbCmc";
|
|
17
|
+
export * from "./AutoMovieHumanNeutralTurn";
|
|
18
|
+
export * from "./AutoMovieHumanPelvicShare";
|
|
19
|
+
export * from "./AutoMovieHumanPoseChannels";
|
|
20
|
+
export * from "./AutoMovieHumanPreparedKinematics";
|
|
21
|
+
export * from "./AutoMovieHumanRigControls";
|
|
22
|
+
export * from "./AutoMovieHumanSkeleton";
|
|
23
|
+
export * from "./AutoMovieHumanSkeletonMath";
|
|
24
|
+
export * from "./AutoMovieHumanSkinStep";
|
|
25
|
+
export * from "./IAutoMovieHumanBindingLimb";
|
|
26
|
+
export * from "./IAutoMovieHumanBindingLips";
|
|
27
|
+
export * from "./IAutoMovieHumanBindingPlane";
|
|
28
|
+
export * from "./IAutoMovieHumanChainRings";
|
|
29
|
+
export * from "./IAutoMovieHumanNeutralBody";
|
package/src/structures/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export * from "./IAutoMovieHumanGenerated";
|
|
2
|
+
export * from "./IAutoMovieHumanParameters";
|
|
1
3
|
export * from "./appearance";
|
|
2
4
|
export * from "./body";
|
|
3
5
|
export * from "./common";
|
|
4
6
|
export * from "./expression";
|
|
5
7
|
export * from "./head";
|
|
6
8
|
export * from "./pose";
|
|
7
|
-
export * from "./IAutoMovieHumanGenerated";
|
|
8
|
-
export * from "./IAutoMovieHumanParameters";
|
package/src/typings/index.ts
CHANGED
|
@@ -2,8 +2,8 @@ export * from "./AutoMovieHumanActionUnit";
|
|
|
2
2
|
export * from "./AutoMovieHumanExpressionSide";
|
|
3
3
|
export * from "./AutoMovieHumanHairColor";
|
|
4
4
|
export * from "./AutoMovieHumanHairCurl";
|
|
5
|
-
export * from "./AutoMovieHumanHairline";
|
|
6
5
|
export * from "./AutoMovieHumanHairStyle";
|
|
6
|
+
export * from "./AutoMovieHumanHairline";
|
|
7
7
|
export * from "./AutoMovieHumanIrisColor";
|
|
8
8
|
export * from "./AutoMovieHumanLowerUnderwear";
|
|
9
9
|
export * from "./AutoMovieHumanPopulation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMovieHumanLegSection.js","sourceRoot":"","sources":["../../src/generation/AutoMovieHumanLegSection.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,IAAiB,wBAAwB,CAoExC;AApED,WAAiB,wBAAwB;IAavC,iCAAiC;IACpB,6BAAI,GAAoB;QACnC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7C,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7C,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC7C,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC9C,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EA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