Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightly #5588

Merged
merged 14 commits into from Dec 3, 2018
8,483 changes: 4,261 additions & 4,222 deletions Playground/babylon.d.txt

Large diffs are not rendered by default.

8,069 changes: 4,047 additions & 4,022 deletions dist/preview release/babylon.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/preview release/babylon.js

Large diffs are not rendered by default.

55 changes: 53 additions & 2 deletions dist/preview release/babylon.max.js
Expand Up @@ -5688,6 +5688,16 @@ var BABYLON;
Vector3.Up = function () {
return new Vector3(0.0, 1.0, 0.0);
};
Object.defineProperty(Vector3, "UpReadOnly", {
/**
* Gets a up Vector3 that must not be updated
*/
get: function () {
return Vector3._UpReadOnly;
},
enumerable: true,
configurable: true
});
/**
* Returns a new Vector3 set to (0.0, -1.0, 0.0)
* @returns a new down Vector3
Expand Down Expand Up @@ -6165,6 +6175,7 @@ var BABYLON;
Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);
quat.toEulerAnglesToRef(ref);
};
Vector3._UpReadOnly = Vector3.Up();
return Vector3;
}());
BABYLON.Vector3 = Vector3;
Expand Down Expand Up @@ -6823,6 +6834,16 @@ var BABYLON;
result.z = (x * m[2]) + (y * m[6]) + (z * m[10]);
result.w = w;
};
/**
* Creates a new Vector4 from a Vector3
* @param source defines the source data
* @param w defines the 4th component (default is 0)
* @returns a new Vector4
*/
Vector4.FromVector3 = function (source, w) {
if (w === void 0) { w = 0; }
return new Vector4(source.x, source.y, source.z, w);
};
return Vector4;
}());
BABYLON.Vector4 = Vector4;
Expand Down Expand Up @@ -52632,6 +52653,19 @@ var BABYLON;
}
var target = this._getTargetPosition();
this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
// Rotate according to up vector
if (this.upVector.x !== 0 || this.upVector.y !== 1.0 || this.upVector.z !== 0) {
if (!this._tempAxisVector) {
this._tempAxisVector = new BABYLON.Vector3();
this._tempAxisRotationMatrix = new BABYLON.Matrix();
}
BABYLON.Vector3.CrossToRef(BABYLON.Vector3.Up(), this.upVector, this._tempAxisVector);
this._tempAxisVector.normalize();
var angle = Math.acos(BABYLON.Vector3.Dot(BABYLON.Vector3.UpReadOnly, this.upVector));
BABYLON.Matrix.RotationAxisToRef(this._tempAxisVector, angle, this._tempAxisRotationMatrix);
this._tempAxisVector.copyFrom(this._computationVector);
BABYLON.Vector3.TransformCoordinatesToRef(this._tempAxisVector, this._tempAxisRotationMatrix, this._computationVector);
}
target.addToRef(this._computationVector, this._newPosition);
if (this.getScene().collisionsEnabled && this.checkCollisions) {
if (!this._collider) {
Expand Down Expand Up @@ -99909,6 +99943,7 @@ var BABYLON;
*/
this.name = "AmmoJSPlugin";
this._timeStep = 1 / 60;
this._fixedTimeStep = 1 / 60;
this._maxSteps = 5;
this._tmpQuaternion = new BABYLON.Quaternion();
this._tmpContactCallbackResult = false;
Expand Down Expand Up @@ -99951,6 +99986,20 @@ var BABYLON;
AmmoJSPlugin.prototype.setTimeStep = function (timeStep) {
this._timeStep = timeStep;
};
/**
* Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
* @param fixedTimeStep fixedTimeStep to use in seconds
*/
AmmoJSPlugin.prototype.setFixedTimeStep = function (fixedTimeStep) {
this._fixedTimeStep = fixedTimeStep;
};
/**
* Sets the maximum number of steps by the physics engine per frame (Default: 5)
* @param maxSteps the maximum number of steps by the physics engine per frame
*/
AmmoJSPlugin.prototype.setMaxSteps = function (maxSteps) {
this._maxSteps = maxSteps;
};
/**
* Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
* @returns the current timestep in seconds
Expand Down Expand Up @@ -100012,7 +100061,7 @@ var BABYLON;
// Update physics world objects to match babylon world
impostor.beforeStep();
}
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps);
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps, this._fixedTimeStep);
for (var _a = 0, impostors_2 = impostors; _a < impostors_2.length; _a++) {
var mainImpostor = impostors_2[_a];
// After physics update make babylon world objects match physics world objects
Expand Down Expand Up @@ -100156,7 +100205,9 @@ var BABYLON;
* @param impostorJoint the imposter joint to remove the joint from
*/
AmmoJSPlugin.prototype.removeJoint = function (impostorJoint) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
if (this.world) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
}
};
// adds all verticies (including child verticies) to the triangle mesh
AmmoJSPlugin.prototype._addMeshVerts = function (btTriangleMesh, topLevelObject, object) {
Expand Down
55 changes: 53 additions & 2 deletions dist/preview release/babylon.no-module.max.js
Expand Up @@ -5655,6 +5655,16 @@ var BABYLON;
Vector3.Up = function () {
return new Vector3(0.0, 1.0, 0.0);
};
Object.defineProperty(Vector3, "UpReadOnly", {
/**
* Gets a up Vector3 that must not be updated
*/
get: function () {
return Vector3._UpReadOnly;
},
enumerable: true,
configurable: true
});
/**
* Returns a new Vector3 set to (0.0, -1.0, 0.0)
* @returns a new down Vector3
Expand Down Expand Up @@ -6132,6 +6142,7 @@ var BABYLON;
Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);
quat.toEulerAnglesToRef(ref);
};
Vector3._UpReadOnly = Vector3.Up();
return Vector3;
}());
BABYLON.Vector3 = Vector3;
Expand Down Expand Up @@ -6790,6 +6801,16 @@ var BABYLON;
result.z = (x * m[2]) + (y * m[6]) + (z * m[10]);
result.w = w;
};
/**
* Creates a new Vector4 from a Vector3
* @param source defines the source data
* @param w defines the 4th component (default is 0)
* @returns a new Vector4
*/
Vector4.FromVector3 = function (source, w) {
if (w === void 0) { w = 0; }
return new Vector4(source.x, source.y, source.z, w);
};
return Vector4;
}());
BABYLON.Vector4 = Vector4;
Expand Down Expand Up @@ -52599,6 +52620,19 @@ var BABYLON;
}
var target = this._getTargetPosition();
this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
// Rotate according to up vector
if (this.upVector.x !== 0 || this.upVector.y !== 1.0 || this.upVector.z !== 0) {
if (!this._tempAxisVector) {
this._tempAxisVector = new BABYLON.Vector3();
this._tempAxisRotationMatrix = new BABYLON.Matrix();
}
BABYLON.Vector3.CrossToRef(BABYLON.Vector3.Up(), this.upVector, this._tempAxisVector);
this._tempAxisVector.normalize();
var angle = Math.acos(BABYLON.Vector3.Dot(BABYLON.Vector3.UpReadOnly, this.upVector));
BABYLON.Matrix.RotationAxisToRef(this._tempAxisVector, angle, this._tempAxisRotationMatrix);
this._tempAxisVector.copyFrom(this._computationVector);
BABYLON.Vector3.TransformCoordinatesToRef(this._tempAxisVector, this._tempAxisRotationMatrix, this._computationVector);
}
target.addToRef(this._computationVector, this._newPosition);
if (this.getScene().collisionsEnabled && this.checkCollisions) {
if (!this._collider) {
Expand Down Expand Up @@ -99876,6 +99910,7 @@ var BABYLON;
*/
this.name = "AmmoJSPlugin";
this._timeStep = 1 / 60;
this._fixedTimeStep = 1 / 60;
this._maxSteps = 5;
this._tmpQuaternion = new BABYLON.Quaternion();
this._tmpContactCallbackResult = false;
Expand Down Expand Up @@ -99918,6 +99953,20 @@ var BABYLON;
AmmoJSPlugin.prototype.setTimeStep = function (timeStep) {
this._timeStep = timeStep;
};
/**
* Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
* @param fixedTimeStep fixedTimeStep to use in seconds
*/
AmmoJSPlugin.prototype.setFixedTimeStep = function (fixedTimeStep) {
this._fixedTimeStep = fixedTimeStep;
};
/**
* Sets the maximum number of steps by the physics engine per frame (Default: 5)
* @param maxSteps the maximum number of steps by the physics engine per frame
*/
AmmoJSPlugin.prototype.setMaxSteps = function (maxSteps) {
this._maxSteps = maxSteps;
};
/**
* Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
* @returns the current timestep in seconds
Expand Down Expand Up @@ -99979,7 +100028,7 @@ var BABYLON;
// Update physics world objects to match babylon world
impostor.beforeStep();
}
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps);
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps, this._fixedTimeStep);
for (var _a = 0, impostors_2 = impostors; _a < impostors_2.length; _a++) {
var mainImpostor = impostors_2[_a];
// After physics update make babylon world objects match physics world objects
Expand Down Expand Up @@ -100123,7 +100172,9 @@ var BABYLON;
* @param impostorJoint the imposter joint to remove the joint from
*/
AmmoJSPlugin.prototype.removeJoint = function (impostorJoint) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
if (this.world) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
}
};
// adds all verticies (including child verticies) to the triangle mesh
AmmoJSPlugin.prototype._addMeshVerts = function (btTriangleMesh, topLevelObject, object) {
Expand Down
2 changes: 1 addition & 1 deletion dist/preview release/babylon.worker.js

Large diffs are not rendered by default.

55 changes: 53 additions & 2 deletions dist/preview release/es6.js
Expand Up @@ -5655,6 +5655,16 @@ var BABYLON;
Vector3.Up = function () {
return new Vector3(0.0, 1.0, 0.0);
};
Object.defineProperty(Vector3, "UpReadOnly", {
/**
* Gets a up Vector3 that must not be updated
*/
get: function () {
return Vector3._UpReadOnly;
},
enumerable: true,
configurable: true
});
/**
* Returns a new Vector3 set to (0.0, -1.0, 0.0)
* @returns a new down Vector3
Expand Down Expand Up @@ -6132,6 +6142,7 @@ var BABYLON;
Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);
quat.toEulerAnglesToRef(ref);
};
Vector3._UpReadOnly = Vector3.Up();
return Vector3;
}());
BABYLON.Vector3 = Vector3;
Expand Down Expand Up @@ -6790,6 +6801,16 @@ var BABYLON;
result.z = (x * m[2]) + (y * m[6]) + (z * m[10]);
result.w = w;
};
/**
* Creates a new Vector4 from a Vector3
* @param source defines the source data
* @param w defines the 4th component (default is 0)
* @returns a new Vector4
*/
Vector4.FromVector3 = function (source, w) {
if (w === void 0) { w = 0; }
return new Vector4(source.x, source.y, source.z, w);
};
return Vector4;
}());
BABYLON.Vector4 = Vector4;
Expand Down Expand Up @@ -52599,6 +52620,19 @@ var BABYLON;
}
var target = this._getTargetPosition();
this._computationVector.copyFromFloats(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb);
// Rotate according to up vector
if (this.upVector.x !== 0 || this.upVector.y !== 1.0 || this.upVector.z !== 0) {
if (!this._tempAxisVector) {
this._tempAxisVector = new BABYLON.Vector3();
this._tempAxisRotationMatrix = new BABYLON.Matrix();
}
BABYLON.Vector3.CrossToRef(BABYLON.Vector3.Up(), this.upVector, this._tempAxisVector);
this._tempAxisVector.normalize();
var angle = Math.acos(BABYLON.Vector3.Dot(BABYLON.Vector3.UpReadOnly, this.upVector));
BABYLON.Matrix.RotationAxisToRef(this._tempAxisVector, angle, this._tempAxisRotationMatrix);
this._tempAxisVector.copyFrom(this._computationVector);
BABYLON.Vector3.TransformCoordinatesToRef(this._tempAxisVector, this._tempAxisRotationMatrix, this._computationVector);
}
target.addToRef(this._computationVector, this._newPosition);
if (this.getScene().collisionsEnabled && this.checkCollisions) {
if (!this._collider) {
Expand Down Expand Up @@ -99876,6 +99910,7 @@ var BABYLON;
*/
this.name = "AmmoJSPlugin";
this._timeStep = 1 / 60;
this._fixedTimeStep = 1 / 60;
this._maxSteps = 5;
this._tmpQuaternion = new BABYLON.Quaternion();
this._tmpContactCallbackResult = false;
Expand Down Expand Up @@ -99918,6 +99953,20 @@ var BABYLON;
AmmoJSPlugin.prototype.setTimeStep = function (timeStep) {
this._timeStep = timeStep;
};
/**
* Increment to step forward in the physics engine (If timeStep is set to 1/60 and fixedTimeStep is set to 1/120 the physics engine should run 2 steps per frame) (Default: 1/60)
* @param fixedTimeStep fixedTimeStep to use in seconds
*/
AmmoJSPlugin.prototype.setFixedTimeStep = function (fixedTimeStep) {
this._fixedTimeStep = fixedTimeStep;
};
/**
* Sets the maximum number of steps by the physics engine per frame (Default: 5)
* @param maxSteps the maximum number of steps by the physics engine per frame
*/
AmmoJSPlugin.prototype.setMaxSteps = function (maxSteps) {
this._maxSteps = maxSteps;
};
/**
* Gets the current timestep (only used if useDeltaForWorldStep is false in the constructor)
* @returns the current timestep in seconds
Expand Down Expand Up @@ -99979,7 +100028,7 @@ var BABYLON;
// Update physics world objects to match babylon world
impostor.beforeStep();
}
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps);
this._stepSimulation(this._useDeltaForWorldStep ? delta : this._timeStep, this._maxSteps, this._fixedTimeStep);
for (var _a = 0, impostors_2 = impostors; _a < impostors_2.length; _a++) {
var mainImpostor = impostors_2[_a];
// After physics update make babylon world objects match physics world objects
Expand Down Expand Up @@ -100123,7 +100172,9 @@ var BABYLON;
* @param impostorJoint the imposter joint to remove the joint from
*/
AmmoJSPlugin.prototype.removeJoint = function (impostorJoint) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
if (this.world) {
this.world.removeConstraint(impostorJoint.joint.physicsJoint);
}
};
// adds all verticies (including child verticies) to the triangle mesh
AmmoJSPlugin.prototype._addMeshVerts = function (btTriangleMesh, topLevelObject, object) {
Expand Down