|
@@ -13347,7 +13347,7 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- AbstractMesh.prototype.moveWithCollisions = function (velocity) {
|
|
|
+ AbstractMesh.prototype.moveWithCollisions = function (direction) {
|
|
|
var globalPosition = this.getAbsolutePosition();
|
|
|
globalPosition.subtractFromFloatsToRef(0, this.ellipsoid.y, 0, this._oldPositionForCollisions);
|
|
|
this._oldPositionForCollisions.addInPlace(this.ellipsoidOffset);
|
|
@@ -13355,7 +13355,7 @@ var BABYLON;
|
|
|
this._collider = new BABYLON.Collider();
|
|
|
}
|
|
|
this._collider.radius = this.ellipsoid;
|
|
|
- this.getScene().collisionCoordinator.getNewPosition(this._oldPositionForCollisions, velocity, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId);
|
|
|
+ this.getScene().collisionCoordinator.getNewPosition(this._oldPositionForCollisions, direction, this._collider, 3, this, this._onCollisionPositionChange, this.uniqueId);
|
|
|
return this;
|
|
|
};
|
|
|
// Submeshes octree
|
|
@@ -34628,7 +34628,7 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- FreeCamera.prototype._collideWithWorld = function (velocity) {
|
|
|
+ FreeCamera.prototype._collideWithWorld = function (direction) {
|
|
|
var globalPosition;
|
|
|
if (this.parent) {
|
|
|
globalPosition = BABYLON.Vector3.TransformCoordinates(this.position, this.parent.getWorldMatrix());
|
|
@@ -34643,13 +34643,13 @@ var BABYLON;
|
|
|
this._collider.radius = this.ellipsoid;
|
|
|
this._collider.collisionMask = this._collisionMask;
|
|
|
//no need for clone, as long as gravity is not on.
|
|
|
- var actualVelocity = velocity;
|
|
|
- //add gravity to the velocity to prevent the dual-collision checking
|
|
|
+ var actualDirection = direction;
|
|
|
+ //add gravity to the direction to prevent the dual-collision checking
|
|
|
if (this.applyGravity) {
|
|
|
//this prevents mending with cameraDirection, a global variable of the free camera class.
|
|
|
- actualVelocity = velocity.add(this.getScene().gravity);
|
|
|
+ actualDirection = direction.add(this.getScene().gravity);
|
|
|
}
|
|
|
- this.getScene().collisionCoordinator.getNewPosition(this._oldPosition, actualVelocity, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
|
|
|
+ this.getScene().collisionCoordinator.getNewPosition(this._oldPosition, actualDirection, this._collider, 3, null, this._onCollisionPositionChange, this.uniqueId);
|
|
|
};
|
|
|
FreeCamera.prototype._checkInputs = function () {
|
|
|
if (!this._localDirection) {
|
|
@@ -71064,7 +71064,7 @@ var BABYLON;
|
|
|
});
|
|
|
this._onAfterCheckInputsObserver = camera.onAfterCheckInputsObservable.add(function () {
|
|
|
var now = BABYLON.Tools.Now;
|
|
|
- var dt = 16;
|
|
|
+ var dt = 0;
|
|
|
if (_this._lastFrameTime != null) {
|
|
|
dt = now - _this._lastFrameTime;
|
|
|
}
|