0.1.0 • Published 11 years ago

player-physics v0.1.0

Weekly downloads
55
License
-
Repository
github
Last release
11 years ago

player-physics

an attempt at first person shooter physics for three.js. based originally on PointerLockControls.js from @mrdoob in three.js but heavily modified

works in the client or on the server. use browserify for client side usage

built for voxeljs and used in voxel-engine

install

npm install player-physics

example

var playerPhysics = require('player-physics')
var player = playerPhysics()
player.enabled = true
player.moveForward = true
player.tick(200) // milliseconds since last tick
console.log(player.velocity)

using the streaming api with the interact module (for pointerlock):

var interact = require('interact')
var pointer = interact()
pointer.on('attain', function(movements) {
  player.enabled = true
  movements.pipe(player)
})
pointer.request()

license

BSD

0.1.0

11 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago