topical media & game development
mobile-query-three-vendor-threex.dragpancontrols.js / js
@namespace
var THREEx = THREEx || {};
THREEx.DragPanControls = function(object, domElement)
{
this._object = object;
this._domElement= domElement || document;
// parameters that you can change after initialisation
this.target = new THREE.Vector3(0, 0, 0);
this.speedX = 0.03;
this.speedY = 0.03;
this.rangeX = -40;
this.rangeY = +40;
// private variables
this._mouseX = 0;
this._mouseY = 0;
var _this = this;
this._onTouchStart = function(){ _this._onTouchStart.apply(_this, arguments); };
this._onMouseMove, false );
this._domElement.addEventListener( 'touchstart', this._onTouchMove, false );
}
THREEx.DragPanControls.prototype.destroy = function()
{
this._domElement.removeEventListener( 'mousemove', this._onTouchStart,false );
this._domElement.removeEventListener( 'touchmove', this._
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.