Skip to content

Commit

Permalink
Added onSimulationResume
Browse files Browse the repository at this point in the history
Added onSimulation resume to allow for a simulation to be resumed
without updating all objects as if the simulation did not pause in the
first place.
  • Loading branch information
qazokm committed Aug 20, 2014
1 parent 1b43c1d commit 156f058
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions physi.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ window.Physijs = (function() {
return constraint;
};

Physijs.Scene.prototype.onSimulationResume = function() {
this.execute( 'onSimulationResume', { } );
};

Physijs.Scene.prototype.removeConstraint = function( constraint ) {
if ( this._constraints[constraint.id ] !== undefined ) {
this.execute( 'removeConstraint', { id: constraint.id } );
Expand Down
4 changes: 4 additions & 0 deletions physijs_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,10 @@ public_functions.applyForce = function ( details ) {
_objects[details.id].activate();
};

public_functions.onSimulationResume = function( params ) {
last_simulation_time = Date.now();
};

public_functions.setAngularVelocity = function ( details ) {

_vec3_1.setX(details.x);
Expand Down

0 comments on commit 156f058

Please sign in to comment.