David Catuhe 8 năm trước cách đây
mục cha
commit
388b0f27d3

+ 2 - 0
dist/preview release/babylon.d.ts

@@ -4382,6 +4382,7 @@ declare module BABYLON {
         private updateFrustumPlanes();
         isInFrustum(target: ICullable): boolean;
         isCompletelyInFrustum(target: ICullable): boolean;
+        getForwardRay(length?: number): Ray;
         dispose(): void;
         setCameraRigMode(mode: number, rigParams: any): void;
         private _getVRProjectionMatrix();
@@ -14809,6 +14810,7 @@ declare module BABYLON {
         attachToPoseControlledCamera(camera: TargetCamera): void;
         detachMesh(): void;
         readonly mesh: AbstractMesh;
+        getForwardRay(length?: number): Ray;
     }
     interface GamepadButtonChanges {
         changed: boolean;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 29 - 29
dist/preview release/babylon.js


+ 24 - 0
dist/preview release/babylon.max.js

@@ -13511,6 +13511,21 @@ var BABYLON;
             this.updateFrustumPlanes();
             return target.isCompletelyInFrustum(this._frustumPlanes);
         };
+        Camera.prototype.getForwardRay = function (length) {
+            if (length === void 0) { length = 100; }
+            var m = this.getWorldMatrix();
+            var origin;
+            if (this.devicePosition) {
+                origin = this.position.add(this.devicePosition);
+            }
+            else {
+                origin = this.position;
+            }
+            var forward = new BABYLON.Vector3(0, 0, 1);
+            var forwardWorld = BABYLON.Vector3.TransformNormal(forward, m);
+            var direction = BABYLON.Vector3.Normalize(forwardWorld);
+            return new BABYLON.Ray(origin, direction, length);
+        };
         Camera.prototype.dispose = function () {
             // Animations
             this.getScene().stopAnimation(this);
@@ -46087,6 +46102,15 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        PoseEnabledController.prototype.getForwardRay = function (length) {
+            if (length === void 0) { length = 100; }
+            var m = this.mesh.getWorldMatrix();
+            var origin = m.getTranslation();
+            var forward = new BABYLON.Vector3(0, 0, -1);
+            var forwardWorld = BABYLON.Vector3.TransformNormal(forward, m);
+            var direction = BABYLON.Vector3.Normalize(forwardWorld);
+            return new BABYLON.Ray(origin, direction, length);
+        };
         return PoseEnabledController;
     }(BABYLON.Gamepad));
     BABYLON.PoseEnabledController = PoseEnabledController;

+ 2 - 0
dist/preview release/babylon.module.d.ts

@@ -4382,6 +4382,7 @@ declare module BABYLON {
         private updateFrustumPlanes();
         isInFrustum(target: ICullable): boolean;
         isCompletelyInFrustum(target: ICullable): boolean;
+        getForwardRay(length?: number): Ray;
         dispose(): void;
         setCameraRigMode(mode: number, rigParams: any): void;
         private _getVRProjectionMatrix();
@@ -14809,6 +14810,7 @@ declare module BABYLON {
         attachToPoseControlledCamera(camera: TargetCamera): void;
         detachMesh(): void;
         readonly mesh: AbstractMesh;
+        getForwardRay(length?: number): Ray;
     }
     interface GamepadButtonChanges {
         changed: boolean;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 29 - 29
dist/preview release/babylon.worker.js