Skip to content

max-mapper/player-physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

an attempt at first person shooter physics for three.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •