{"_id":"@dannadori/three-ik","name":"@dannadori/three-ik","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@dannadori/three-ik","version":"0.1.1","description":"inverse kinematics for three.js","main":"./build/three-ik.js","module":"./build/three-ik.module.js","scripts":{"build":"rollup -c","watch":"rollup -c -w","docs":"jsdoc -d docs src/*.js","build-demo":"rollup -c rollup.demo.config.js","version":"npm run build && npm run build-demo && npm add src/* demo/* examples/*","postversion":"git push && git push --tags && npm publish"},"author":{"name":"original:Jordan Santell","email":"jordan@jsantell.com"},"license":"MIT","devDependencies":{"babel-core":"^6.26.3","babel-plugin-external-helpers":"^6.22.0","babel-preset-env":"^1.7.0","jsdoc":"^3.6.10","rollup":"^2.72.1","rollup-plugin-babel":"^3.0.2","rollup-plugin-cleanup":"^3.2.1","rollup-plugin-commonjs":"^8.2.1","rollup-plugin-node-resolve":"^3.0.0"},"keywords":["inverse kinematics","kinematics","ik","three","three.js"],"peerDependencies":{"three":"*"},"repository":{"type":"git","url":"git+https://github.com/w-okada/THREE.IK.git"},"dependencies":{},"gitHead":"7cbad3e26ff6857d6a52b9aca4dd98992c54aca2","bugs":{"url":"https://github.com/w-okada/THREE.IK/issues"},"homepage":"https://github.com/w-okada/THREE.IK#readme","_id":"@dannadori/three-ik@0.1.1","_nodeVersion":"14.18.2","_npmVersion":"8.8.0","dist":{"integrity":"sha512-nU2IQCj7yyF52JgYj0oAoLvUqn53UTMjKJaw/8TefpsA3fGd2NCOsEsfzpE+18Z5X8xDMKbALH1TlHQ0Nje5gw==","shasum":"2f2e777e352f6dbd34db69269bf3902df6fa3f5c","tarball":"https://registry.npmjs.org/@dannadori/three-ik/-/three-ik-0.1.1.tgz","fileCount":13,"unpackedSize":101909,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCg5nZvn45x5snjyXDwHI6jMjag6VBde9WXfHI4auq2RAIhANe8HAYjzzsNAb0ZNtaWypmAwj/Rp94x4X+2Gt3L1XWI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieZL3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZNw/7BtTlD6nGg0GXKyNFiEZXj1etU9MA0lpJRRZaspFw2PM/FXOs\r\nHy2H4U+VA1LGvCUrh86l1Rsfsr7srtrOHTs84QKeGsCQMSJ3n7O+vssKMzcH\r\nPuwwYJqzvA9eEGf8SW1AepB7uvcE1E3uyzlfJ7AypgcKhKb5vVCuPzI26vSf\r\nrU9dL19n7xz5W6Xb/CB6aaKaJualcDaC1hqiakdO39Zsrs98Iw/0HdV1MMEM\r\n/5iXpW8AUyh1FeCsUsUMrWVWSGS+XfuWdII2C2BAIokqpaITMHnVit5kA1re\r\nKeb4FepRjc18eXPynEiXTlXuP3heIf2R3l+Hji0BMJUhRvQ5Ofeb3bYWXq58\r\nrQmlf5/SJQwHwQwWPnTSs0SHwzYVVwITLVEz85sfvyUc5uvudsf5mgJQPHJH\r\no5XoFwwWosyBw0Ln0rmFwM+dtQ+3ldCQK7yor8dsi/PyrPetXxvkSHhFo7RJ\r\nj23SNgVmpOEAs+JTYJImZlHcvq9LBFLrcCcPlzGJn8Dce0KDbKoICWQyw2FE\r\ngPD+GxPVUrlZoXl0wgUKEdVbdX//EZQdjv9cEHjnasID0DX2j7Vr2CQuQT1O\r\nuPeeyT3PvIzXXnP1JSWqGZDnAznbrW/ox6zBCP9uRTIMie9AwHZ3aHuRYLyA\r\nOgRfR7Pdm0hViaUrKBadBlEQz3A8DF5Csnc=\r\n=4bz+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dannadori","email":"wataru.okada@flect.co.jp"},"directories":{},"maintainers":[{"name":"dannadori","email":"wataru.okada@flect.co.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/three-ik_0.1.1_1652134647301_0.2792210219916913"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-09T22:17:27.241Z","0.1.1":"2022-05-09T22:17:27.506Z","modified":"2022-05-09T22:17:27.638Z"},"maintainers":[{"name":"dannadori","email":"wataru.okada@flect.co.jp"}],"description":"inverse kinematics for three.js","homepage":"https://github.com/w-okada/THREE.IK#readme","keywords":["inverse kinematics","kinematics","ik","three","three.js"],"repository":{"type":"git","url":"git+https://github.com/w-okada/THREE.IK.git"},"author":{"name":"original:Jordan Santell","email":"jordan@jsantell.com"},"bugs":{"url":"https://github.com/w-okada/THREE.IK/issues"},"license":"MIT","readme":"This is revised version of THREE.IK. Original is [here](https://github.com/jsantell/THREE.IK)\n\n<img src=\"https://jsantell.github.io/THREE.IK/assets/three-ik-graphic-with-text.png\" width=\"400\" />\n\n[![Build Status](http://img.shields.io/npm/v/three-ik.svg?style=flat-square)](https://www.npmjs.org/package/three-ik)\n\n# THREE.IK\n\nInverse kinematics for [three.js].\n\nA work in progress, THREE.IK supports multiple chains with multiple effectors, solved via [FABRIK] iterative solver, and a ball-joint constraint. Best way to see how this works for now is to check out the [demo], [examples], and the [docs].\n\n:warning: **work in progress/request for feedback** :warning:\n\nThere are many [open issues] regarding axis alignment, new constraints, alternative solvers, and an API overhaul. Discussion and solutions are welcome! There will be **breaking changes** between versions as an API is settled on.\n\n## Installation\n\n`$ npm install --save three three-ik`\n\nor include the build at [build/three-ik.js](build/three-ik.js):\n\n```html\n<script src=\"build/three-ik.js\"></script>\n```\n\n## Usage\n\nYou can use ES6 importing like so:\n\n```js\nimport { IK, IKChain, IKJoint, IKBallConstraint, IKHelper } from \"three-ik\";\n```\n\nAnd here's a full example if included via script tag, with THREE.IK classes\ndefined on `THREE`.\n\n```js\n// Set up scene, camera, renderer\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(\n  45,\n  window.innerWidth / window.innerHeight,\n  0.01,\n  100\n);\ncamera.position.z = 5;\nconst renderer = new THREE.WebGLRenderer();\nrenderer.setPixelRatio(window.devicePixelRatio);\nrenderer.setSize(window.innerWidth, window.innerHeight);\ndocument.body.appendChild(renderer.domElement);\n\nconst ik = new THREE.IK();\n\nconst chain = new THREE.IKChain();\nconst constraints = [new THREE.IKBallConstraint(90)];\nconst bones = [];\n\n// Create a target that the IK's effector will reach\n// for.\nconst movingTarget = new THREE.Mesh(\n  new THREE.SphereGeometry(0.1),\n  new THREE.MeshBasicMaterial({ color: 0xff0000 })\n);\nmovingTarget.position.z = 2;\nconst pivot = new THREE.Object3D();\npivot.add(movingTarget);\nscene.add(pivot);\n\n// Create a chain of THREE.Bone's, each wrapped as an IKJoint\n// and added to the IKChain\nfor (let i = 0; i < 10; i++) {\n  const bone = new THREE.Bone();\n  bone.position.y = i === 0 ? 0 : 0.5;\n\n  if (bones[i - 1]) {\n    bones[i - 1].add(bone);\n  }\n  bones.push(bone);\n\n  // The last IKJoint must be added with a `target` as an end effector.\n  const target = i === 9 ? movingTarget : null;\n  chain.add(new THREE.IKJoint(bone, { constraints }), { target });\n}\n\n// Add the chain to the IK system\nik.add(chain);\n\n// Ensure the root bone is added somewhere in the scene\nscene.add(ik.getRootBone());\n\n// Create a helper and add to the scene so we can visualize\n// the bones\nconst helper = new THREE.IKHelper(ik);\nscene.add(helper);\n\nfunction animate() {\n  pivot.rotation.x += 0.01;\n  pivot.rotation.y += 0.01;\n  pivot.rotation.z += 0.01;\n\n  ik.solve();\n\n  renderer.render(scene, camera);\n\n  requestAnimationFrame(animate);\n}\n\nanimate();\n```\n\n## Documentation\n\nFull API documentation can be found at https://jsantell.github.io/THREE.IK/docs.\n\n## Build\n\n`$ npm run build`\n\n## Logo\n\nThe logo and artwork was created by [Caitlyn Crites](http://www.caitlyncrites.com).\n\n<img src=\"https://jsantell.github.io/THREE.IK/assets/three-ik-graphic.png\" width=\"100\" />\n\n## IK Resources\n\n- [FABRIK: a fast, iterative solver for the inverse kinematics problem](http://www.andreasaristidou.com/FABRIK.html)\n- [Roblox Inverse Kinematics FABRIK](http://wiki.roblox.com/index.php?title=Inverse_kinematics#FABRIK)\n- [Create your own IK in Unity - Luis Bermudez](https://medium.com/unity3danimation/create-your-own-ik-in-unity3d-989debd86770)\n- [CCD Algorithm](https://sites.google.com/site/auraliusproject/ccd-algorithm)\n- [Inverse Kinematics with Quaternion Joint Limits - Jonathan Blow](http://number-none.com/product/IK%20with%20Quaternion%20Joint%20Limits/index.html)\n- [fullik: JS port of Caliko, Java implementation of FABRIK](https://github.com/lo-th/fullik)\n- [webIK: JS port of VRIK](https://github.com/etiennepinchon/webIK)\n- [fabrik-2d: JS 2D FABRIK](https://github.com/RGBboy/fabrik-2d)\n- [fabrik: Unity component](https://github.com/Tannz0rz/FABRIK)\n\n## License\n\nMIT License, Copyright © 2018 Jordan Santell\n\n[three.js]: https://threejs.org\n[fabrik]: http://www.andreasaristidou.com/FABRIK.html\n[open issues]: https://github.com/jsantell/THREE.IK/issues\n[demo]: https://jsantell.github.io/THREE.IK\n[examples]: https://jsantell.github.io/THREE.IK/examples\n[docs]: https://jsantell.github.io/THREE.IK/docs\n","readmeFilename":"README.md"}