controls migration
parent
1aa01c95a3
commit
af43128b0f
|
@ -118,8 +118,8 @@ GameLib.API.Controls.CONTROLS_TYPE_MOUSE = 0x3;
|
||||||
GameLib.API.Controls.FromObject = function (objectControls){
|
GameLib.API.Controls.FromObject = function (objectControls){
|
||||||
return new GameLib.API.Controls(
|
return new GameLib.API.Controls(
|
||||||
objectControls.id,
|
objectControls.id,
|
||||||
objectControls.controlsType,
|
|
||||||
objectControls.name,
|
objectControls.name,
|
||||||
|
objectControls.controlsType,
|
||||||
objectControls.domElement,
|
objectControls.domElement,
|
||||||
objectControls.parentEntity
|
objectControls.parentEntity
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
/**
|
||||||
|
* @param apiControls
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Keyboard = function(
|
||||||
|
apiControls
|
||||||
|
) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(apiControls)) {
|
||||||
|
apiControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_KEYBOARD
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLib.API.Controls.call(
|
||||||
|
this,
|
||||||
|
apiControls.id,
|
||||||
|
apiControls.name,
|
||||||
|
apiControls.controlsType,
|
||||||
|
apiControls.domElement,
|
||||||
|
apiControls.parentEntity
|
||||||
|
);
|
||||||
|
|
||||||
|
GameLib.API.Component.call(
|
||||||
|
this,
|
||||||
|
GameLib.Component.CONTROLS_KEYBOARD
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
GameLib.API.Controls.Keyboard.prototype = Object.create(GameLib.API.Controls.prototype);
|
||||||
|
GameLib.API.Controls.Keyboard.prototype.constructor = GameLib.API.Controls.Keyboard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an API.Controls.Keyboard from an Object Cast
|
||||||
|
* @param objectControls
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Keyboard.FromObject = function(objectControls) {
|
||||||
|
|
||||||
|
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
||||||
|
|
||||||
|
return new GameLib.API.Controls.Keyboard(
|
||||||
|
apiControls
|
||||||
|
);
|
||||||
|
};
|
|
@ -0,0 +1,45 @@
|
||||||
|
/**
|
||||||
|
* @param apiControls
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Mouse = function(
|
||||||
|
apiControls
|
||||||
|
) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(apiControls)) {
|
||||||
|
apiControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_MOUSE
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLib.API.Controls.call(
|
||||||
|
this,
|
||||||
|
apiControls.id,
|
||||||
|
apiControls.name,
|
||||||
|
apiControls.controlsType,
|
||||||
|
apiControls.domElement,
|
||||||
|
apiControls.parentEntity
|
||||||
|
);
|
||||||
|
|
||||||
|
GameLib.API.Component.call(
|
||||||
|
this,
|
||||||
|
GameLib.Component.CONTROLS_MOUSE
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
GameLib.API.Controls.Mouse.prototype = Object.create(GameLib.API.Controls.prototype);
|
||||||
|
GameLib.API.Controls.Mouse.prototype.constructor = GameLib.API.Controls.Mouse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an API.Controls.Mouse from an Object Cast
|
||||||
|
* @param objectControls
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Mouse.FromObject = function(objectControls) {
|
||||||
|
|
||||||
|
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
||||||
|
|
||||||
|
return new GameLib.API.Controls.Mouse(
|
||||||
|
apiControls
|
||||||
|
);
|
||||||
|
};
|
|
@ -0,0 +1,53 @@
|
||||||
|
/**
|
||||||
|
* @param apiControls
|
||||||
|
* @param sensitivity
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Touch = function(
|
||||||
|
apiControls,
|
||||||
|
sensitivity
|
||||||
|
) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(apiControls)) {
|
||||||
|
apiControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_TOUCH
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLib.API.Controls.call(
|
||||||
|
this,
|
||||||
|
apiControls.id,
|
||||||
|
apiControls.name,
|
||||||
|
apiControls.controlsType,
|
||||||
|
apiControls.domElement,
|
||||||
|
apiControls.parentEntity
|
||||||
|
);
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(sensitivity)) {
|
||||||
|
sensitivity = 5;
|
||||||
|
}
|
||||||
|
this.sensitivity = sensitivity;
|
||||||
|
|
||||||
|
GameLib.API.Component.call(
|
||||||
|
this,
|
||||||
|
GameLib.Component.CONTROLS_TOUCH
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
GameLib.API.Controls.Touch.prototype = Object.create(GameLib.API.Controls.prototype);
|
||||||
|
GameLib.API.Controls.Touch.prototype.constructor = GameLib.API.Controls.Touch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an API.Controls.Touch from an Object Cast
|
||||||
|
* @param objectControls
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
GameLib.API.Controls.Touch.FromObject = function(objectControls) {
|
||||||
|
|
||||||
|
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
||||||
|
|
||||||
|
return new GameLib.API.Controls.Touch(
|
||||||
|
apiControls,
|
||||||
|
objectControls.sensitivity
|
||||||
|
);
|
||||||
|
};
|
|
@ -36,6 +36,8 @@ GameLib.Canvas.prototype.createInstance = function() {
|
||||||
|
|
||||||
this.instance.setAttribute('id', this.id);
|
this.instance.setAttribute('id', this.id);
|
||||||
|
|
||||||
|
this.instance.setAttribute('tabindex', '1');
|
||||||
|
|
||||||
this.width = Math.round(this.width);
|
this.width = Math.round(this.width);
|
||||||
this.height = Math.round(this.height);
|
this.height = Math.round(this.height);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ GameLib.Color = function (
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
GameLib.Color.prototype = Object.create(GameLib.Component.prototype);
|
GameLib.Color.prototype = Object.create(GameLib.API.Color.prototype);
|
||||||
GameLib.Color.prototype.constructor = GameLib.Color;
|
GameLib.Color.prototype.constructor = GameLib.Color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,7 +21,7 @@ GameLib.Controls = function (
|
||||||
);
|
);
|
||||||
|
|
||||||
var linkedObjects = {
|
var linkedObjects = {
|
||||||
domElement : GameLib.DomElement
|
domElement : GameLib.Canvas
|
||||||
};
|
};
|
||||||
|
|
||||||
var delayed = false;
|
var delayed = false;
|
||||||
|
|
|
@ -108,8 +108,6 @@ GameLib.Controls.D3.Editor.prototype.toApiObject = function() {
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.D3.Editor.FromObject = function(graphics, objectControls) {
|
GameLib.Controls.D3.Editor.FromObject = function(graphics, objectControls) {
|
||||||
|
|
||||||
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
|
||||||
|
|
||||||
var apiEditorControls = GameLib.API.Controls.D3.Editor.FromObject(objectControls);
|
var apiEditorControls = GameLib.API.Controls.D3.Editor.FromObject(objectControls);
|
||||||
|
|
||||||
return new GameLib.Controls.D3.Editor(
|
return new GameLib.Controls.D3.Editor(
|
||||||
|
|
|
@ -1,14 +1,26 @@
|
||||||
/**
|
/**
|
||||||
* Keyboard Controls
|
* Keyboard Controls
|
||||||
* @param apiControls GameLib.API.Controls
|
* @param apiKeyboardControls GameLib.API.Controls
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Keyboard = function (
|
GameLib.Controls.Keyboard = function (
|
||||||
apiControls
|
apiKeyboardControls
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(apiKeyboardControls)) {
|
||||||
|
apiKeyboardControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_KEYBOARD
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLib.API.Controls.Keyboard.call(
|
||||||
|
this,
|
||||||
|
apiKeyboardControls
|
||||||
|
);
|
||||||
|
|
||||||
GameLib.Controls.call(
|
GameLib.Controls.call(
|
||||||
this,
|
this,
|
||||||
apiControls
|
apiKeyboardControls
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -58,10 +70,10 @@ GameLib.Controls.Keyboard.prototype.toApiObject = function() {
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Keyboard.FromObject = function(objectControls) {
|
GameLib.Controls.Keyboard.FromObject = function(objectControls) {
|
||||||
|
|
||||||
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
var apiKeyboardControls = GameLib.API.Controls.Keyboard.FromObject(objectControls);
|
||||||
|
|
||||||
return new GameLib.Controls.Keyboard(
|
return new GameLib.Controls.Keyboard(
|
||||||
apiControls
|
apiKeyboardControls
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
|
@ -1,14 +1,26 @@
|
||||||
/**
|
/**
|
||||||
* Mouse Controls
|
* Mouse Controls
|
||||||
* @param apiControls GameLib.API.Controls
|
* @param apiMouseControls GameLib.API.Controls
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Mouse = function (
|
GameLib.Controls.Mouse = function (
|
||||||
apiControls
|
apiMouseControls
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
if (GameLib.Utils.UndefinedOrNull(apiMouseControls)) {
|
||||||
|
apiMouseControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_MOUSE
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
GameLib.API.Controls.Mouse.call(
|
||||||
|
this,
|
||||||
|
apiMouseControls
|
||||||
|
);
|
||||||
|
|
||||||
GameLib.Controls.call(
|
GameLib.Controls.call(
|
||||||
this,
|
this,
|
||||||
apiControls
|
apiMouseControls
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -58,10 +70,10 @@ GameLib.Controls.Mouse.prototype.toApiObject = function() {
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Mouse.FromObject = function(objectControls) {
|
GameLib.Controls.Mouse.FromObject = function(objectControls) {
|
||||||
|
|
||||||
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
var apiMouseControls = GameLib.API.Controls.Mouse.FromObject(objectControls);
|
||||||
|
|
||||||
return new GameLib.Controls.Mouse(
|
return new GameLib.Controls.Mouse(
|
||||||
apiControls
|
apiMouseControls
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
|
@ -1,21 +1,27 @@
|
||||||
/**
|
/**
|
||||||
* Touch Controls
|
* Touch Controls
|
||||||
* @param apiControls GameLib.API.Controls
|
|
||||||
* @param sensitivity
|
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @param apiTouchControls
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Touch = function (
|
GameLib.Controls.Touch = function (
|
||||||
apiControls,
|
apiTouchControls
|
||||||
sensitivity
|
|
||||||
) {
|
) {
|
||||||
if (GameLib.Utils.UndefinedOrNull(sensitivity)) {
|
|
||||||
sensitivity = 5;
|
if (GameLib.Utils.UndefinedOrNull(apiTouchControls)) {
|
||||||
|
apiTouchControls = {
|
||||||
|
controlsType : GameLib.API.Controls.CONTROLS_TYPE_TOUCH
|
||||||
|
};
|
||||||
}
|
}
|
||||||
this.sensitivity = sensitivity;
|
|
||||||
|
GameLib.API.Controls.Touch.call(
|
||||||
|
this,
|
||||||
|
apiTouchControls,
|
||||||
|
apiTouchControls.sensitivity
|
||||||
|
);
|
||||||
|
|
||||||
GameLib.Controls.call(
|
GameLib.Controls.call(
|
||||||
this,
|
this,
|
||||||
apiControls
|
apiTouchControls
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,11 +75,8 @@ GameLib.Controls.Touch.prototype.toApiObject = function() {
|
||||||
*/
|
*/
|
||||||
GameLib.Controls.Touch.FromObject = function(objectControls) {
|
GameLib.Controls.Touch.FromObject = function(objectControls) {
|
||||||
|
|
||||||
var apiControls = GameLib.API.Controls.FromObject(objectControls);
|
var apiTouchControls = GameLib.API.Controls.Touch.FromObject(objectControls);
|
||||||
|
|
||||||
return new GameLib.Controls.Touch(
|
return new GameLib.Controls.Touch(apiTouchControls);
|
||||||
apiControls,
|
|
||||||
objectControls.sensitivity
|
|
||||||
);
|
|
||||||
|
|
||||||
};
|
};
|
|
@ -31,6 +31,8 @@ GameLib.D3.Mesh.Plane = function (
|
||||||
apiMeshPlane.dotObject
|
apiMeshPlane.dotObject
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.dots = [];
|
||||||
|
|
||||||
GameLib.D3.Mesh.call(
|
GameLib.D3.Mesh.call(
|
||||||
this,
|
this,
|
||||||
graphics,
|
graphics,
|
||||||
|
@ -74,7 +76,7 @@ GameLib.D3.Mesh.Plane.prototype.createInstance = function() {
|
||||||
GameLib.D3.Mesh.prototype.createInstance.call(this);
|
GameLib.D3.Mesh.prototype.createInstance.call(this);
|
||||||
|
|
||||||
if (this.isDotMap && this.dotObject) {
|
if (this.isDotMap && this.dotObject) {
|
||||||
console.log('todo: construct dotmap here')
|
this.generateDotMap();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -116,7 +118,7 @@ GameLib.D3.Mesh.Plane.prototype.updateInstance = function(property) {
|
||||||
property === 'isDotMap' ||
|
property === 'isDotMap' ||
|
||||||
property === 'dotObject'
|
property === 'dotObject'
|
||||||
) {
|
) {
|
||||||
console.log('todo: implement dotmap');
|
this.generateDotMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLib.D3.Mesh.prototype.updateInstance.call(this, property);
|
GameLib.D3.Mesh.prototype.updateInstance.call(this, property);
|
||||||
|
@ -211,6 +213,45 @@ GameLib.D3.Mesh.Plane.prototype.getHeightData = function() {
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GameLib.D3.Mesh.Plane.prototype.generateDotMap = function() {
|
||||||
|
|
||||||
|
this.dots.map(
|
||||||
|
function(dot){
|
||||||
|
this.parentScene.instance.remove(dot);
|
||||||
|
dot.geometry.dispose();
|
||||||
|
}.bind(this)
|
||||||
|
);
|
||||||
|
|
||||||
|
this.dots = [];
|
||||||
|
|
||||||
|
var data = this.getHeightData();
|
||||||
|
|
||||||
|
var width = Math.sqrt(data.length);
|
||||||
|
var height = width;
|
||||||
|
|
||||||
|
for (var x = 0; x < width; x++) {
|
||||||
|
for (var y = 0; y < height; y++ ) {
|
||||||
|
|
||||||
|
var geometry = new THREE.BoxBufferGeometry(0.5,0.5,0.5);
|
||||||
|
var dot = new THREE.Mesh(geometry, this.materials[0].instance);
|
||||||
|
dot.position.x = x;
|
||||||
|
dot.position.y = y;
|
||||||
|
dot.position.z = data[(y * width) + x];
|
||||||
|
|
||||||
|
var scale = data[(y * width) + x] / 100;
|
||||||
|
|
||||||
|
dot.scale.x = scale;
|
||||||
|
dot.scale.y = scale;
|
||||||
|
dot.scale.z = scale;
|
||||||
|
|
||||||
|
this.parentScene.instance.add(dot);
|
||||||
|
|
||||||
|
this.dots.push(dot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @returns {THREE.PlaneGeometry}
|
* @returns {THREE.PlaneGeometry}
|
||||||
|
|
|
@ -836,6 +836,19 @@ GameLib.System.GUI.prototype.buildControl = function(folder, componentTemplate,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
} else if (property === 'controlsType') {
|
||||||
|
controllers.push(
|
||||||
|
folder.add(
|
||||||
|
object,
|
||||||
|
property,
|
||||||
|
{
|
||||||
|
'touch' : GameLib.API.Controls.CONTROLS_TYPE_TOUCH,
|
||||||
|
'mouse' : GameLib.API.Controls.CONTROLS_TYPE_MOUSE,
|
||||||
|
'keyboard' : GameLib.API.Controls.CONTROLS_TYPE_KEYBOARD,
|
||||||
|
'editor' : GameLib.API.Controls.CONTROLS_TYPE_EDITOR
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
} else if (property === 'socketType') {
|
} else if (property === 'socketType') {
|
||||||
controllers.push(
|
controllers.push(
|
||||||
folder.add(
|
folder.add(
|
||||||
|
|
|
@ -315,23 +315,23 @@ GameLib.System.Input.prototype.registerTouchControls = function(touchControl) {
|
||||||
touchControl.domElement.instance.addEventListener(
|
touchControl.domElement.instance.addEventListener(
|
||||||
'touchstart',
|
'touchstart',
|
||||||
this.touchStart,
|
this.touchStart,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
touchControl.domElement.instance.addEventListener(
|
touchControl.domElement.instance.addEventListener(
|
||||||
'touchmove',
|
'touchmove',
|
||||||
this.touchMove,
|
this.touchMove,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
touchControl.domElement.instance.addEventListener(
|
touchControl.domElement.instance.addEventListener(
|
||||||
'touchend',
|
'touchend',
|
||||||
this.touchEnd,
|
this.touchEnd,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
touchControl.domElement.instance.addEventListener(
|
touchControl.domElement.instance.addEventListener(
|
||||||
'touchcancel',
|
'touchcancel',
|
||||||
this.touchCancel,
|
this.touchCancel,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -340,13 +340,13 @@ GameLib.System.Input.prototype.registerKeyboardControls = function(keyboardContr
|
||||||
keyboardControl.domElement.instance.addEventListener(
|
keyboardControl.domElement.instance.addEventListener(
|
||||||
'keyup',
|
'keyup',
|
||||||
this.keyboardKeyUp,
|
this.keyboardKeyUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
keyboardControl.domElement.instance.addEventListener(
|
keyboardControl.domElement.instance.addEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
this.keyboardKeyDown,
|
this.keyboardKeyDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -355,24 +355,24 @@ GameLib.System.Input.prototype.registerMouseControls = function(mouseControl) {
|
||||||
mouseControl.domElement.instance.addEventListener(
|
mouseControl.domElement.instance.addEventListener(
|
||||||
'mousedown',
|
'mousedown',
|
||||||
this.mouseDown,
|
this.mouseDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mouseControl.domElement.instance.addEventListener(
|
mouseControl.domElement.instance.addEventListener(
|
||||||
'mousemove',
|
'mousemove',
|
||||||
this.mouseMove,
|
this.mouseMove,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
mouseControl.domElement.instance.addEventListener(
|
mouseControl.domElement.instance.addEventListener(
|
||||||
'wheel',
|
'wheel',
|
||||||
this.mouseWheel,
|
this.mouseWheel,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mouseControl.domElement.instance.addEventListener(
|
mouseControl.domElement.instance.addEventListener(
|
||||||
'mouseup',
|
'mouseup',
|
||||||
this.mouseUp,
|
this.mouseUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -403,25 +403,25 @@ GameLib.System.Input.prototype.registerEditorControls = function(editorControl)
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'mousedown',
|
'mousedown',
|
||||||
this.mouseDownEdit,
|
this.mouseDownEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'mousemove',
|
'mousemove',
|
||||||
this.mouseMoveEdit,
|
this.mouseMoveEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
this.keyDown,
|
this.keyDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'keyup',
|
'keyup',
|
||||||
this.keyUp,
|
this.keyUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -432,13 +432,13 @@ GameLib.System.Input.prototype.registerEditorControls = function(editorControl)
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'wheel',
|
'wheel',
|
||||||
this.mouseWheelEdit,
|
this.mouseWheelEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.addEventListener(
|
editorControl.domElement.instance.addEventListener(
|
||||||
'mouseup',
|
'mouseup',
|
||||||
this.mouseUpEdit,
|
this.mouseUpEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -447,25 +447,25 @@ GameLib.System.Input.prototype.deRegisterEditorControls = function(editorControl
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'mousedown',
|
'mousedown',
|
||||||
this.mouseDownEdit,
|
this.mouseDownEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'mousemove',
|
'mousemove',
|
||||||
this.mouseMoveEdit,
|
this.mouseMoveEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
this.keyDown,
|
this.keyDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'keyup',
|
'keyup',
|
||||||
this.keyUp,
|
this.keyUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.instance.dispose();
|
editorControl.instance.dispose();
|
||||||
|
@ -473,13 +473,13 @@ GameLib.System.Input.prototype.deRegisterEditorControls = function(editorControl
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'wheel',
|
'wheel',
|
||||||
this.mouseWheelEdit,
|
this.mouseWheelEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
editorControl.domElement.instance.removeEventListener(
|
editorControl.domElement.instance.removeEventListener(
|
||||||
'mouseup',
|
'mouseup',
|
||||||
this.mouseUpEdit,
|
this.mouseUpEdit,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -489,25 +489,25 @@ GameLib.System.Input.prototype.deRegisterTouchControls = function(touchControl)
|
||||||
touchControl.domElement.instance.removeEventListener(
|
touchControl.domElement.instance.removeEventListener(
|
||||||
'touchstart',
|
'touchstart',
|
||||||
this.touchStart,
|
this.touchStart,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
touchControl.domElement.instance.removeEventListener(
|
touchControl.domElement.instance.removeEventListener(
|
||||||
'touchmove',
|
'touchmove',
|
||||||
this.touchMove,
|
this.touchMove,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
touchControl.domElement.instance.removeEventListener(
|
touchControl.domElement.instance.removeEventListener(
|
||||||
'touchend',
|
'touchend',
|
||||||
this.touchEnd,
|
this.touchEnd,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
touchControl.domElement.instance.removeEventListener(
|
touchControl.domElement.instance.removeEventListener(
|
||||||
'touchcancel',
|
'touchcancel',
|
||||||
this.touchCancel,
|
this.touchCancel,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -517,13 +517,13 @@ GameLib.System.Input.prototype.deRegisterKeyboardControls = function(keyboardCon
|
||||||
keyboardControl.domElement.instance.removeEventListener(
|
keyboardControl.domElement.instance.removeEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
this.keyboardKeyDown,
|
this.keyboardKeyDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
keyboardControl.domElement.instance.removeEventListener(
|
keyboardControl.domElement.instance.removeEventListener(
|
||||||
'keyup',
|
'keyup',
|
||||||
this.keyboardKeyUp,
|
this.keyboardKeyUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -534,24 +534,24 @@ GameLib.System.Input.prototype.deRegisterMouseControls = function(mouseControl)
|
||||||
mouseControl.domElement.instance.removeEventListener(
|
mouseControl.domElement.instance.removeEventListener(
|
||||||
'mousedown',
|
'mousedown',
|
||||||
this.mouseDown,
|
this.mouseDown,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mouseControl.domElement.instance.removeEventListener(
|
mouseControl.domElement.instance.removeEventListener(
|
||||||
'mousemove',
|
'mousemove',
|
||||||
this.mouseMove,
|
this.mouseMove,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
mouseControl.domElement.instance.removeEventListener(
|
mouseControl.domElement.instance.removeEventListener(
|
||||||
'wheel',
|
'wheel',
|
||||||
this.mouseWheel,
|
this.mouseWheel,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
mouseControl.domElement.instance.removeEventListener(
|
mouseControl.domElement.instance.removeEventListener(
|
||||||
'mouseup',
|
'mouseup',
|
||||||
this.mouseUp,
|
this.mouseUp,
|
||||||
false
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ GameLib.Vector2 = function (
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
GameLib.Vector2.prototype = Object.create(GameLib.Component.prototype);
|
GameLib.Vector2.prototype = Object.create(GameLib.API.Vector2.prototype);
|
||||||
GameLib.Vector2.prototype.constructor = GameLib.Vector2;
|
GameLib.Vector2.prototype.constructor = GameLib.Vector2;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ GameLib.Vector3 = function (
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
GameLib.Vector3.prototype = Object.create(GameLib.Component.prototype);
|
GameLib.Vector3.prototype = Object.create(GameLib.API.Vector3.prototype);
|
||||||
GameLib.Vector3.prototype.constructor = GameLib.Vector3;
|
GameLib.Vector3.prototype.constructor = GameLib.Vector3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -41,7 +41,7 @@ GameLib.Vector4 = function (
|
||||||
this.createInstance();
|
this.createInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
GameLib.Vector4.prototype = Object.create(GameLib.Component.prototype);
|
GameLib.Vector4.prototype = Object.create(GameLib.API.Vector4.prototype);
|
||||||
GameLib.Vector4.prototype.constructor = GameLib.Vector4;
|
GameLib.Vector4.prototype.constructor = GameLib.Vector4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue