voxel-trajectory
Calculate trajectories in voxel.js.
example
Create a trajectory to throw an item based on the direction the camera is facing:
var trajectory = ;// x,y of voxel.js cameravar camera = game;// rotate the axis -90 degs to throw forwardcamera0 -= MathPI / 2;// create an item with a velocity of 2 towards trajectoryvar item =velocity:mesh: /* ... */size: gamecubeSizeresting: false;game;
The trajectory can be from anywhere, such as a meteor:
var meteor = velocity: ;
api
trajectory([velocity:number, rotation:[x, y, z], origin:[x, y, z]])
install
With npm do:
npm install voxel-trajectory
Use browserify to require('voxel-trajectory')
.
release history
- 0.2.0 - update to use arrays
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.