Jelajahi Sumber

Add getters and setters for the ortho properties

Popov72 4 tahun lalu
induk
melakukan
ad6540a44c
1 mengubah file dengan 48 tambahan dan 0 penghapusan
  1. 48 0
      src/Lights/directionalLight.ts

+ 48 - 0
src/Lights/directionalLight.ts

@@ -70,12 +70,60 @@ export class DirectionalLight extends ShadowLight {
     public autoCalcShadowZBounds = false;
 
     // Cache
+    @serialize("orthoLeft")
     private _orthoLeft = Number.MAX_VALUE;
+    @serialize("orthoRight")
     private _orthoRight = Number.MIN_VALUE;
+    @serialize("orthoTop")
     private _orthoTop = Number.MIN_VALUE;
+    @serialize("orthoBottom")
     private _orthoBottom = Number.MAX_VALUE;
 
     /**
+     * Gets or sets the orthoLeft property used to build the light frustum
+     */
+    public get orthoLeft(): number {
+        return this._orthoLeft;
+    }
+
+    public set orthoLeft(left: number) {
+        this._orthoLeft = left;
+    }
+
+    /**
+     * Gets or sets the orthoRight property used to build the light frustum
+     */
+    public get orthoRight(): number {
+        return this._orthoRight;
+    }
+
+    public set orthoRight(right: number) {
+        this._orthoRight = right;
+    }
+
+    /**
+     * Gets or sets the orthoTop property used to build the light frustum
+     */
+    public get orthoTop(): number {
+        return this._orthoTop;
+    }
+
+    public set orthoTop(top: number) {
+        this._orthoTop = top;
+    }
+
+    /**
+     * Gets or sets the orthoBottom property used to build the light frustum
+     */
+    public get orthoBottom(): number {
+        return this._orthoBottom;
+    }
+
+    public set orthoBottom(bottom: number) {
+        this._orthoBottom = bottom;
+    }
+
+    /**
      * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
      * The directional light is emitted from everywhere in the given direction.
      * It can cast shadows.