فهرست منبع

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 10 سال پیش
والد
کامیت
28cbb08ff5

+ 2 - 6
Babylon/Mesh/babylon.abstractMesh.js

@@ -75,7 +75,7 @@ var BABYLON;
             this._onCollisionPositionChange = function (collisionId, newPosition, collidedMesh) {
                 if (collidedMesh === void 0) { collidedMesh = null; }
                 //TODO move this to the collision coordinator!
-                if (collisionId != null || collisionId != undefined)
+                if (_this.getScene().workerCollisions)
                     newPosition.multiplyInPlace(_this._collider.radius);
                 newPosition.subtractToRef(_this._oldPositionForCollisions, _this._diffPositionForCollisions);
                 if (_this._diffPositionForCollisions.length() > BABYLON.Engine.CollisionsEpsilon) {
@@ -501,10 +501,7 @@ var BABYLON;
             this.rotationQuaternion = BABYLON.Quaternion.RotationYawPitchRoll(yaw + yawCor, pitch + pitchCor, rollCor);
         };
         AbstractMesh.prototype.isInFrustum = function (frustumPlanes) {
-            if (!this._boundingInfo.isInFrustum(frustumPlanes)) {
-                return false;
-            }
-            return true;
+            return this._boundingInfo.isInFrustum(frustumPlanes);
         };
         AbstractMesh.prototype.isCompletelyInFrustum = function (camera) {
             if (!camera) {
@@ -824,4 +821,3 @@ var BABYLON;
     })(BABYLON.Node);
     BABYLON.AbstractMesh = AbstractMesh;
 })(BABYLON || (BABYLON = {}));
-//# sourceMappingURL=babylon.abstractMesh.js.map

+ 2 - 6
Babylon/Mesh/babylon.abstractMesh.ts

@@ -564,11 +564,7 @@
         }
 
         public isInFrustum(frustumPlanes: Plane[]): boolean {
-            if (!this._boundingInfo.isInFrustum(frustumPlanes)) {
-                return false;
-            }
-
-            return true;
+            return this._boundingInfo.isInFrustum(frustumPlanes);
         }
 
         public isCompletelyInFrustum(camera?: Camera): boolean {
@@ -724,7 +720,7 @@
 
         private _onCollisionPositionChange = (collisionId: number, newPosition: Vector3, collidedMesh: AbstractMesh = null) => {
             //TODO move this to the collision coordinator!
-            if (collisionId != null || collisionId != undefined)
+            if (this.getScene().workerCollisions)
                 newPosition.multiplyInPlace(this._collider.radius);
 
             newPosition.subtractToRef(this._oldPositionForCollisions, this._diffPositionForCollisions);

+ 1 - 1
Loaders/STL/babylon.stlFileLoader.js

@@ -2,7 +2,7 @@ var BABYLON;
 (function (BABYLON) {
     var STLFileLoader = (function () {
         function STLFileLoader() {
-            this.solidPattern = /solid (\S*)([\S\s]*)endsolid (\S*)/g;
+            this.solidPattern = /solid (\S*)([\S\s]*)endsolid[ ]*(\S*)/g;
             this.facetsPattern = /facet([\s\S]*?)endfacet/g;
             this.normalPattern = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
             this.vertexPattern = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;

+ 1 - 1
Loaders/STL/babylon.stlFileLoader.ts

@@ -2,7 +2,7 @@
 
     export class STLFileLoader implements ISceneLoaderPlugin {
 
-        public solidPattern = /solid (\S*)([\S\s]*)endsolid (\S*)/g;
+        public solidPattern = /solid (\S*)([\S\s]*)endsolid[ ]*(\S*)/g;
         public facetsPattern = /facet([\s\S]*?)endfacet/g;
         public normalPattern = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
         public vertexPattern = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;