mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Events call the world directly, avoids an unnecessary function jump.
This commit is contained in:
parent
f41d016c9f
commit
108b6bd2a3
3 changed files with 5 additions and 30 deletions
|
@ -49,22 +49,12 @@ var ArcadePhysics = new Class({
|
||||||
|
|
||||||
this.systems.inject(this);
|
this.systems.inject(this);
|
||||||
|
|
||||||
this.systems.events.on('update', this.update, this);
|
this.systems.events.on('update', this.world.update, this.world);
|
||||||
this.systems.events.on('postupdate', this.postUpdate, this);
|
this.systems.events.on('postupdate', this.world.postUpdate, this.world);
|
||||||
this.systems.events.on('shutdown', this.shutdown, this);
|
this.systems.events.on('shutdown', this.shutdown, this);
|
||||||
this.systems.events.on('destroy', this.destroy, this);
|
this.systems.events.on('destroy', this.destroy, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function (time, delta)
|
|
||||||
{
|
|
||||||
this.world.update(time, delta);
|
|
||||||
},
|
|
||||||
|
|
||||||
postUpdate: function ()
|
|
||||||
{
|
|
||||||
this.world.postUpdate();
|
|
||||||
},
|
|
||||||
|
|
||||||
overlap: function (object1, object2, overlapCallback, processCallback, callbackContext)
|
overlap: function (object1, object2, overlapCallback, processCallback, callbackContext)
|
||||||
{
|
{
|
||||||
if (overlapCallback === undefined) { overlapCallback = null; }
|
if (overlapCallback === undefined) { overlapCallback = null; }
|
||||||
|
|
|
@ -49,16 +49,11 @@ var ImpactPhysics = new Class({
|
||||||
|
|
||||||
this.systems.inject(this);
|
this.systems.inject(this);
|
||||||
|
|
||||||
this.systems.events.on('update', this.update, this);
|
this.systems.events.on('update', this.world.update, this.world);
|
||||||
this.systems.events.on('shutdown', this.shutdown, this);
|
this.systems.events.on('shutdown', this.shutdown, this);
|
||||||
this.systems.events.on('destroy', this.destroy, this);
|
this.systems.events.on('destroy', this.destroy, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function (time, delta)
|
|
||||||
{
|
|
||||||
this.world.update(time, delta);
|
|
||||||
},
|
|
||||||
|
|
||||||
shutdown: function ()
|
shutdown: function ()
|
||||||
{
|
{
|
||||||
this.world.shutdown();
|
this.world.shutdown();
|
||||||
|
|
|
@ -72,8 +72,8 @@ var MatterPhysics = new Class({
|
||||||
|
|
||||||
this.systems.inject(this);
|
this.systems.inject(this);
|
||||||
|
|
||||||
this.systems.events.on('update', this.update, this);
|
this.systems.events.on('update', this.world.update, this.world);
|
||||||
this.systems.events.on('postupdate', this.postUpdate, this);
|
this.systems.events.on('postupdate', this.world.postUpdate, this.world);
|
||||||
this.systems.events.on('shutdown', this.shutdown, this);
|
this.systems.events.on('shutdown', this.shutdown, this);
|
||||||
this.systems.events.on('destroy', this.destroy, this);
|
this.systems.events.on('destroy', this.destroy, this);
|
||||||
},
|
},
|
||||||
|
@ -94,16 +94,6 @@ var MatterPhysics = new Class({
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
update: function (time, delta)
|
|
||||||
{
|
|
||||||
this.world.update(time, delta);
|
|
||||||
},
|
|
||||||
|
|
||||||
postUpdate: function (time, delta)
|
|
||||||
{
|
|
||||||
this.world.postUpdate(time, delta);
|
|
||||||
},
|
|
||||||
|
|
||||||
shutdown: function ()
|
shutdown: function ()
|
||||||
{
|
{
|
||||||
this.world.shutdown();
|
this.world.shutdown();
|
||||||
|
|
Loading…
Reference in a new issue