Skip to content

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
yomotsu committed Oct 17, 2015
1 parent f657ce9 commit a84e3ff
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 1,009 deletions.
994 changes: 0 additions & 994 deletions build/addon/meshwalk.TPS.js

This file was deleted.

1 change: 0 additions & 1 deletion build/addon/meshwalk.TPS.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion example/1_getstarted.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script src="../lib/three.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

'use strict';
Expand Down
2 changes: 1 addition & 1 deletion example/2_keyboardInput.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script src="../lib/three.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

// See demo/1_getstarted.html first
Expand Down
2 changes: 1 addition & 1 deletion example/3_cameraControl.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script src="../lib/three.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

// See demo/2_keyboardInput.html first
Expand Down
2 changes: 1 addition & 1 deletion example/4_objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script src="../lib/three.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

// See demo/2_keyboardInput.html first
Expand Down
2 changes: 1 addition & 1 deletion example/5_terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<script src="../lib/three.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

// See demo/3_cameraControl.html first
Expand Down
2 changes: 1 addition & 1 deletion example/7_conclusion.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script src="../lib/three.min.js"></script>
<script src="../lib/bluebird.min.js"></script>
<script src="../build/meshwalk.min.js"></script>
<script src="../build/addon/meshwalk.TPS.min.js"></script>
<script src="../build/meshwalk.TPS.min.js"></script>
<script>

'use strict';
Expand Down
1 change: 1 addition & 0 deletions src/TPS/KeyInputControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
)
) {

this.isMoveKeyHolded = false;
this.dispatchEvent( { type: 'movekeyrelease' } );

}
Expand Down
18 changes: 10 additions & 8 deletions src/TPS/TPSCameraControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
var modulo = function ( n, d ) {

return ( ( n % d ) + d ) % d;

}

// camera isntance of THREE.Camera
// trackObject isntance of THREE.Object3D
// params.el DOM element
Expand All @@ -26,7 +26,7 @@
THREE.EventDispatcher.prototype.apply( this );
this.camera = camera;
this.trackObject = trackObject;
this.el = params && params.el || window;
this.el = params && params.el || document.body;
this.offset = params && params.offset || new THREE.Vector3( 0, 0, 0 ),
this.radius = params && params.radius || 10;
this.minRadius = params && params.minRadius || 1;
Expand All @@ -53,7 +53,7 @@
this.el.addEventListener( 'mouseup', this._mouseupListener, false );
this.el.addEventListener( 'mousewheel', this._scrollListener, false );
this.el.addEventListener( 'DOMMouseScroll', this._scrollListener, false );

};

ns.TPSCameraControl.prototype = {
Expand All @@ -71,8 +71,8 @@
this.trackObject.matrixWorld.elements[ 14 ] + this.offset.z
);
position = new THREE.Vector3(
Math.cos( this.phi ) * Math.cos( this.theta + PI_HALF ),
Math.sin( this.phi ),
Math.cos( this.phi ) * Math.cos( this.theta + PI_HALF ),
Math.sin( this.phi ),
Math.cos( this.phi ) * Math.sin( this.theta + PI_HALF )
);
distance = this.collisionTest( position.clone().normalize() );
Expand Down Expand Up @@ -196,13 +196,15 @@
this._pointerLast.y = this.lat;
this.el.removeEventListener( 'mousemove', this._mousedragListener, false );
this.el.addEventListener( 'mousemove', this._mousedragListener, false );
document.body.className += ' js-TPSCameraDragging';

}

function onmouseup () {

this.dispatchEvent( { type: 'mouseup' } );
this.el.removeEventListener( 'mousemove', this._mousedragListener, false );
document.body.className = document.body.className.replace( / js-TPSCameraDragging/, '' );

}

Expand All @@ -223,12 +225,12 @@
function onscroll ( event ) {

event.preventDefault();

if ( event.wheelDeltaY ) {

// WebKit
this.radius -= event.wheelDeltaY * 0.05 / 5;

} else if ( event.wheelDelta ) {

// IE
Expand Down
1 change: 1 addition & 0 deletions src/core/World.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
} else if ( object instanceof ns.CharacterController ) {

this.characterPool.push( object );
object.world = this;

}

Expand Down

0 comments on commit a84e3ff

Please sign in to comment.