Skip to content

Commit

Permalink
Changed default friction
Browse files Browse the repository at this point in the history
The default friction represents the friction when the object is not
colliding with a voxel.
By setting a default friction.x and friction.z to 0.95, it will fix
max-mapper/voxel-engine#85
  • Loading branch information
dyoxyne committed Jul 21, 2014
1 parent cdbf0fc commit c58bbf6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Physical(avatar, collidables, dimensions, terminal) {
this.friction = new THREE.Vector3(1, 1, 1)

this.rotation = this.avatar.rotation
this.default_friction = 1
this.default_friction = {x: 0.95, y: 1, z: 0.95}

// default yaw/pitch/roll controls to the avatar
this.yaw =
Expand Down Expand Up @@ -150,9 +150,7 @@ proto.tick = function(dt) {
world_desired.x = END.x - START.x
world_desired.y = END.y - START.y
world_desired.z = END.z - START.z
this.friction.x =
this.friction.y =
this.friction.z = this.default_friction
this.friction = this.default_friction

// save old copies, since when normally on the
// ground, this.resting.y alternates (false,-1)
Expand Down

0 comments on commit c58bbf6

Please sign in to comment.