mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
修复bug。
This commit is contained in:
parent
98fb3167f1
commit
d4e97f99b0
@ -25,7 +25,7 @@ function Physics(options) {
|
||||
}
|
||||
|
||||
Physics.prototype.start = function () {
|
||||
this.app.on(`animate.Physics`, this.update.bind(this));
|
||||
// this.app.on(`animate.Physics`, this.update.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
@ -84,9 +84,7 @@ Physics.prototype.createParalellepiped = function (sx, sy, sz, mass, pos, quat,
|
||||
return threeObject;
|
||||
};
|
||||
|
||||
Physics.prototype.update = function (clock) {
|
||||
var deltaTime = clock.getDelta();
|
||||
|
||||
Physics.prototype.update = function (clock, deltaTime) {
|
||||
this.world.stepSimulation(deltaTime, 10);
|
||||
|
||||
// Update rigid bodies
|
||||
|
||||
@ -25,7 +25,9 @@ AnimateEvent.prototype.stop = function () {
|
||||
AnimateEvent.prototype.onAnimate = function () {
|
||||
this.app.editor.stats.begin();
|
||||
|
||||
this.app.call('animate', this, this.clock);
|
||||
var deltaTime = this.clock.getDelta();
|
||||
|
||||
this.app.call('animate', this, this.clock, deltaTime);
|
||||
this.app.call('render', this);
|
||||
|
||||
this.app.editor.stats.end();
|
||||
|
||||
@ -65,8 +65,8 @@ AddMikuEvent.prototype.onAddMiku = function () {
|
||||
});
|
||||
};
|
||||
|
||||
AddMikuEvent.prototype.onAnimate = function (clock) {
|
||||
this.helper.update(clock.getDelta());
|
||||
AddMikuEvent.prototype.onAnimate = function (clock, deltaTime) {
|
||||
this.helper.update(deltaTime);
|
||||
this.effect.render(this.app.editor.scene, this.app.editor.camera);
|
||||
};
|
||||
|
||||
|
||||
@ -78,11 +78,9 @@ AddPersonEvent.prototype.onObjectRemoved = function (object) {
|
||||
}
|
||||
};
|
||||
|
||||
AddPersonEvent.prototype.onAnimate = function (clock) {
|
||||
var mixerUpdateDelta = clock.getDelta();
|
||||
|
||||
AddPersonEvent.prototype.onAnimate = function (clock, deltaTime) {
|
||||
this.persons.forEach(function (person) {
|
||||
person.mixer.update(mixerUpdateDelta);
|
||||
person.mixer.update(deltaTime);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ ParticleEmitterEvent.prototype.onObjectRemoved = function (object) {
|
||||
}
|
||||
};
|
||||
|
||||
ParticleEmitterEvent.prototype.onAnimate = function (clock) {
|
||||
ParticleEmitterEvent.prototype.onAnimate = function (clock, deltaTime) {
|
||||
this.groups.forEach((group) => {
|
||||
group.tick(clock.getDelta());
|
||||
group.tick(deltaTime);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user