diff --git a/package.json b/package.json index 2b4232f..f217dec 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ }, "type": "module", "dependencies": { + "@tensorflow/tfjs": "^4.17.0", "lil-gui": "^0.18.2", "three": "^0.157.0" }, diff --git a/src/demo/Buddy.ts b/src/demo/Buddy.ts new file mode 100644 index 0000000..5c53289 --- /dev/null +++ b/src/demo/Buddy.ts @@ -0,0 +1,447 @@ +import * as CANNON from 'cannon-es' + + +export class HumanIO { + + muscles: Muscle[] = [] + + setMuscleContractions(contractions: number[]){ + this.muscles.forEach((muscle, idx) => muscle.setContraction(contractions[idx])) + } + + setMuscleContraction(muscle: number, factor: number) { + this.muscles[muscle].setContraction(factor) + } + + addMuscle(mus : Muscle){ + this.muscles.push(mus) + + } + + getBodyState() : number[] { + + return this.muscles.flatMap( (m) => { + var rotA = new CANNON.Vec3(); + var rotB = new CANNON.Vec3(); + m.bodyA.quaternion.toEuler(rotA) + m.bodyB.quaternion.toEuler(rotB) + + //TODO: If needed, delete the unneccesary muscles because theyre duplicate + return [m.currentContraction].concat(rotA.vsub(rotB).toArray(), rotA.toArray(), + rotB.toArray()) + } + ) + } + + +} +export class Muscle extends CANNON.Spring { + normalRestLength: number + currentContraction: number = 1 + setContraction(factor: number) { + this.restLength = this.normalRestLength * factor + this.currentContraction = factor; + } + + constructor(bodyA: CANNON.Body, bodyB: CANNON.Body, options?: { + restLength?: number; + stiffness?: number; + damping?: number; + localAnchorA?: CANNON.Vec3; + localAnchorB?: CANNON.Vec3; + worldAnchorA?: CANNON.Vec3; + worldAnchorB?: CANNON.Vec3; + }) { + super(bodyA, bodyB, options) + this.normalRestLength = this.restLength + } + } +export class Buddy { + muscleInterface: HumanIO = new HumanIO() + bodies: CANNON.Body[] = [] + constraints: CANNON.Constraint[] = [] + constructor(scale: number, angle: number, angleShoulders: number, twistAngle: number) { + var bodies = [] + var constraints = [] + const shouldersDistance = 0.5 * scale + const upperArmLength = 0.5 * scale + const lowerArmLength = 0.5 * scale + const upperArmSize = 0.2 * scale + const lowerArmSize = 0.2 * scale + const neckLength = 0.1 * scale + const headRadius = 0.25 * scale + const upperBodyLength = 0.6 * scale + const pelvisLength = 0.4 * scale + const upperLegLength = 0.5 * scale + const upperLegSize = 0.2 * scale + const lowerLegSize = 0.2 * scale + const lowerLegLength = 0.5 * scale + + const footLength = 0.15 * scale + const footWidth = 0.15 * scale + const footHeight = 0.05 * scale + const heelRadius = 0.1 * scale + + const jointPadding = 0.05 * scale + + const headShape = new CANNON.Sphere(headRadius) + const upperArmShape = new CANNON.Box( + new CANNON.Vec3(upperArmLength * 0.5 - jointPadding, upperArmSize * 0.5, upperArmSize * 0.5) + ) + const lowerArmShape = new CANNON.Box( + new CANNON.Vec3(lowerArmLength * 0.5 - jointPadding, lowerArmSize * 0.5, lowerArmSize * 0.5) + ) + const upperBodyShape = new CANNON.Box( + new CANNON.Vec3(shouldersDistance * 0.5, lowerArmSize * 0.5, upperBodyLength * 0.5 - jointPadding) + ) + const pelvisShape = new CANNON.Box( + new CANNON.Vec3(shouldersDistance * 0.5, lowerArmSize * 0.5, pelvisLength * 0.5 - jointPadding) + ) + const upperLegShape = new CANNON.Box( + new CANNON.Vec3(upperLegSize * 0.5, lowerArmSize * 0.5, upperLegLength * 0.5 - jointPadding) + ) + const lowerLegShape = new CANNON.Box( + new CANNON.Vec3(lowerLegSize * 0.5, lowerArmSize * 0.5, lowerLegLength * 0.5 - jointPadding) + ) + const heelShape = new CANNON.Cylinder(heelRadius, heelRadius, footWidth, 8) + const footShape = new CANNON.Box( + new CANNON.Vec3(footWidth, footLength, footHeight) + ) + + + + // Lower legs + const lowerLeftLeg = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3(shouldersDistance / 2, 0, lowerLegLength / 2), + }) + const lowerRightLeg = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3(-shouldersDistance / 2, 0, lowerLegLength / 2), + }) + lowerLeftLeg.addShape(lowerLegShape) + lowerRightLeg.addShape(lowerLegShape) + bodies.push(lowerLeftLeg) + bodies.push(lowerRightLeg) + + // Upper legs + const upperLeftLeg = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + shouldersDistance / 2, + 0, + lowerLeftLeg.position.z + lowerLegLength / 2 + upperLegLength / 2 + ), + }) + const upperRightLeg = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + -shouldersDistance / 2, + 0, + lowerRightLeg.position.z + lowerLegLength / 2 + upperLegLength / 2 + ), + }) + upperLeftLeg.addShape(upperLegShape) + upperRightLeg.addShape(upperLegShape) + bodies.push(upperLeftLeg) + bodies.push(upperRightLeg) + + // feet + const leftFoot = new CANNON.Body({ + mass: 0.2, + position: new CANNON.Vec3(shouldersDistance / 2, 0, lowerLeftLeg.position.z - lowerLegLength / 2 ), + }) + leftFoot.addShape(heelShape, new CANNON.Vec3(0,heelRadius, 0), new CANNON.Quaternion().setFromEuler(0, 0, Math.PI / 2)) + leftFoot.addShape(footShape, new CANNON.Vec3(0,- footLength / 2 - heelRadius,0)) + bodies.push(leftFoot) + const rightFoot = new CANNON.Body({ + mass: 0.2, + position: new CANNON.Vec3(-shouldersDistance / 2, 0, lowerRightLeg.position.z - lowerLegLength / 2 ), + }) + rightFoot.addShape(heelShape, new CANNON.Vec3(0,heelRadius, 0), new CANNON.Quaternion().setFromEuler(0, 0, Math.PI / 2)) + rightFoot.addShape(footShape, new CANNON.Vec3(0,- footLength / 2 - heelRadius,0)) + bodies.push(rightFoot) + + + // Pelvis + const pelvis = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3(0, 0, upperLeftLeg.position.z + upperLegLength / 2 + pelvisLength / 2), + }) + pelvis.addShape(pelvisShape) + bodies.push(pelvis) + + // Upper body + const upperBody = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3(0, 0, pelvis.position.z + pelvisLength / 2 + upperBodyLength / 2), + }) + upperBody.addShape(upperBodyShape) + bodies.push(upperBody) + + // Head + const head = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3(0, 0, upperBody.position.z + upperBodyLength / 2 + headRadius + neckLength), + }) + head.addShape(headShape) + bodies.push(head) + + // Upper arms + const upperLeftArm = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + shouldersDistance / 2 + upperArmLength / 2, + 0, + upperBody.position.z + upperBodyLength / 2 + ), + }) + const upperRightArm = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + -shouldersDistance / 2 - upperArmLength / 2, + 0, + upperBody.position.z + upperBodyLength / 2 + ), + }) + upperLeftArm.addShape(upperArmShape) + upperRightArm.addShape(upperArmShape) + bodies.push(upperLeftArm) + bodies.push(upperRightArm) + + // Lower arms + const lowerLeftArm = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + upperLeftArm.position.x + lowerArmLength / 2 + upperArmLength / 2, + 0, + upperLeftArm.position.z + ), + }) + const lowerRightArm = new CANNON.Body({ + mass: 1, + position: new CANNON.Vec3( + upperRightArm.position.x - lowerArmLength / 2 - upperArmLength / 2, + 0, + upperRightArm.position.z + ), + }) + lowerLeftArm.addShape(lowerArmShape) + lowerRightArm.addShape(lowerArmShape) + bodies.push(lowerLeftArm) + bodies.push(lowerRightArm) + + // Neck joint + const neckJoint = new CANNON.ConeTwistConstraint(head, upperBody, { + pivotA: new CANNON.Vec3(0, 0, -headRadius - neckLength / 2), + pivotB: new CANNON.Vec3(0, 0, upperBodyLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + constraints.push(neckJoint) + + // Knee joints + const leftKneeJoint = new CANNON.ConeTwistConstraint(lowerLeftLeg, upperLeftLeg, { + pivotA: new CANNON.Vec3(0, 0, lowerLegLength / 2), + pivotB: new CANNON.Vec3(0, 0, -upperLegLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + const rightKneeJoint = new CANNON.ConeTwistConstraint(lowerRightLeg, upperRightLeg, { + pivotA: new CANNON.Vec3(0, 0, lowerLegLength / 2), + pivotB: new CANNON.Vec3(0, 0, -upperLegLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + constraints.push(leftKneeJoint) + constraints.push(rightKneeJoint) + + const leftFootJoint = new CANNON.ConeTwistConstraint(leftFoot, lowerLeftLeg, { + pivotA: new CANNON.Vec3(0, 0, heelRadius), + pivotB: new CANNON.Vec3(0, 0, -lowerLegLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle: angle, + twistAngle: twistAngle, + }) + const rightFootJoint = new CANNON.ConeTwistConstraint(rightFoot, lowerRightLeg, { + pivotA: new CANNON.Vec3(0, 0, heelRadius), + pivotB: new CANNON.Vec3(0, 0, -lowerLegLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle: angle, + twistAngle: twistAngle, + }) + constraints.push(leftFootJoint) + constraints.push(rightFootJoint) + + + // Hip joints + const leftHipJoint = new CANNON.ConeTwistConstraint(upperLeftLeg, pelvis, { + pivotA: new CANNON.Vec3(0, 0, upperLegLength / 2), + pivotB: new CANNON.Vec3(shouldersDistance / 2, 0, -pelvisLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + const rightHipJoint = new CANNON.ConeTwistConstraint(upperRightLeg, pelvis, { + pivotA: new CANNON.Vec3(0, 0, upperLegLength / 2), + pivotB: new CANNON.Vec3(-shouldersDistance / 2, 0, -pelvisLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + constraints.push(leftHipJoint) + constraints.push(rightHipJoint) + + // Spine + const spineJoint = new CANNON.ConeTwistConstraint(pelvis, upperBody, { + pivotA: new CANNON.Vec3(0, 0, pelvisLength / 2), + pivotB: new CANNON.Vec3(0, 0, -upperBodyLength / 2), + axisA: CANNON.Vec3.UNIT_Z, + axisB: CANNON.Vec3.UNIT_Z, + angle, + twistAngle, + }) + constraints.push(spineJoint) + /* + const leftShoulder = new CANNON.PointToPointConstraint( + upperBody, + new CANNON.Vec3(shouldersDistance / 2, 0, upperBodyLength / 2), + upperLeftArm, + new CANNON.Vec3(-upperArmLength / 2, 0, 0), + ) + const rightShoulder = new CANNON.PointToPointConstraint( + upperBody, + new CANNON.Vec3(-shouldersDistance / 2, 0, upperBodyLength / 2), + upperRightArm, + new CANNON.Vec3(upperArmLength / 2, 0, 0), + )*/ + // Shoulders + const leftShoulder = new CANNON.ConeTwistConstraint(upperBody, upperLeftArm, { + pivotA: new CANNON.Vec3(shouldersDistance / 2, 0, upperBodyLength / 2), + pivotB: new CANNON.Vec3(-upperArmLength / 2, 0, 0), + axisA: CANNON.Vec3.UNIT_X, + axisB: CANNON.Vec3.UNIT_X, + angle: Math.PI, + twistAngle: Math.PI / 2 + }) + const rightShoulder = new CANNON.ConeTwistConstraint(upperBody, upperRightArm, { + pivotA: new CANNON.Vec3(-shouldersDistance / 2, 0, upperBodyLength / 2), + pivotB: new CANNON.Vec3(upperArmLength / 2, 0, 0), + axisA: CANNON.Vec3.UNIT_X, + axisB: CANNON.Vec3.UNIT_X, + angle: Math.PI, + twistAngle: Math.PI / 2 + }) + constraints.push(leftShoulder) + constraints.push(rightShoulder) + + // Elbow joint + const leftElbowJoint = new CANNON.ConeTwistConstraint(lowerLeftArm, upperLeftArm, { + pivotA: new CANNON.Vec3(-lowerArmLength / 2, 0, 0), + pivotB: new CANNON.Vec3(upperArmLength / 2, 0, 0), + axisA: CANNON.Vec3.UNIT_X, + axisB: CANNON.Vec3.UNIT_X, + angle, + twistAngle, + }) + const rightElbowJoint = new CANNON.ConeTwistConstraint(lowerRightArm, upperRightArm, { + pivotA: new CANNON.Vec3(lowerArmLength / 2, 0, 0), + pivotB: new CANNON.Vec3(-upperArmLength / 2, 0, 0), + axisA: CANNON.Vec3.UNIT_X, + axisB: CANNON.Vec3.UNIT_X, + angle, + twistAngle, + }) + constraints.push(leftElbowJoint) + constraints.push(rightElbowJoint) + + // add springs + const muscleParams = { + stiffness: 50, + damping: 5 + } + // lower leg muscles + this.createMusclesFrontBack(upperLeftLeg, lowerLeftLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) + this.createMusclesFrontBack(upperRightLeg, lowerRightLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) + + // foot muscles + // up / down + this.createMusclesFrontBack(lowerLeftLeg, leftFoot, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) + this.createMusclesFrontBack(lowerRightLeg, rightFoot, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) + // pitch + this.createMusclesFrontBack(lowerLeftLeg, leftFoot, 1, new CANNON.Vec3(lowerLegSize / 2, 0, 0), muscleParams) + this.createMusclesFrontBack(lowerRightLeg, rightFoot, 1, new CANNON.Vec3(lowerLegSize / 2, 0, 0), muscleParams) + + // upper leg muscles + // quads + this.createMusclesFrontBack(pelvis, upperLeftLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams, new CANNON.Vec3( shouldersDistance / 2, 0, 0)) + this.createMusclesFrontBack(pelvis, upperRightLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams, new CANNON.Vec3( -shouldersDistance / 2, 0, 0)) + + // spread / close + this.createMusclesFrontBack(pelvis, upperLeftLeg, 1, new CANNON.Vec3(lowerLegSize, 0, 0), muscleParams, new CANNON.Vec3( shouldersDistance / 2, 0, 0)) + this.createMusclesFrontBack(pelvis, upperRightLeg, 1, new CANNON.Vec3(-lowerLegSize, 0, 0), muscleParams, new CANNON.Vec3( -shouldersDistance / 2, 0, 0)) + + // lower body + // abs / lower back + this.createMusclesFrontBack(upperBody, pelvis, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) + // side + this.createMusclesFrontBack(upperBody, pelvis, 1, new CANNON.Vec3(shouldersDistance / 2, 0, 0), muscleParams) + + // arms + // elbows (biceps / triceps) + this.createMusclesFrontBack(upperLeftArm, lowerLeftArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams) + this.createMusclesFrontBack(upperRightArm, lowerRightArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams) + // illegal elbows + //this.createMusclesFrontBack(upperLeftArm, lowerLeftArm, upperArmLength, lowerArmLength, new CANNON.Vec3(0, upperArmSize, 0), muscleParams) + + // shoulders + // front / back + this.createMusclesFrontBack(upperBody, upperLeftArm, 1, new CANNON.Vec3(0, upperArmSize, 0), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 - upperArmSize)) + this.createMusclesFrontBack(upperBody, upperRightArm, 1, new CANNON.Vec3(0, upperArmSize, 0), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 - upperArmSize)) + // up / down + this.createMusclesFrontBack(upperBody, upperLeftArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 + upperArmSize / 2)) + this.createMusclesFrontBack(upperBody, upperRightArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 + upperArmSize / 2)) + + + // left = local x positive + + + this.bodies = bodies + this.constraints = constraints + } + + createMusclesFrontBack(bodyA: CANNON.Body, bodyB: CANNON.Body, relaxFactor: number, offset: CANNON.Vec3, params: { + stiffness: number, + damping: number + }, bodyAOffset: CANNON.Vec3 = new CANNON.Vec3(0,0,0), bodyBOffset: CANNON.Vec3 = new CANNON.Vec3(0,0,0)) { + const restLength = bodyA.position.vadd(bodyAOffset).vsub(bodyB.position.vadd(bodyBOffset)).length() + const muscleParamsFront = { + localAnchorA: offset.vadd(bodyAOffset), + localAnchorB: offset.vadd(bodyBOffset) , + restLength: restLength * relaxFactor, + stiffness: params.stiffness , + damping: params.damping, + } + const muscleParamsBack = { + localAnchorA: bodyAOffset.vadd(offset.scale(-1)), + localAnchorB: bodyBOffset.vadd(offset.scale(-1)), + restLength: restLength * relaxFactor, + stiffness: params.stiffness , + damping: params.damping, + } + + this.muscleInterface.addMuscle(new Muscle(bodyA, bodyB, muscleParamsFront)) + this.muscleInterface.addMuscle(new Muscle(bodyA, bodyB, muscleParamsBack)) + } + } + \ No newline at end of file diff --git a/src/demo/Demo.ts b/src/demo/Demo.ts index 0ed2610..0920422 100644 --- a/src/demo/Demo.ts +++ b/src/demo/Demo.ts @@ -1,9 +1,10 @@ -import { Engine } from '../engine/Engine' + import * as THREE from 'three' -import { Box } from './Box' +import * as CANNON from 'cannon-es' //import { Experience } from '../engine/Experience' import { Resource } from '../engine/Resources' -import * as CANNON from 'cannon-es' +import { Buddy, Muscle } from './Buddy' +import { Physics } from './Physics' import GUI from 'lil-gui' @@ -16,471 +17,7 @@ export function v2q(v: CANNON.Vec3) { export function q2q(v: CANNON.Quaternion) { return new THREE.Quaternion(v.x, v.y, v.z, v.w); } -export class Buddy { - muscleInterface: LowLevelMuscleInteraction = new LowLevelMuscleInteraction() - bodies: CANNON.Body[] = [] - constraints: CANNON.Constraint[] = [] - constructor(scale: number, angle: number, angleShoulders: number, twistAngle: number) { - var bodies = [] - var constraints = [] - const shouldersDistance = 0.5 * scale - const upperArmLength = 0.5 * scale - const lowerArmLength = 0.5 * scale - const upperArmSize = 0.2 * scale - const lowerArmSize = 0.2 * scale - const neckLength = 0.1 * scale - const headRadius = 0.25 * scale - const upperBodyLength = 0.6 * scale - const pelvisLength = 0.4 * scale - const upperLegLength = 0.5 * scale - const upperLegSize = 0.2 * scale - const lowerLegSize = 0.2 * scale - const lowerLegLength = 0.5 * scale - - const footLength = 0.15 * scale - const footWidth = 0.15 * scale - const footHeight = 0.05 * scale - const heelRadius = 0.1 * scale - - const jointPadding = 0.05 * scale - - const headShape = new CANNON.Sphere(headRadius) - const upperArmShape = new CANNON.Box( - new CANNON.Vec3(upperArmLength * 0.5 - jointPadding, upperArmSize * 0.5, upperArmSize * 0.5) - ) - const lowerArmShape = new CANNON.Box( - new CANNON.Vec3(lowerArmLength * 0.5 - jointPadding, lowerArmSize * 0.5, lowerArmSize * 0.5) - ) - const upperBodyShape = new CANNON.Box( - new CANNON.Vec3(shouldersDistance * 0.5, lowerArmSize * 0.5, upperBodyLength * 0.5 - jointPadding) - ) - const pelvisShape = new CANNON.Box( - new CANNON.Vec3(shouldersDistance * 0.5, lowerArmSize * 0.5, pelvisLength * 0.5 - jointPadding) - ) - const upperLegShape = new CANNON.Box( - new CANNON.Vec3(upperLegSize * 0.5, lowerArmSize * 0.5, upperLegLength * 0.5 - jointPadding) - ) - const lowerLegShape = new CANNON.Box( - new CANNON.Vec3(lowerLegSize * 0.5, lowerArmSize * 0.5, lowerLegLength * 0.5 - jointPadding) - ) - const heelShape = new CANNON.Cylinder(heelRadius, heelRadius, footWidth, 8) - const footShape = new CANNON.Box( - new CANNON.Vec3(footWidth, footLength, footHeight) - ) - - - - // Lower legs - const lowerLeftLeg = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3(shouldersDistance / 2, 0, lowerLegLength / 2), - }) - const lowerRightLeg = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3(-shouldersDistance / 2, 0, lowerLegLength / 2), - }) - lowerLeftLeg.addShape(lowerLegShape) - lowerRightLeg.addShape(lowerLegShape) - bodies.push(lowerLeftLeg) - bodies.push(lowerRightLeg) - - // Upper legs - const upperLeftLeg = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - shouldersDistance / 2, - 0, - lowerLeftLeg.position.z + lowerLegLength / 2 + upperLegLength / 2 - ), - }) - const upperRightLeg = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - -shouldersDistance / 2, - 0, - lowerRightLeg.position.z + lowerLegLength / 2 + upperLegLength / 2 - ), - }) - upperLeftLeg.addShape(upperLegShape) - upperRightLeg.addShape(upperLegShape) - bodies.push(upperLeftLeg) - bodies.push(upperRightLeg) - - // feet - const leftFoot = new CANNON.Body({ - mass: 0.2, - position: new CANNON.Vec3(shouldersDistance / 2, 0, lowerLeftLeg.position.z - lowerLegLength / 2 ), - }) - leftFoot.addShape(heelShape, new CANNON.Vec3(0,heelRadius, 0), new CANNON.Quaternion().setFromEuler(0, 0, Math.PI / 2)) - leftFoot.addShape(footShape, new CANNON.Vec3(0,- footLength / 2 - heelRadius,0)) - bodies.push(leftFoot) - const rightFoot = new CANNON.Body({ - mass: 0.2, - position: new CANNON.Vec3(-shouldersDistance / 2, 0, lowerRightLeg.position.z - lowerLegLength / 2 ), - }) - rightFoot.addShape(heelShape, new CANNON.Vec3(0,heelRadius, 0), new CANNON.Quaternion().setFromEuler(0, 0, Math.PI / 2)) - rightFoot.addShape(footShape, new CANNON.Vec3(0,- footLength / 2 - heelRadius,0)) - bodies.push(rightFoot) - - - // Pelvis - const pelvis = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3(0, 0, upperLeftLeg.position.z + upperLegLength / 2 + pelvisLength / 2), - }) - pelvis.addShape(pelvisShape) - bodies.push(pelvis) - - // Upper body - const upperBody = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3(0, 0, pelvis.position.z + pelvisLength / 2 + upperBodyLength / 2), - }) - upperBody.addShape(upperBodyShape) - bodies.push(upperBody) - - // Head - const head = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3(0, 0, upperBody.position.z + upperBodyLength / 2 + headRadius + neckLength), - }) - head.addShape(headShape) - bodies.push(head) - - // Upper arms - const upperLeftArm = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - shouldersDistance / 2 + upperArmLength / 2, - 0, - upperBody.position.z + upperBodyLength / 2 - ), - }) - const upperRightArm = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - -shouldersDistance / 2 - upperArmLength / 2, - 0, - upperBody.position.z + upperBodyLength / 2 - ), - }) - upperLeftArm.addShape(upperArmShape) - upperRightArm.addShape(upperArmShape) - bodies.push(upperLeftArm) - bodies.push(upperRightArm) - - // Lower arms - const lowerLeftArm = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - upperLeftArm.position.x + lowerArmLength / 2 + upperArmLength / 2, - 0, - upperLeftArm.position.z - ), - }) - const lowerRightArm = new CANNON.Body({ - mass: 1, - position: new CANNON.Vec3( - upperRightArm.position.x - lowerArmLength / 2 - upperArmLength / 2, - 0, - upperRightArm.position.z - ), - }) - lowerLeftArm.addShape(lowerArmShape) - lowerRightArm.addShape(lowerArmShape) - bodies.push(lowerLeftArm) - bodies.push(lowerRightArm) - - // Neck joint - const neckJoint = new CANNON.ConeTwistConstraint(head, upperBody, { - pivotA: new CANNON.Vec3(0, 0, -headRadius - neckLength / 2), - pivotB: new CANNON.Vec3(0, 0, upperBodyLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - constraints.push(neckJoint) - - // Knee joints - const leftKneeJoint = new CANNON.ConeTwistConstraint(lowerLeftLeg, upperLeftLeg, { - pivotA: new CANNON.Vec3(0, 0, lowerLegLength / 2), - pivotB: new CANNON.Vec3(0, 0, -upperLegLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - const rightKneeJoint = new CANNON.ConeTwistConstraint(lowerRightLeg, upperRightLeg, { - pivotA: new CANNON.Vec3(0, 0, lowerLegLength / 2), - pivotB: new CANNON.Vec3(0, 0, -upperLegLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - constraints.push(leftKneeJoint) - constraints.push(rightKneeJoint) - - const leftFootJoint = new CANNON.ConeTwistConstraint(leftFoot, lowerLeftLeg, { - pivotA: new CANNON.Vec3(0, 0, heelRadius), - pivotB: new CANNON.Vec3(0, 0, -lowerLegLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle: angle, - twistAngle: twistAngle, - }) - const rightFootJoint = new CANNON.ConeTwistConstraint(rightFoot, lowerRightLeg, { - pivotA: new CANNON.Vec3(0, 0, heelRadius), - pivotB: new CANNON.Vec3(0, 0, -lowerLegLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle: angle, - twistAngle: twistAngle, - }) - constraints.push(leftFootJoint) - constraints.push(rightFootJoint) - - - // Hip joints - const leftHipJoint = new CANNON.ConeTwistConstraint(upperLeftLeg, pelvis, { - pivotA: new CANNON.Vec3(0, 0, upperLegLength / 2), - pivotB: new CANNON.Vec3(shouldersDistance / 2, 0, -pelvisLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - const rightHipJoint = new CANNON.ConeTwistConstraint(upperRightLeg, pelvis, { - pivotA: new CANNON.Vec3(0, 0, upperLegLength / 2), - pivotB: new CANNON.Vec3(-shouldersDistance / 2, 0, -pelvisLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - constraints.push(leftHipJoint) - constraints.push(rightHipJoint) - - // Spine - const spineJoint = new CANNON.ConeTwistConstraint(pelvis, upperBody, { - pivotA: new CANNON.Vec3(0, 0, pelvisLength / 2), - pivotB: new CANNON.Vec3(0, 0, -upperBodyLength / 2), - axisA: CANNON.Vec3.UNIT_Z, - axisB: CANNON.Vec3.UNIT_Z, - angle, - twistAngle, - }) - constraints.push(spineJoint) - /* - const leftShoulder = new CANNON.PointToPointConstraint( - upperBody, - new CANNON.Vec3(shouldersDistance / 2, 0, upperBodyLength / 2), - upperLeftArm, - new CANNON.Vec3(-upperArmLength / 2, 0, 0), - ) - const rightShoulder = new CANNON.PointToPointConstraint( - upperBody, - new CANNON.Vec3(-shouldersDistance / 2, 0, upperBodyLength / 2), - upperRightArm, - new CANNON.Vec3(upperArmLength / 2, 0, 0), - )*/ - // Shoulders - const leftShoulder = new CANNON.ConeTwistConstraint(upperBody, upperLeftArm, { - pivotA: new CANNON.Vec3(shouldersDistance / 2, 0, upperBodyLength / 2), - pivotB: new CANNON.Vec3(-upperArmLength / 2, 0, 0), - axisA: CANNON.Vec3.UNIT_X, - axisB: CANNON.Vec3.UNIT_X, - angle: Math.PI, - twistAngle: Math.PI / 2 - }) - const rightShoulder = new CANNON.ConeTwistConstraint(upperBody, upperRightArm, { - pivotA: new CANNON.Vec3(-shouldersDistance / 2, 0, upperBodyLength / 2), - pivotB: new CANNON.Vec3(upperArmLength / 2, 0, 0), - axisA: CANNON.Vec3.UNIT_X, - axisB: CANNON.Vec3.UNIT_X, - angle: Math.PI, - twistAngle: Math.PI / 2 - }) - constraints.push(leftShoulder) - constraints.push(rightShoulder) - - // Elbow joint - const leftElbowJoint = new CANNON.ConeTwistConstraint(lowerLeftArm, upperLeftArm, { - pivotA: new CANNON.Vec3(-lowerArmLength / 2, 0, 0), - pivotB: new CANNON.Vec3(upperArmLength / 2, 0, 0), - axisA: CANNON.Vec3.UNIT_X, - axisB: CANNON.Vec3.UNIT_X, - angle, - twistAngle, - }) - const rightElbowJoint = new CANNON.ConeTwistConstraint(lowerRightArm, upperRightArm, { - pivotA: new CANNON.Vec3(lowerArmLength / 2, 0, 0), - pivotB: new CANNON.Vec3(-upperArmLength / 2, 0, 0), - axisA: CANNON.Vec3.UNIT_X, - axisB: CANNON.Vec3.UNIT_X, - angle, - twistAngle, - }) - constraints.push(leftElbowJoint) - constraints.push(rightElbowJoint) - - // add springs - const muscleParams = { - stiffness: 50, - damping: 5 - } - // lower leg muscles - this.createMusclesFrontBack(upperLeftLeg, lowerLeftLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) - this.createMusclesFrontBack(upperRightLeg, lowerRightLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) - - // foot muscles - // up / down - this.createMusclesFrontBack(lowerLeftLeg, leftFoot, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) - this.createMusclesFrontBack(lowerRightLeg, rightFoot, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) - // pitch - this.createMusclesFrontBack(lowerLeftLeg, leftFoot, 1, new CANNON.Vec3(lowerLegSize / 2, 0, 0), muscleParams) - this.createMusclesFrontBack(lowerRightLeg, rightFoot, 1, new CANNON.Vec3(lowerLegSize / 2, 0, 0), muscleParams) - - // upper leg muscles - // quads - this.createMusclesFrontBack(pelvis, upperLeftLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams, new CANNON.Vec3( shouldersDistance / 2, 0, 0)) - this.createMusclesFrontBack(pelvis, upperRightLeg, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams, new CANNON.Vec3( -shouldersDistance / 2, 0, 0)) - - // spread / close - this.createMusclesFrontBack(pelvis, upperLeftLeg, 1, new CANNON.Vec3(lowerLegSize, 0, 0), muscleParams, new CANNON.Vec3( shouldersDistance / 2, 0, 0)) - this.createMusclesFrontBack(pelvis, upperRightLeg, 1, new CANNON.Vec3(-lowerLegSize, 0, 0), muscleParams, new CANNON.Vec3( -shouldersDistance / 2, 0, 0)) - - // lower body - // abs / lower back - this.createMusclesFrontBack(upperBody, pelvis, 1, new CANNON.Vec3(0, lowerLegSize, 0), muscleParams) - // side - this.createMusclesFrontBack(upperBody, pelvis, 1, new CANNON.Vec3(shouldersDistance / 2, 0, 0), muscleParams) - - // arms - // elbows (biceps / triceps) - this.createMusclesFrontBack(upperLeftArm, lowerLeftArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams) - this.createMusclesFrontBack(upperRightArm, lowerRightArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams) - // illegal elbows - //this.createMusclesFrontBack(upperLeftArm, lowerLeftArm, upperArmLength, lowerArmLength, new CANNON.Vec3(0, upperArmSize, 0), muscleParams) - - // shoulders - // front / back - this.createMusclesFrontBack(upperBody, upperLeftArm, 1, new CANNON.Vec3(0, upperArmSize, 0), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 - upperArmSize)) - this.createMusclesFrontBack(upperBody, upperRightArm, 1, new CANNON.Vec3(0, upperArmSize, 0), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 - upperArmSize)) - // up / down - this.createMusclesFrontBack(upperBody, upperLeftArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 + upperArmSize / 2)) - this.createMusclesFrontBack(upperBody, upperRightArm, 1, new CANNON.Vec3(0, 0, upperArmSize), muscleParams, new CANNON.Vec3(0, 0, upperBodyLength / 2 + upperArmSize / 2)) - - - // left = local x positive - - - this.bodies = bodies - this.constraints = constraints - } - - createMusclesFrontBack(bodyA: CANNON.Body, bodyB: CANNON.Body, relaxFactor: number, offset: CANNON.Vec3, params: { - stiffness: number, - damping: number - }, bodyAOffset: CANNON.Vec3 = new CANNON.Vec3(0,0,0), bodyBOffset: CANNON.Vec3 = new CANNON.Vec3(0,0,0)) { - const restLength = bodyA.position.vadd(bodyAOffset).vsub(bodyB.position.vadd(bodyBOffset)).length() - const muscleParamsFront = { - localAnchorA: offset.vadd(bodyAOffset), - localAnchorB: offset.vadd(bodyBOffset) , - restLength: restLength * relaxFactor, - stiffness: params.stiffness , - damping: params.damping, - } - const muscleParamsBack = { - localAnchorA: bodyAOffset.vadd(offset.scale(-1)), - localAnchorB: bodyBOffset.vadd(offset.scale(-1)), - restLength: restLength * relaxFactor, - stiffness: params.stiffness , - damping: params.damping, - } - this.muscleInterface.muscles.push(new Muscle(bodyA, bodyB, muscleParamsFront)) - this.muscleInterface.muscles.push(new Muscle(bodyA, bodyB, muscleParamsBack)) - } -} - -export class LowLevelMuscleInteraction { - - muscles: Muscle[] = [] - setMuscleContraction(muscle: number, factor: number) { - this.muscles[muscle].setContraction(factor) - } -} -export class Muscle extends CANNON.Spring { - normalRestLength: number - currentContraction: number = 1 - setContraction(factor: number) { - this.restLength = this.normalRestLength * factor - this.currentContraction = factor; - } - - constructor(bodyA: CANNON.Body, bodyB: CANNON.Body, options?: { - restLength?: number; - stiffness?: number; - damping?: number; - localAnchorA?: CANNON.Vec3; - localAnchorB?: CANNON.Vec3; - worldAnchorA?: CANNON.Vec3; - worldAnchorB?: CANNON.Vec3; - }) { - super(bodyA, bodyB, options) - this.normalRestLength = this.restLength - } -} -export class Physics { - world: CANNON.World = new CANNON.World() - bodies: CANNON.Body[] = [] - buddy: Buddy | undefined - muscles: Muscle[] = [] - lastCallTime: number = 0 - constructor() { - this.world.gravity = new CANNON.Vec3(0,-0,0);//-9.81,0) - } - - update = () => { - // Step world - const timeStep = 1 / 60.0 - const now = performance.now() / 1000 - - if (this.lastCallTime == 0) { - this.lastCallTime = now - } - if (!this.lastCallTime) { - // last call time not saved, cant guess elapsed time. Take a simple step. - this.world.step(timeStep) - this.lastCallTime = now - return - } - - let timeSinceLastCall = now - this.lastCallTime - - let maxSubSteps = 20 - this.world.step(timeStep, timeSinceLastCall, maxSubSteps) - - this.lastCallTime = now - if (this.buddy){ - for (var i = 0; i < this.buddy.muscleInterface.muscles.length; i++) { - //this.buddy.muscleInterface.setMuscleContraction(i, Math.sin(now * (3 + i / 3) * ((i % 2) * 2 - 1)) * 0.1 + 0.8) - this.buddy.muscleInterface.setMuscleContraction(i, 1) - - } - } - - } - - - - step() { - - } - -} export class Demo { resources: Resource[] = [] diff --git a/src/demo/Learner.ts b/src/demo/Learner.ts new file mode 100644 index 0000000..dbd51d5 --- /dev/null +++ b/src/demo/Learner.ts @@ -0,0 +1 @@ +import * as TENSORFLOW from "@tensorflow/tfjs" \ No newline at end of file diff --git a/src/demo/Physics.ts b/src/demo/Physics.ts new file mode 100644 index 0000000..3eef6ef --- /dev/null +++ b/src/demo/Physics.ts @@ -0,0 +1,54 @@ + +import * as CANNON from 'cannon-es' +import { Buddy, Muscle } from './Buddy' + + + +export class Physics { + world: CANNON.World = new CANNON.World() + bodies: CANNON.Body[] = [] + buddy: Buddy | undefined + muscles: Muscle[] = [] + lastCallTime: number = 0 + constructor() { + this.world.gravity = new CANNON.Vec3(0,-0,0);//-9.81,0) + } + + update = () => { + // Step world + const timeStep = 1 / 60.0 + const now = performance.now() / 1000 + + if (this.lastCallTime == 0) { + this.lastCallTime = now + } + if (!this.lastCallTime) { + // last call time not saved, cant guess elapsed time. Take a simple step. + this.world.step(timeStep) + this.lastCallTime = now + return + } + + let timeSinceLastCall = now - this.lastCallTime + + let maxSubSteps = 20 + this.world.step(timeStep, timeSinceLastCall, maxSubSteps) + + this.lastCallTime = now + if (this.buddy){ + for (var i = 0; i < this.buddy.muscleInterface.muscles.length; i++) { + //this.buddy.muscleInterface.setMuscleContraction(i, Math.sin(now * (3 + i / 3) * ((i % 2) * 2 - 1)) * 0.1 + 0.8) + this.buddy.muscleInterface.setMuscleContraction(i, 1) + } + console.log(this.buddy.muscleInterface.muscles.length) + } + + } + + + + step() { + + } + + } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 4356703..d1d6f2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -186,6 +186,18 @@ __metadata: languageName: node linkType: hard +"@rollup/plugin-virtual@npm:^3.0.2": + version: 3.0.2 + resolution: "@rollup/plugin-virtual@npm:3.0.2" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 962bc9efece57a07c328a3d093bd1a62b9b4396a88640ac79cfc04181e06b31c4b37726ca27ded71178ace27db9b0085b43c4de823378773bb44cb233ea1340e + languageName: node + linkType: hard + "@rollup/pluginutils@npm:^5.0.2": version: 5.0.2 resolution: "@rollup/pluginutils@npm:5.0.2" @@ -202,6 +214,230 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-arm64@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-darwin-arm64@npm:1.4.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-darwin-x64@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-darwin-x64@npm:1.4.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@swc/core-linux-arm-gnueabihf@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.4.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@swc/core-linux-arm64-gnu@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm64-gnu@npm:1.4.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-arm64-musl@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-arm64-musl@npm:1.4.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-linux-x64-gnu@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-x64-gnu@npm:1.4.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-x64-musl@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-linux-x64-musl@npm:1.4.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-win32-arm64-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-arm64-msvc@npm:1.4.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-win32-ia32-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-ia32-msvc@npm:1.4.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@swc/core-win32-x64-msvc@npm:1.4.2": + version: 1.4.2 + resolution: "@swc/core-win32-x64-msvc@npm:1.4.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:^1.3.100": + version: 1.4.2 + resolution: "@swc/core@npm:1.4.2" + dependencies: + "@swc/core-darwin-arm64": 1.4.2 + "@swc/core-darwin-x64": 1.4.2 + "@swc/core-linux-arm-gnueabihf": 1.4.2 + "@swc/core-linux-arm64-gnu": 1.4.2 + "@swc/core-linux-arm64-musl": 1.4.2 + "@swc/core-linux-x64-gnu": 1.4.2 + "@swc/core-linux-x64-musl": 1.4.2 + "@swc/core-win32-arm64-msvc": 1.4.2 + "@swc/core-win32-ia32-msvc": 1.4.2 + "@swc/core-win32-x64-msvc": 1.4.2 + "@swc/counter": ^0.1.2 + "@swc/types": ^0.1.5 + peerDependencies: + "@swc/helpers": ^0.5.0 + dependenciesMeta: + "@swc/core-darwin-arm64": + optional: true + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: b17afda692b2627d3a82e589f1b29cef31bdee626a2dd997d78312dcbfc6eb701850fbab22e85f02b1261da39f0b0afb6a236c6065f6d0d7478cff939ca5a888 + languageName: node + linkType: hard + +"@swc/counter@npm:^0.1.2": + version: 0.1.3 + resolution: "@swc/counter@npm:0.1.3" + checksum: df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.5": + version: 0.1.5 + resolution: "@swc/types@npm:0.1.5" + checksum: 6aee11f62d3d805a64848e0bd5f0e0e615f958e327a9e1260056c368d7d28764d89e38bd8005a536c9bf18afbcd303edd84099d60df34a2975d62540f61df13b + languageName: node + linkType: hard + +"@tensorflow/tfjs-backend-cpu@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-backend-cpu@npm:4.17.0" + dependencies: + "@types/seedrandom": ^2.4.28 + seedrandom: ^3.0.5 + peerDependencies: + "@tensorflow/tfjs-core": 4.17.0 + checksum: f482bed84e81ccb9af9e63555bd752ebe45cfa39f70805b39c1823db20be2132e41026dee27ee3b3d33d8ddd81e3c3d16fc42f6302472c091a247f52c8a82111 + languageName: node + linkType: hard + +"@tensorflow/tfjs-backend-webgl@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-backend-webgl@npm:4.17.0" + dependencies: + "@tensorflow/tfjs-backend-cpu": 4.17.0 + "@types/offscreencanvas": ~2019.3.0 + "@types/seedrandom": ^2.4.28 + seedrandom: ^3.0.5 + peerDependencies: + "@tensorflow/tfjs-core": 4.17.0 + checksum: dbce1bfa7c1d03ec2e0b1b7bb0ded24009c4ff4dbe81175b5cfef8bc55114b3c90517ae4e43c4baac40685e57cbc34c4f57669aea30649391608faa8ae5752bb + languageName: node + linkType: hard + +"@tensorflow/tfjs-converter@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-converter@npm:4.17.0" + peerDependencies: + "@tensorflow/tfjs-core": 4.17.0 + checksum: 82dcd44799483358c1395cba00d80c77c41f8fe36e30c24c2066ed14b6194c8c0d91189a5bca83bfcdc5295cdbdc4df4a0b45d59b389964d5b05019762a1c4a9 + languageName: node + linkType: hard + +"@tensorflow/tfjs-core@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-core@npm:4.17.0" + dependencies: + "@types/long": ^4.0.1 + "@types/offscreencanvas": ~2019.7.0 + "@types/seedrandom": ^2.4.28 + "@webgpu/types": 0.1.38 + long: 4.0.0 + node-fetch: ~2.6.1 + seedrandom: ^3.0.5 + checksum: 303f912317f73b3b311b6c5205d25e0fe89310f76da5e30f8398b7e4ad36de369a6e9e066c44ab8db8c93b7b3419ab3f92debef4c86b26c0b367c5e97677fdc5 + languageName: node + linkType: hard + +"@tensorflow/tfjs-data@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-data@npm:4.17.0" + dependencies: + "@types/node-fetch": ^2.1.2 + node-fetch: ~2.6.1 + string_decoder: ^1.3.0 + peerDependencies: + "@tensorflow/tfjs-core": 4.17.0 + seedrandom: ^3.0.5 + checksum: 89428e5b804197f228f8b7c2824e14985cfc3ed797cd4f89158c350e7f79104992c26b3c00b06404adf30080df95954c8f64c35b40533acc3c05f19970f478f1 + languageName: node + linkType: hard + +"@tensorflow/tfjs-layers@npm:4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs-layers@npm:4.17.0" + peerDependencies: + "@tensorflow/tfjs-core": 4.17.0 + checksum: bd53f53a0587b516438e2be7e72adb22d8f1fd0eddc660aa4206923832d93dd2f5cdf88e9fba7e09a648fddd9a0a3f57c255caf44e871582eb1d98d6d94e6e82 + languageName: node + linkType: hard + +"@tensorflow/tfjs@npm:^4.17.0": + version: 4.17.0 + resolution: "@tensorflow/tfjs@npm:4.17.0" + dependencies: + "@tensorflow/tfjs-backend-cpu": 4.17.0 + "@tensorflow/tfjs-backend-webgl": 4.17.0 + "@tensorflow/tfjs-converter": 4.17.0 + "@tensorflow/tfjs-core": 4.17.0 + "@tensorflow/tfjs-data": 4.17.0 + "@tensorflow/tfjs-layers": 4.17.0 + argparse: ^1.0.10 + chalk: ^4.1.0 + core-js: 3.29.1 + regenerator-runtime: ^0.13.5 + yargs: ^16.0.3 + bin: + tfjs-custom-module: dist/tools/custom_module/cli.js + checksum: 866a2ba954ef17585f93f897943f1e80158c70ee31a2bdc4b9b6732d41254000d5067922c171967cccb6fee4f821c70ee0d2d37121740a5b2744279b8cc9c87c + languageName: node + linkType: hard + "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" @@ -216,6 +452,53 @@ __metadata: languageName: node linkType: hard +"@types/long@npm:^4.0.1": + version: 4.0.2 + resolution: "@types/long@npm:4.0.2" + checksum: d16cde7240d834cf44ba1eaec49e78ae3180e724cd667052b194a372f350d024cba8dd3f37b0864931683dab09ca935d52f0c4c1687178af5ada9fc85b0635f4 + languageName: node + linkType: hard + +"@types/node-fetch@npm:^2.1.2": + version: 2.6.11 + resolution: "@types/node-fetch@npm:2.6.11" + dependencies: + "@types/node": "*" + form-data: ^4.0.0 + checksum: 180e4d44c432839bdf8a25251ef8c47d51e37355ddd78c64695225de8bc5dc2b50b7bb855956d471c026bb84bd7295688a0960085e7158cbbba803053492568b + languageName: node + linkType: hard + +"@types/node@npm:*": + version: 20.11.26 + resolution: "@types/node@npm:20.11.26" + dependencies: + undici-types: ~5.26.4 + checksum: 2cd5a373d2880b7f07ae65d4d23660cdcabddb12772ce631b6caad2f9283350b8a17c802590f67f0ccec5a9c7d43ae0ecd9637c5ad870b8f793328af8c61eae5 + languageName: node + linkType: hard + +"@types/offscreencanvas@npm:~2019.3.0": + version: 2019.3.0 + resolution: "@types/offscreencanvas@npm:2019.3.0" + checksum: 006361d170aac80925b16a8c0421d5ee7bfe6acb5cd6b22407e2c28be091becc7de5ba1fd21293a1fdff70648918d9c035001ffafd4d6c49d1c5a22dab88ed0d + languageName: node + linkType: hard + +"@types/offscreencanvas@npm:~2019.7.0": + version: 2019.7.3 + resolution: "@types/offscreencanvas@npm:2019.7.3" + checksum: 53a394a65ae08eddff6e0a2a8db72abecc94f41fc8fee166e8900075d3c1ca32540ddf5b4836c37357d53a0253a03fea4d781b2db543e3f08bc1cdc2dc0fefb5 + languageName: node + linkType: hard + +"@types/seedrandom@npm:^2.4.28": + version: 2.4.34 + resolution: "@types/seedrandom@npm:2.4.34" + checksum: d9bcf58dbdbf7f3c708e6d252e15a452ee9a289905d1dedec80d18d5c57cc6ab777687da189ebc4ad8840bd2d89a6b8812c878c90f014ed5a598f09157a9ad3e + languageName: node + linkType: hard + "@types/stats.js@npm:*": version: 0.17.1 resolution: "@types/stats.js@npm:0.17.1" @@ -242,6 +525,13 @@ __metadata: languageName: node linkType: hard +"@webgpu/types@npm:0.1.38": + version: 0.1.38 + resolution: "@webgpu/types@npm:0.1.38" + checksum: a3eb01e601a22e1722a0dad4080fbaacb145a927b88479224a65a932d83dbc21308609b00dbf46acf411aedfac49ff45e222b81e6093c4abbeb2686f881b8e5d + languageName: node + linkType: hard + "abbrev@npm:1": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -302,6 +592,15 @@ __metadata: languageName: node linkType: hard +"ansi-styles@npm:^4.0.0, ansi-styles@npm:^4.1.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: ^2.0.1 + checksum: 513b44c3b2105dd14cc42a19271e80f386466c4be574bccf60b627432f9198571ebf4ab1e4c3ba17347658f4ee1711c163d574248c0c1cdc2d5917a0ad582ec4 + languageName: node + linkType: hard + "ansi-styles@npm:^6.0.0": version: 6.1.0 resolution: "ansi-styles@npm:6.1.0" @@ -343,6 +642,22 @@ __metadata: languageName: node linkType: hard +"argparse@npm:^1.0.10": + version: 1.0.10 + resolution: "argparse@npm:1.0.10" + dependencies: + sprintf-js: ~1.0.2 + checksum: 7ca6e45583a28de7258e39e13d81e925cfa25d7d4aacbf806a382d3c02fcb13403a07fb8aeef949f10a7cfe4a62da0e2e807b348a5980554cc28ee573ef95945 + languageName: node + linkType: hard + +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + "balanced-match@npm:^1.0.0": version: 1.0.2 resolution: "balanced-match@npm:1.0.2" @@ -411,6 +726,13 @@ __metadata: languageName: node linkType: hard +"cannon-es@npm:^0.20.0": + version: 0.20.0 + resolution: "cannon-es@npm:0.20.0" + checksum: a11c2a51d8f4bf314fdbe671dd03e025513e3ab98621d3260c06f2c2a11922c67bc670f98e866a21919d966ba9b19aade5b7c3f9cf507a2ed7499c85eb8934bb + languageName: node + linkType: hard + "chalk@npm:5.3.0": version: 5.3.0 resolution: "chalk@npm:5.3.0" @@ -418,6 +740,16 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^4.1.0": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + "chokidar@npm:>=3.0.0 <4.0.0": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -470,6 +802,33 @@ __metadata: languageName: node linkType: hard +"cliui@npm:^7.0.2": + version: 7.0.4 + resolution: "cliui@npm:7.0.4" + dependencies: + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + wrap-ansi: ^7.0.0 + checksum: ce2e8f578a4813806788ac399b9e866297740eecd4ad1823c27fd344d78b22c5f8597d548adbcc46f0573e43e21e751f39446c5a5e804a12aace402b7a315d7f + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: ~1.1.4 + checksum: 79e6bdb9fd479a205c71d89574fccfb22bd9053bd98c6c4d870d65c132e5e904e6034978e55b43d69fcaa7433af2016ee203ce76eeba9cfa554b373e7f7db336 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: b0445859521eb4021cd0fb0cc1a75cecf67fceecae89b63f62b201cca8d345baf8b952c966862a9d9a2632987d4f6581f0ec8d957dfacece86f0a7919316f610 + languageName: node + linkType: hard + "color-support@npm:^1.1.3": version: 1.1.3 resolution: "color-support@npm:1.1.3" @@ -486,6 +845,15 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + "commander@npm:11.0.0": version: 11.0.0 resolution: "commander@npm:11.0.0" @@ -507,6 +875,13 @@ __metadata: languageName: node linkType: hard +"core-js@npm:3.29.1": + version: 3.29.1 + resolution: "core-js@npm:3.29.1" + checksum: b38446dbfcfd3887b3d4922990da487e2c95044cb4c5717aaf95e786a4c6b218f05c056c7ed6c699169b9794a49fec890e402659d54661fc56965a0eb717e7bd + languageName: node + linkType: hard + "cross-spawn@npm:^7.0.3": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" @@ -530,6 +905,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -665,6 +1047,13 @@ __metadata: languageName: node linkType: hard +"escalade@npm:^3.1.1": + version: 3.1.2 + resolution: "escalade@npm:3.1.2" + checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 + languageName: node + linkType: hard + "estree-walker@npm:^2.0.2": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" @@ -712,6 +1101,17 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.0": + version: 4.0.0 + resolution: "form-data@npm:4.0.0" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + mime-types: ^2.1.12 + checksum: 01135bf8675f9d5c61ff18e2e2932f719ca4de964e3be90ef4c36aacfc7b9cb2fceb5eca0b7e0190e3383fe51c5b37f4cb80b62ca06a99aaabfcfd6ac7c9328c + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -763,6 +1163,13 @@ __metadata: languageName: node linkType: hard +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: b9769a836d2a98c3ee734a88ba712e62703f1df31b94b784762c433c27a386dd6029ff55c2a920c392e33657d80191edbf18c61487e198844844516f843496b9 + languageName: node + linkType: hard + "get-stream@npm:^6.0.1": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -813,6 +1220,13 @@ __metadata: languageName: node linkType: hard +"has-flag@npm:^4.0.0": + version: 4.0.0 + resolution: "has-flag@npm:4.0.0" + checksum: 261a1357037ead75e338156b1f9452c016a37dcd3283a972a30d9e4a87441ba372c8b81f818cd0fbcd9c0354b4ae7e18b9e1afa1971164aef6d18c2b6095a8ad + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -1067,6 +1481,13 @@ __metadata: languageName: node linkType: hard +"long@npm:4.0.0": + version: 4.0.0 + resolution: "long@npm:4.0.0" + checksum: 16afbe8f749c7c849db1f4de4e2e6a31ac6e617cead3bdc4f9605cb703cd20e1e9fc1a7baba674ffcca57d660a6e5b53a9e236d7b25a295d3855cca79cc06744 + languageName: node + linkType: hard + "lru-cache@npm:^6.0.0": version: 6.0.0 resolution: "lru-cache@npm:6.0.0" @@ -1131,6 +1552,22 @@ __metadata: languageName: node linkType: hard +"mime-db@npm:1.52.0": + version: 1.52.0 + resolution: "mime-db@npm:1.52.0" + checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f + languageName: node + linkType: hard + +"mime-types@npm:^2.1.12": + version: 2.1.35 + resolution: "mime-types@npm:2.1.35" + dependencies: + mime-db: 1.52.0 + checksum: 89a5b7f1def9f3af5dad6496c5ed50191ae4331cc5389d7c521c8ad28d5fdad2d06fd81baf38fed813dc4e46bb55c8145bb0ff406330818c9cf712fb2e9b3836 + languageName: node + linkType: hard + "mimic-fn@npm:^2.1.0": version: 2.1.0 resolution: "mimic-fn@npm:2.1.0" @@ -1272,6 +1709,20 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:~2.6.1": + version: 2.6.13 + resolution: "node-fetch@npm:2.6.13" + dependencies: + whatwg-url: ^5.0.0 + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + checksum: 055845ae5b4796c78c7053564745345025cf959563b3568b43c385f67d311779e6b00e5fef6ed1b79f86ba4048e4b4b722e1aa948305521b9353eb7e788912c9 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 9.1.0 resolution: "node-gyp@npm:9.1.0" @@ -1468,6 +1919,20 @@ __metadata: languageName: node linkType: hard +"regenerator-runtime@npm:^0.13.5": + version: 0.13.11 + resolution: "regenerator-runtime@npm:0.13.11" + checksum: 27481628d22a1c4e3ff551096a683b424242a216fee44685467307f14d58020af1e19660bf2e26064de946bad7eff28950eae9f8209d55723e2d9351e632bbb4 + languageName: node + linkType: hard + +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: fb47e70bf0001fdeabdc0429d431863e9475e7e43ea5f94ad86503d918423c1543361cc5166d713eaa7029dd7a3d34775af04764bebff99ef413111a5af18c80 + languageName: node + linkType: hard + "restore-cursor@npm:^4.0.0": version: 4.0.0 resolution: "restore-cursor@npm:4.0.0" @@ -1544,6 +2009,13 @@ __metadata: languageName: node linkType: hard +"seedrandom@npm:^3.0.5": + version: 3.0.5 + resolution: "seedrandom@npm:3.0.5" + checksum: 728b56bc3bc1b9ddeabd381e449b51cb31bdc0aa86e27fcd0190cea8c44613d5bcb2f6bb63ed79f78180cbe791c20b8ec31a9627f7b7fc7f476fd2bdb7e2da9f + languageName: node + linkType: hard + "semver@npm:^7.3.5": version: 7.3.7 resolution: "semver@npm:7.3.7" @@ -1630,6 +2102,13 @@ __metadata: languageName: node linkType: hard +"sprintf-js@npm:~1.0.2": + version: 1.0.3 + resolution: "sprintf-js@npm:1.0.3" + checksum: 19d79aec211f09b99ec3099b5b2ae2f6e9cdefe50bc91ac4c69144b6d3928a640bb6ae5b3def70c2e85a2c3d9f5ec2719921e3a59d3ca3ef4b2fd1a4656a0df3 + languageName: node + linkType: hard + "ssri@npm:^9.0.0": version: 9.0.1 resolution: "ssri@npm:9.0.1" @@ -1646,7 +2125,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.2.3": +"string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -1668,7 +2147,7 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:^1.1.1": +"string_decoder@npm:^1.1.1, string_decoder@npm:^1.3.0": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" dependencies: @@ -1677,7 +2156,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^6.0.1": +"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" dependencies: @@ -1702,6 +2181,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:^7.1.0": + version: 7.2.0 + resolution: "supports-color@npm:7.2.0" + dependencies: + has-flag: ^4.0.0 + checksum: 3dda818de06ebbe5b9653e07842d9479f3555ebc77e9a0280caf5a14fb877ffee9ed57007c3b78f5a6324b8dbeec648d9e97a24e2ed9fdb81ddc69ea07100f4a + languageName: node + linkType: hard + "tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.1.11 resolution: "tar@npm:6.1.11" @@ -1727,7 +2215,9 @@ __metadata: version: 0.0.0-use.local resolution: "threejs-ts-starter@workspace:." dependencies: + "@tensorflow/tfjs": ^4.17.0 "@types/three": ^0.156.0 + cannon-es: ^0.20.0 husky: ^8.0.3 lil-gui: ^0.18.2 lint-staged: ^13.3.0 @@ -1737,6 +2227,8 @@ __metadata: typescript: ^5.2.2 vite: ^4.4.11 vite-plugin-glsl: ^1.1.2 + vite-plugin-top-level-await: ^1.4.1 + vite-plugin-wasm: ^3.3.0 languageName: unknown linkType: soft @@ -1749,6 +2241,13 @@ __metadata: languageName: node linkType: hard +"tr46@npm:~0.0.3": + version: 0.0.3 + resolution: "tr46@npm:0.0.3" + checksum: 726321c5eaf41b5002e17ffbd1fb7245999a073e8979085dacd47c4b4e8068ff5777142fc6726d6ca1fd2ff16921b48788b87225cbc57c72636f6efa8efbffe3 + languageName: node + linkType: hard + "type-fest@npm:^1.0.2": version: 1.4.0 resolution: "type-fest@npm:1.4.0" @@ -1776,6 +2275,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~5.26.4": + version: 5.26.5 + resolution: "undici-types@npm:5.26.5" + checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487 + languageName: node + linkType: hard + "unique-filename@npm:^1.1.1": version: 1.1.1 resolution: "unique-filename@npm:1.1.1" @@ -1801,6 +2307,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.1": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + "vite-plugin-glsl@npm:^1.1.2": version: 1.1.2 resolution: "vite-plugin-glsl@npm:1.1.2" @@ -1812,6 +2327,28 @@ __metadata: languageName: node linkType: hard +"vite-plugin-top-level-await@npm:^1.4.1": + version: 1.4.1 + resolution: "vite-plugin-top-level-await@npm:1.4.1" + dependencies: + "@rollup/plugin-virtual": ^3.0.2 + "@swc/core": ^1.3.100 + uuid: ^9.0.1 + peerDependencies: + vite: ">=2.8" + checksum: 34fc05991ee4d34ea6d80b19d172985ba8a397016e865691ce211a1d5f47dfadfe26b873a994ac0528ac06d67cd060e3d9185508b1133dad7f016ad62a2d61fe + languageName: node + linkType: hard + +"vite-plugin-wasm@npm:^3.3.0": + version: 3.3.0 + resolution: "vite-plugin-wasm@npm:3.3.0" + peerDependencies: + vite: ^2 || ^3 || ^4 || ^5 + checksum: 844034955d6650f89988eebb543e4b3307a54d7b800365052f5b97683223d3b99640ecb22d1fd770e768239576629d975bdefc0c9545999564e206b331f0ac3b + languageName: node + linkType: hard + "vite@npm:^4.4.11": version: 4.4.11 resolution: "vite@npm:4.4.11" @@ -1852,6 +2389,23 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^3.0.0": + version: 3.0.1 + resolution: "webidl-conversions@npm:3.0.1" + checksum: c92a0a6ab95314bde9c32e1d0a6dfac83b578f8fa5f21e675bc2706ed6981bc26b7eb7e6a1fab158e5ce4adf9caa4a0aee49a52505d4d13c7be545f15021b17c + languageName: node + linkType: hard + +"whatwg-url@npm:^5.0.0": + version: 5.0.0 + resolution: "whatwg-url@npm:5.0.0" + dependencies: + tr46: ~0.0.3 + webidl-conversions: ^3.0.0 + checksum: b8daed4ad3356cc4899048a15b2c143a9aed0dfae1f611ebd55073310c7b910f522ad75d727346ad64203d7e6c79ef25eafd465f4d12775ca44b90fa82ed9e2c + languageName: node + linkType: hard + "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -1872,6 +2426,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: ^4.0.0 + string-width: ^4.1.0 + strip-ansi: ^6.0.0 + checksum: a790b846fd4505de962ba728a21aaeda189b8ee1c7568ca5e817d85930e06ef8d1689d49dbf0e881e8ef84436af3a88bc49115c2e2788d841ff1b8b5b51a608b + languageName: node + linkType: hard + "wrap-ansi@npm:^8.0.1, wrap-ansi@npm:^8.1.0": version: 8.1.0 resolution: "wrap-ansi@npm:8.1.0" @@ -1890,6 +2455,13 @@ __metadata: languageName: node linkType: hard +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 54f0fb95621ee60898a38c572c515659e51cc9d9f787fb109cef6fde4befbe1c4602dc999d30110feee37456ad0f1660fa2edcfde6a9a740f86a290999550d30 + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0" @@ -1903,3 +2475,25 @@ __metadata: checksum: 2c7bc9a7cd4c9f40d3b0b0a98e370781b68b8b7c4515720869aced2b00d92f5da1762b4ffa947f9e795d6cd6b19f410bd4d15fdd38aca7bd96df59bd9486fb54 languageName: node linkType: hard + +"yargs-parser@npm:^20.2.2": + version: 20.2.9 + resolution: "yargs-parser@npm:20.2.9" + checksum: 8bb69015f2b0ff9e17b2c8e6bfe224ab463dd00ca211eece72a4cd8a906224d2703fb8a326d36fdd0e68701e201b2a60ed7cf81ce0fd9b3799f9fe7745977ae3 + languageName: node + linkType: hard + +"yargs@npm:^16.0.3": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: b14afbb51e3251a204d81937c86a7e9d4bdbf9a2bcee38226c900d00f522969ab675703bee2a6f99f8e20103f608382936034e64d921b74df82b63c07c5e8f59 + languageName: node + linkType: hard