mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added pointer locking and viewport moving
This commit is contained in:
parent
072e984215
commit
6d9d02615a
12 changed files with 236 additions and 141 deletions
|
|
@ -9,6 +9,12 @@ function (Parent, Settings, Nc) {
|
|||
function Me(id, physicsEngine, user) {
|
||||
Parent.call(this, id, physicsEngine, user);
|
||||
|
||||
// View uses this to calculate center position
|
||||
this.lookAtXY = {
|
||||
x: 1,
|
||||
y: 0
|
||||
}
|
||||
|
||||
this.lastServerPositionState = {
|
||||
p: {
|
||||
x: 0,
|
||||
|
|
@ -21,6 +27,22 @@ function (Parent, Settings, Nc) {
|
|||
}
|
||||
|
||||
Me.prototype = Object.create(Parent.prototype);
|
||||
|
||||
Me.prototype.lookAt = function(x, y) {
|
||||
this.lookAtXY = {
|
||||
x: x,
|
||||
y: y
|
||||
}
|
||||
|
||||
Parent.prototype.lookAt.call(this, x, y);
|
||||
};
|
||||
|
||||
Me.prototype.getLookAt = function() {
|
||||
return {
|
||||
x: this.lookAtXY.x,
|
||||
y: this.lookAtXY.y
|
||||
};
|
||||
};
|
||||
|
||||
Me.prototype.setLastServerPositionState = function(update) {
|
||||
this.lastServerPositionState = update;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue