|
@@ -5642,7 +5642,7 @@ var BABYLON;
|
|
|
* @param result defines the Vector3 where to store the result
|
|
|
*/
|
|
|
Vector3.TransformCoordinatesToRef = function (vector, transformation, result) {
|
|
|
- return Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
|
|
|
+ Vector3.TransformCoordinatesFromFloatsToRef(vector.x, vector.y, vector.z, transformation, result);
|
|
|
};
|
|
|
/**
|
|
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
|
@@ -12841,7 +12841,7 @@ var BABYLON;
|
|
|
* Returns the current version of the framework
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return "4.0.0-alpha.5";
|
|
|
+ return "4.0.0-alpha.6";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -19131,10 +19131,12 @@ var BABYLON;
|
|
|
/**
|
|
|
* Get all direct children of this node
|
|
|
* @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
|
|
|
+ * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)
|
|
|
* @returns an array of Node
|
|
|
*/
|
|
|
- Node.prototype.getChildren = function (predicate) {
|
|
|
- return this.getDescendants(true, predicate);
|
|
|
+ Node.prototype.getChildren = function (predicate, directDescendantsOnly) {
|
|
|
+ if (directDescendantsOnly === void 0) { directDescendantsOnly = true; }
|
|
|
+ return this.getDescendants(directDescendantsOnly, predicate);
|
|
|
};
|
|
|
/** @hidden */
|
|
|
Node.prototype._setReady = function (state) {
|
|
@@ -22275,9 +22277,9 @@ var BABYLON;
|
|
|
*/
|
|
|
AbstractMesh.prototype.intersects = function (ray, fastCheck) {
|
|
|
var pickingInfo = new BABYLON.PickingInfo();
|
|
|
- var intersectionTreshold = this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
|
|
|
+ var intersectionThreshold = this.getClassName() === "InstancedLinesMesh" || this.getClassName() === "LinesMesh" ? this.intersectionThreshold : 0;
|
|
|
var boundingInfo = this._boundingInfo;
|
|
|
- if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionTreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionTreshold)) {
|
|
|
+ if (!this.subMeshes || !boundingInfo || !ray.intersectsSphere(boundingInfo.boundingSphere, intersectionThreshold) || !ray.intersectsBox(boundingInfo.boundingBox, intersectionThreshold)) {
|
|
|
return pickingInfo;
|
|
|
}
|
|
|
if (!this._generatePointsArray()) {
|
|
@@ -22306,8 +22308,10 @@ var BABYLON;
|
|
|
if (intersectInfo) {
|
|
|
// Get picked point
|
|
|
var world = this.getWorldMatrix();
|
|
|
- var worldOrigin = BABYLON.Vector3.TransformCoordinates(ray.origin, world);
|
|
|
- var direction = ray.direction.scaleToRef(intersectInfo.distance, BABYLON.Tmp.Vector3[0]);
|
|
|
+ var worldOrigin = BABYLON.Tmp.Vector3[0];
|
|
|
+ var direction = BABYLON.Tmp.Vector3[1];
|
|
|
+ BABYLON.Vector3.TransformCoordinatesToRef(ray.origin, world, worldOrigin);
|
|
|
+ ray.direction.scaleToRef(intersectInfo.distance, direction);
|
|
|
var worldDirection = BABYLON.Vector3.TransformNormal(direction, world);
|
|
|
var pickedPoint = worldDirection.addInPlace(worldOrigin);
|
|
|
// Return result
|
|
@@ -22398,7 +22402,7 @@ var BABYLON;
|
|
|
}
|
|
|
});
|
|
|
// SubMeshes
|
|
|
- if (this.getClassName() !== "InstancedMesh") {
|
|
|
+ if (this.getClassName() !== "InstancedMesh" || this.getClassName() !== "InstancedLinesMesh") {
|
|
|
this.releaseSubMeshes();
|
|
|
}
|
|
|
// Query
|
|
@@ -27435,7 +27439,7 @@ var BABYLON;
|
|
|
if (!mesh.isReady(true)) {
|
|
|
return false;
|
|
|
}
|
|
|
- var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
|
|
|
+ var hardwareInstancedRendering = mesh.getClassName() === "InstancedMesh" || mesh.getClassName() === "InstancedLinesMesh" || engine.getCaps().instancedArrays && mesh.instances.length > 0;
|
|
|
// Is Ready For Mesh
|
|
|
for (var _i = 0, _a = this._isReadyForMeshStage; _i < _a.length; _i++) {
|
|
|
var step = _a[_i];
|
|
@@ -34672,7 +34676,6 @@ var BABYLON;
|
|
|
// Instances
|
|
|
/**
|
|
|
* Creates a new InstancedMesh object from the mesh model.
|
|
|
- * Warning : this method is not supported for Line mesh and LineSystem
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_instances
|
|
|
* @param name defines the name of the new instance
|
|
|
* @returns a new InstancedMesh
|
|
@@ -36296,10 +36299,8 @@ var BABYLON;
|
|
|
}
|
|
|
// LineMesh first as it's also a Mesh...
|
|
|
if (BABYLON.LinesMesh) {
|
|
|
- var mesh = this._mesh instanceof BABYLON.InstancedMesh ? this._mesh.sourceMesh : this._mesh;
|
|
|
- if (mesh instanceof BABYLON.LinesMesh) {
|
|
|
- var linesMesh = mesh;
|
|
|
- return this._intersectLines(ray, positions, indices, linesMesh.intersectionThreshold, fastCheck);
|
|
|
+ if (this._mesh.getClassName() === "InstancedLinesMesh" || this._mesh.getClassName() === "LinesMesh") {
|
|
|
+ return this._intersectLines(ray, positions, indices, this._mesh.intersectionThreshold, fastCheck);
|
|
|
}
|
|
|
}
|
|
|
return this._intersectTriangles(ray, positions, indices, fastCheck);
|
|
@@ -65692,7 +65693,7 @@ var BABYLON;
|
|
|
_this.useVertexColor = source.useVertexColor;
|
|
|
_this.useVertexAlpha = source.useVertexAlpha;
|
|
|
}
|
|
|
- _this._intersectionThreshold = 0.1;
|
|
|
+ _this.intersectionThreshold = 0.1;
|
|
|
var defines = [];
|
|
|
var options = {
|
|
|
attributes: [BABYLON.VertexBuffer.PositionKind, "world0", "world1", "world2", "world3"],
|
|
@@ -65713,29 +65714,6 @@ var BABYLON;
|
|
|
_this._colorShader = new BABYLON.ShaderMaterial("colorShader", _this.getScene(), "color", options);
|
|
|
return _this;
|
|
|
}
|
|
|
- Object.defineProperty(LinesMesh.prototype, "intersectionThreshold", {
|
|
|
- /**
|
|
|
- * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
|
|
|
- * This margin is expressed in world space coordinates, so its value may vary.
|
|
|
- * Default value is 0.1
|
|
|
- * @returns the intersection Threshold value.
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return this._intersectionThreshold;
|
|
|
- },
|
|
|
- /**
|
|
|
- * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
|
|
|
- * This margin is expressed in world space coordinates, so its value may vary.
|
|
|
- */
|
|
|
- set: function (value) {
|
|
|
- if (this._intersectionThreshold === value) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this._intersectionThreshold = value;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
/**
|
|
|
* Returns the string "LineMesh"
|
|
|
*/
|
|
@@ -65805,9 +65783,37 @@ var BABYLON;
|
|
|
LinesMesh.prototype.clone = function (name, newParent, doNotCloneChildren) {
|
|
|
return new LinesMesh(name, this.getScene(), newParent, this, doNotCloneChildren);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Creates a new InstancedLinesMesh object from the mesh model.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_instances
|
|
|
+ * @param name defines the name of the new instance
|
|
|
+ * @returns a new InstancedLinesMesh
|
|
|
+ */
|
|
|
+ LinesMesh.prototype.createInstance = function (name) {
|
|
|
+ return new InstancedLinesMesh(name, this);
|
|
|
+ };
|
|
|
return LinesMesh;
|
|
|
}(BABYLON.Mesh));
|
|
|
BABYLON.LinesMesh = LinesMesh;
|
|
|
+ /**
|
|
|
+ * Creates an instance based on a source LinesMesh
|
|
|
+ */
|
|
|
+ var InstancedLinesMesh = /** @class */ (function (_super) {
|
|
|
+ __extends(InstancedLinesMesh, _super);
|
|
|
+ function InstancedLinesMesh(name, source) {
|
|
|
+ var _this = _super.call(this, name, source) || this;
|
|
|
+ _this.intersectionThreshold = source.intersectionThreshold;
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Returns the string "InstancedLinesMesh".
|
|
|
+ */
|
|
|
+ InstancedLinesMesh.prototype.getClassName = function () {
|
|
|
+ return "InstancedLinesMesh";
|
|
|
+ };
|
|
|
+ return InstancedLinesMesh;
|
|
|
+ }(BABYLON.InstancedMesh));
|
|
|
+ BABYLON.InstancedLinesMesh = InstancedLinesMesh;
|
|
|
})(BABYLON || (BABYLON = {}));
|
|
|
|
|
|
//# sourceMappingURL=babylon.linesMesh.js.map
|
|
@@ -84136,11 +84142,11 @@ var BABYLON;
|
|
|
return loadedMeshInfo;
|
|
|
// Look through all children recursively. This will return null if no mesh exists with the given name.
|
|
|
function getChildByName(node, name) {
|
|
|
- return node.getChildMeshes(false, function (n) { return n.name === name; })[0];
|
|
|
+ return node.getChildren(function (n) { return n.name === name; }, false)[0];
|
|
|
}
|
|
|
// Look through only immediate children. This will return null if no mesh exists with the given name.
|
|
|
function getImmediateChildByName(node, name) {
|
|
|
- return node.getChildMeshes(true, function (n) { return n.name == name; })[0];
|
|
|
+ return node.getChildren(function (n) { return n.name == name; }, true)[0];
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
@@ -107062,16 +107068,17 @@ var BABYLON;
|
|
|
});
|
|
|
};
|
|
|
makeNotPick(mesh);
|
|
|
- var childMeshes = mesh.getChildMeshes();
|
|
|
+ var meshChildren = mesh.getChildren(undefined, false);
|
|
|
+ var laserParent = mesh;
|
|
|
this.webVRController._pointingPoseNode = null;
|
|
|
- for (var i = 0; i < childMeshes.length; i++) {
|
|
|
- if (childMeshes[i].name && childMeshes[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
|
|
|
- mesh = childMeshes[i];
|
|
|
- this.webVRController._pointingPoseNode = mesh;
|
|
|
+ for (var i = 0; i < meshChildren.length; i++) {
|
|
|
+ if (meshChildren[i].name && meshChildren[i].name.indexOf(BABYLON.PoseEnabledController.POINTING_POSE) >= 0) {
|
|
|
+ laserParent = meshChildren[i];
|
|
|
+ this.webVRController._pointingPoseNode = laserParent;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- this._laserPointer.parent = mesh;
|
|
|
+ this._laserPointer.parent = laserParent;
|
|
|
};
|
|
|
VRExperienceHelperControllerGazer.prototype._updatePointerDistance = function (distance) {
|
|
|
if (distance === void 0) { distance = 100; }
|
|
@@ -111760,15 +111767,10 @@ var BABYLON;
|
|
|
this._edgesRenderer = new BABYLON.LineEdgesRenderer(this, epsilon, checkVerticesInsteadOfIndices);
|
|
|
return this;
|
|
|
};
|
|
|
- BABYLON.InstancedMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
|
|
|
+ BABYLON.InstancedLinesMesh.prototype.enableEdgesRendering = function (epsilon, checkVerticesInsteadOfIndices) {
|
|
|
if (epsilon === void 0) { epsilon = 0.95; }
|
|
|
if (checkVerticesInsteadOfIndices === void 0) { checkVerticesInsteadOfIndices = false; }
|
|
|
- if (this.sourceMesh.getClassName() === 'LinesMesh') {
|
|
|
- BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
|
|
|
- }
|
|
|
- else {
|
|
|
- BABYLON.AbstractMesh.prototype.enableEdgesRendering.apply(this, arguments);
|
|
|
- }
|
|
|
+ BABYLON.LinesMesh.prototype.enableEdgesRendering.apply(this, arguments);
|
|
|
return this;
|
|
|
};
|
|
|
/**
|