All Projects → maxogden → player-physics

maxogden / player-physics

Licence: other
an attempt at first person shooter physics for three.js

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].