# voxel-throw

> Pick up and throw voxels in voxel.js

Latest version **0.2.0** (published 2013-03-06) · 0 weekly downloads

## Install

```sh
npm install voxel-throw
pnpm add voxel-throw
yarn add voxel-throw
bun add voxel-throw
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2013-03-06 |
| First published | 2013-01-22 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Kyle Robinson Young |
| Maintainers | shama |
| Keywords | voxel, throw, pickup |

## Links

- npm: https://www.npmjs.com/package/voxel-throw
- Repository: https://github.com/shama/voxel-throw
- Issues: https://github.com/shama/voxel-throw/issues
- npm.io page: https://npm.io/package/voxel-throw

## Dependencies (1)

- [voxel-trajectory](https://npm.io/package/voxel-trajectory.md) ~0.1.0

## Recent versions

- 0.2.0 (latest) — 2013-03-06
- 0.1.1 — 2013-01-22
- 0.1.0 — 2013-01-22

## README

# voxel-throw

> Pick up and throw voxels in [voxel.js](https://github.com/maxogden/voxel-engine).

[View this example](http://shama.github.com/voxel-throw)

# example

``` js
// create a throwing thing and give it a copy of the game
var pickupOrThrow = require('voxel-throw')(game);

// on mouse down either pick up or throw a voxel
window.addEventListener('mouseup', function() {
  pickupOrThrow(/* velocity, {x: angle, y: angle} */);
}, false);
```

Or if you just want to throw your own item, like a rock:

```js
var throwthis = require('voxel-throw')(game);

var rock = {
  mesh: new game.THREE.Mesh(
    new game.THREE.CubeGeometry(4, 4, 4),
    new game.THREE.MeshBasicMaterial({color:0x333333})
  ),
  size: 4,
  collisionRadius: 4,
  resting: false
};

window.addEventListener('mouseup', function() {
  throwthis(rock);
}, false);
```

# install

With [npm](https://npmjs.org) do:

```
npm install voxel-throw
```

Use [browserify](http://browserify.org) to `require('voxel-throw')`.

## release history
* 0.2.0 - Updates for voxel-engine@0.10.0 (thanks @HowlingEverett!)
* 0.1.1 - ability to override the item thrown
* 0.1.0 - initial release

## license
Copyright (c) 2013 Kyle Robinson Young<br/>
Licensed under the MIT license.

---
_Source: https://npm.io/package/voxel-throw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
