{"_id":"ray-plane-intersection","_rev":"3-e335cc22d12808bd14822ec7face197b","name":"ray-plane-intersection","description":"whether a picking ray intersects with a plane","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"ray-plane-intersection","version":"1.0.0","description":"whether a picking ray intersects with a plane","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"gl-vec3":"^1.0.3"},"devDependencies":{"tape":"^4.0.0"},"scripts":{"test":"node test.js"},"keywords":["plane","ray","camera","pick","ray","picking","raycast","cast","intersect","intersection","hit","test","hittest","3d","2d","planes","plane"],"repository":{"type":"git","url":"git://github.com/mattdesl/ray-plane-intersection.git"},"homepage":"https://github.com/mattdesl/ray-plane-intersection","bugs":{"url":"https://github.com/mattdesl/ray-plane-intersection/issues"},"gitHead":"065f7b1809d0bf3a8ae61a9993edc0144e2f8f68","_id":"ray-plane-intersection@1.0.0","_shasum":"763be1cd04eddad1847af6d5e70941b7302a47bb","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"763be1cd04eddad1847af6d5e70941b7302a47bb","tarball":"https://registry.npmjs.org/ray-plane-intersection/-/ray-plane-intersection-1.0.0.tgz","integrity":"sha512-IvYRGKZi6VSSnE7dUUBTNMG/oOVTIzBplcB7s5VJUrnp1KDRbvsinDxWFv4FftCh4c7OKSwRiWkqRA3C0KhZHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFOksZw3m1b8d2CVJP5N3Bm17oN4aIfv0UfQCC+VyDlNAiBrPLaIeBpy/B5F7n7WjlpG9P5EI98EJwiiqiSwepaGlQ=="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# ray-plane-intersection\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nWhether a 3D picking ray intersects with a plane. The plane is defined as having a `normal` [x, y, z] and `distance`. \n\n```js\nvar intersect = require('ray-plane-intersection')\nvar origin = [1, 0, 4]\nvar dir = [0, 0, -1]\nvar normal = [0, 0, 1]\nvar distance = 0\n\nvar hit = intersect(out, origin, dir, normal, distance) \n\nif (hit) { //collision occurred \n  console.log(hit) // [1, 0, 0]\n}\n```\n\nThe distance can be determined with a second point on the plane, like so:\n\n```js\nvar d = -dot(normal, point)\n```\n\nPRs welcome.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/ray-plane-intersection.png)](https://www.npmjs.com/package/ray-plane-intersection)\n\n#### `hit = intersect(out, origin, direction, normal, distance)`\n\nTest whether the ray `(origin, direction)` intersects with the plane `(normal, distance)`. \n\nIf an intersection occurs, it is stored in `out` [x, y, z] and returned. Otherwise `null` is returned.\n\n## See Also\n\n- [get-plane-normal](https://www.npmjs.com/package/get-plane-normal)\n- [find-basis-3d](https://www.npmjs.com/package/find-basis-3d)\n- [ray-triangle-intersection](https://www.npmjs.com/package/ray-triangle-intersection)\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/ray-plane-intersection/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-25T13:46:06.497Z","created":"2015-05-15T05:11:13.683Z","1.0.0":"2015-05-15T05:11:13.683Z"},"homepage":"https://github.com/mattdesl/ray-plane-intersection","keywords":["plane","ray","camera","pick","ray","picking","raycast","cast","intersect","intersection","hit","test","hittest","3d","2d","planes","plane"],"repository":{"type":"git","url":"git://github.com/mattdesl/ray-plane-intersection.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/mattdesl/ray-plane-intersection/issues"},"license":"MIT","readmeFilename":"README.md"}