|
@@ -11350,7 +11350,7 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(Engine, "Version", {
|
|
|
get: function () {
|
|
|
- return "3.2.0-beta.1";
|
|
|
+ return "3.2.0-beta.2";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -15797,6 +15797,7 @@ var BABYLON;
|
|
|
/** @ignore */
|
|
|
this._currentRenderId = -1;
|
|
|
this._parentRenderId = -1;
|
|
|
+ this._childRenderId = -1;
|
|
|
this._animationPropertiesOverride = null;
|
|
|
/**
|
|
|
* An event triggered when the mesh is disposed
|
|
@@ -16000,7 +16001,7 @@ var BABYLON;
|
|
|
/** @ignore */
|
|
|
Node.prototype._markSyncedWithParent = function () {
|
|
|
if (this.parent) {
|
|
|
- this._parentRenderId = this.parent._currentRenderId;
|
|
|
+ this._parentRenderId = this.parent._childRenderId;
|
|
|
}
|
|
|
};
|
|
|
/** @ignore */
|
|
@@ -16008,7 +16009,7 @@ var BABYLON;
|
|
|
if (!this.parent) {
|
|
|
return true;
|
|
|
}
|
|
|
- if (this._parentRenderId !== this.parent._currentRenderId) {
|
|
|
+ if (this._parentRenderId !== this.parent._childRenderId) {
|
|
|
return false;
|
|
|
}
|
|
|
return this.parent.isSynchronized();
|
|
@@ -16686,6 +16687,11 @@ var BABYLON;
|
|
|
if (scene === void 0) { scene = null; }
|
|
|
if (isPure === void 0) { isPure = true; }
|
|
|
var _this = _super.call(this, name, scene) || this;
|
|
|
+ _this._forward = new BABYLON.Vector3(0, 0, 1);
|
|
|
+ _this._forwardInverted = new BABYLON.Vector3(0, 0, -1);
|
|
|
+ _this._up = new BABYLON.Vector3(0, 1, 0);
|
|
|
+ _this._right = new BABYLON.Vector3(1, 0, 0);
|
|
|
+ _this._rightInverted = new BABYLON.Vector3(-1, 0, 0);
|
|
|
// Properties
|
|
|
_this._rotation = BABYLON.Vector3.Zero();
|
|
|
_this._scaling = BABYLON.Vector3.One();
|
|
@@ -16771,6 +16777,36 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(TransformNode.prototype, "forward", {
|
|
|
+ /**
|
|
|
+ * The forward direction of that transform in world space.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward, this.getWorldMatrix()));
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ Object.defineProperty(TransformNode.prototype, "up", {
|
|
|
+ /**
|
|
|
+ * The up direction of that transform in world space.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this._up, this.getWorldMatrix()));
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ Object.defineProperty(TransformNode.prototype, "right", {
|
|
|
+ /**
|
|
|
+ * The right direction of that transform in world space.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return BABYLON.Vector3.Normalize(BABYLON.Vector3.TransformNormal(this.getScene().useRightHandedSystem ? this._rightInverted : this._right, this.getWorldMatrix()));
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Returns the latest update of the World matrix
|
|
|
* Returns a Matrix.
|
|
@@ -17316,6 +17352,7 @@ var BABYLON;
|
|
|
return this._worldMatrix;
|
|
|
}
|
|
|
if (!force && this.isSynchronized(true)) {
|
|
|
+ this._currentRenderId = this.getScene().getRenderId();
|
|
|
return this._worldMatrix;
|
|
|
}
|
|
|
this._cache.position.copyFrom(this.position);
|
|
@@ -17323,6 +17360,7 @@ var BABYLON;
|
|
|
this._cache.pivotMatrixUpdated = false;
|
|
|
this._cache.billboardMode = this.billboardMode;
|
|
|
this._currentRenderId = this.getScene().getRenderId();
|
|
|
+ this._childRenderId = this.getScene().getRenderId();
|
|
|
this._isDirty = false;
|
|
|
// Scaling
|
|
|
BABYLON.Matrix.ScalingToRef(this.scaling.x * this.scalingDeterminant, this.scaling.y * this.scalingDeterminant, this.scaling.z * this.scalingDeterminant, BABYLON.Tmp.Matrix[1]);
|
|
@@ -78674,15 +78712,14 @@ var BABYLON;
|
|
|
if (!this._intersectsWithSphere(impostor, origin, radius)) {
|
|
|
return null;
|
|
|
}
|
|
|
- if (impostor.object.getClassName() !== 'Mesh') {
|
|
|
+ if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
|
|
|
return null;
|
|
|
}
|
|
|
- var impostorObject = impostor.object;
|
|
|
var impostorObjectCenter = impostor.getObjectCenter();
|
|
|
var direction = impostorObjectCenter.subtract(origin);
|
|
|
var ray = new BABYLON.Ray(origin, direction, radius);
|
|
|
this._rays.push(ray);
|
|
|
- var hit = ray.intersectsMesh(impostorObject);
|
|
|
+ var hit = ray.intersectsMesh(impostor.object);
|
|
|
var contactPoint = hit.pickedPoint;
|
|
|
if (!contactPoint) {
|
|
|
return null;
|
|
@@ -78978,15 +79015,14 @@ var BABYLON;
|
|
|
if (!this._intersectsWithCylinder(impostor)) {
|
|
|
return null;
|
|
|
}
|
|
|
- if (impostor.object.getClassName() !== 'Mesh') {
|
|
|
+ if (impostor.object.getClassName() !== 'Mesh' && impostor.object.getClassName() !== 'InstancedMesh') {
|
|
|
return null;
|
|
|
}
|
|
|
- var impostorObject = impostor.object;
|
|
|
var impostorObjectCenter = impostor.getObjectCenter();
|
|
|
var originOnPlane = new BABYLON.Vector3(this._origin.x, impostorObjectCenter.y, this._origin.z); // the distance to the origin as if both objects were on a plane (Y-axis)
|
|
|
var originToImpostorDirection = impostorObjectCenter.subtract(originOnPlane);
|
|
|
var ray = new BABYLON.Ray(originOnPlane, originToImpostorDirection, this._radius);
|
|
|
- var hit = ray.intersectsMesh(impostorObject);
|
|
|
+ var hit = ray.intersectsMesh(impostor.object);
|
|
|
var contactPoint = hit.pickedPoint;
|
|
|
if (!contactPoint) {
|
|
|
return null;
|
|
@@ -94397,7 +94433,8 @@ var AbstractViewer = (function () {
|
|
|
this._configureEnvironment(this._configuration.skybox, this._configuration.ground);
|
|
|
return Promise.resolve(this.scene);
|
|
|
};
|
|
|
- AbstractViewer.prototype._handleHardwareLimitations = function () {
|
|
|
+ AbstractViewer.prototype._handleHardwareLimitations = function (enableHDR) {
|
|
|
+ if (enableHDR === void 0) { enableHDR = true; }
|
|
|
var maxVaryingRows = this.engine.getCaps().maxVaryingVectors;
|
|
|
var maxFragmentSamplers = this.engine.getCaps().maxTexturesImageUnits;
|
|
|
if ((maxVaryingRows < 8) || (maxFragmentSamplers < 8)) {
|
|
@@ -94409,7 +94446,7 @@ var AbstractViewer = (function () {
|
|
|
var caps = this.engine.getCaps();
|
|
|
var linearHalfFloatTargets = caps.textureHalfFloatRender && caps.textureHalfFloatLinearFiltering;
|
|
|
var linearFloatTargets = caps.textureFloatRender && caps.textureFloatLinearFiltering;
|
|
|
- this._hdrSupport = !!(linearFloatTargets || linearHalfFloatTargets);
|
|
|
+ this._hdrSupport = enableHDR && !!(linearFloatTargets || linearHalfFloatTargets);
|
|
|
if (linearHalfFloatTargets) {
|
|
|
this._defaultHighpTextureType = babylonjs_1.Engine.TEXTURETYPE_HALF_FLOAT;
|
|
|
this._shadowGeneratorBias = 0.002;
|