{"name":"orbit-controls","version":"1.2.4","description":"generic controls for orbiting a target in 3D","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"clamp":"^1.0.1","defined":"^1.0.0","gl-quat":"^1.0.0","gl-vec3":"^1.0.3","mouse-event-offset":"^3.0.2","mouse-wheel":"^1.2.0","quat-from-unit-vec3":"^1.0.0","touch-pinch":"^1.0.0"},"devDependencies":{"browserify":"^13.0.0","budo":"^8.0.0","canvas-loop":"^1.0.5","draw-triangles-2d":"^1.0.0","icosphere":"^1.0.0","mesh-combine":"^1.1.0","perspective-camera":"^2.0.1","primitive-torus":"^1.0.4","standard":"^6.0.7","three":"^0.72.0","uglify-js":"^2.4.24"},"scripts":{"test":"standard","build":"npm run build-canvas && npm run build-three","start":"budo demo/canvas.js:canvas-bundle.js --dir demo --live","three":"budo demo/three.js:three-bundle.js --dir demo --live","build-canvas":"browserify demo/canvas.js | uglifyjs -cm > demo/canvas-bundle.js","build-three":"browserify demo/three.js | uglifyjs -cm > demo/three-bundle.js"},"keywords":["orbit","camera","control","controls","perpsective","perspective-camera","3d","2d","webgl","stackgl"],"repository":{"type":"git","url":"git://github.com/Jam3/orbit-controls.git"},"homepage":"https://github.com/Jam3/orbit-controls","bugs":{"url":"https://github.com/Jam3/orbit-controls/issues"},"gitHead":"1e3a5bb59ad4ba9eea41a38bc8338c6a15bccb0e","_id":"orbit-controls@1.2.4","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"integrity":"sha512-2x2MTDYrBlJEapwsPfsHcerh1WxSRHZW1i/EmNyeqTVrGPor9XR1cxQPTBahlGnYNxr6P6/kxvl8gLropxuQoA==","shasum":"d4922295964303f150d6eae7b0a54c1e90aed5fd","tarball":"http://registry-npm.ywwl.com/orbit-controls/download/orbit-controls-1.2.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRJZ0Aka1zw66T77MPd8ynWiiMJphK1eEshiusKNNH9QIhAOcDKaIx+i3zDaCwpFvEeYHhTC8urQxw6Q+lDprjLffQ"}],"size":6086,"noattachment":false,"key":"/orbit-controls/-/orbit-controls-1.2.4.tgz"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/orbit-controls-1.2.4.tgz_1515094897388_0.6613699928857386"},"directories":{},"readme":"# orbit-controls\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\n<img src=\"http://i.imgur.com/d3vtXo1.png\" width=\"75%\" />  \n\n<sup>[(demo)](http://jam3.github.io/orbit-controls/demo/canvas.html) – [(source)](./demo/canvas.js)</sup>\n\nGeneric controls for orbiting a target in 3D. Can be used to control a camera, a 3D ray, or anything with `{ position, direction }`.\n\nFeatures:\n\n- zooms on mouse wheel\n- values are smoothed with damping\n- intuitive orbiting; roll is locked\n- modular and un-opinionated; can be used in any render engine\n- zooming with two-touch pinch\n\nRoadmap:\n\n- panning with two fingers / right mouse button\n\nCan be used with any camera abstraction that uses `position` and `direction` to form the view matrix, including ThreeJS, Babylon, stackgl, etc. \n\nWell-suited alongside [perspective-camera](https://github.com/Jam3/perspective-camera).\n\n> *Note:* This module is still in development.\n\n## Example\n\n```js\nvar controls = require('orbit-controls')()\n\nfunction tick () {\n  controls.update()\n  controls.copyInto(camera.position, camera.direction, camera.up)\n}\n```\n\n## Demos\n\n- [Canvas](http://jam3.github.io/orbit-controls/demo/canvas.html)\n- [WebGL (StreetView)](http://jam3.github.io/orbit-controls/demo/three.html)\n\n## Usage\n\n[![NPM](https://nodei.co/npm/orbit-controls.png)](https://www.npmjs.com/package/orbit-controls)\n\n#### `controls = createControls([opts])`\n\n- `position` the initial position of the camera, default `[0, 0, 1]`\n- `up` the initial direction of the camera, default `[0, 1, 0]`\n- `target` the center of the orbit, default `[0, 0, 0]`\n- `phi` the initial rotation in radians, phi in spherical coordinates, default `Math.PI/2`\n- `theta` the initial rotation in radians, theta in spherical coordinates, default `0`\n- `distance` the distance from the target, default `1`\n- `damping` how fast the controls slow down, between `0` and `1`, default `0.25`\n- `rotateSpeed` the speed of the rotation, default `0.28`\n- `zoomSpeed` the speed of the zoom, default `0.0075`\n- `pinchSpeed` (coming soon) the speed of the pinch, default `0.0075`\n- `pinch` (coming soon) enable pinching, default `true`\n- `zoom` enable zooming, default `true`\n- `rotate` enable rotating, default `true`\n- `phiBounds` the bounds of the phi rotation, default `[0, Math.PI]`\n- `thetaBounds` the bounds of the theta rotation, default `[-Infinity, Infinity]`\n- `distanceBounds` the bounds of the distance, default `[0, Infinity]`\n- `parent` the parent element, default `window`\n- `element` the element, default `window`\n\n## methods\n\n#### `controls.update()`\n\nUpdate the internal position, direction, and up vectors that represent the camera.\n\n#### `controls.copyInto(position, direction, up)`\n\nApply the control's current state to a target camera.\n\nThis is purely for convenience; you can also copy the `controls.position` and other members manually.\n\n#### `controls.enable()`\n\nEnables the DOM events and input, attaching new mouse and touch events. If already enabled, this function does nothing.\n\n#### `controls.disable()`\n\nDisables the DOM events and input, detaching all events. If already disabled, this function does nothing.\n\n## properties\n\n#### `position`, `direction`, `up`\n\nVector arrays `[x, y, z]` that represent the camera controls. These are typically copied into your camera interface with:\n\n```js\nvar camera = new MyPerspectiveCamera()\ncontrols.copyInto(camera.position, camera.direction, camera.up)\n````\n\n#### `target`\n\nThe vec3 center of the orbit\n\n#### `phi`, `theta`\n\nThe initial rotation in radians, in spherical coordinates. Changing either will re-calculate the direction.\n\n#### `distance`\n\nThe distance from the target, default `1`\n\n#### `damping`\n\nHow fast the controls slow down, between `0` and `1`, default `0.25`\n\n#### `rotateSpeed`, `zoomSpeed`, `pinchSpeed`\n\nThe speed of the controls.\n\n#### `pinch`, `zoom`, `rotate`\n\nEnable pinch, zoom, and rotate\n\n#### `phiBounds`, `thetaBounds`, `distanceBounds`\n\nThe bounds of the controls\n\n#### `dragging` (read-only)\n\nReturns true if the user is currently dragging the controls.\n\n#### `pinching` (read-only)\n\nReturns true if the user is currently pinching (zooming on mobile) the controls.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/Jam3/orbit-controls/blob/master/LICENSE.md) for details.\n","publish_time":1515094897465,"_cnpm_publish_time":1515094897465,"dist-tags":{"latest":"1.2.4"}}