瀏覽代碼

Add _clone() to Vector2 and to Vector3

customisations
alemart 10 月之前
父節點
當前提交
730a51ce3f
共有 2 個文件被更改,包括 20 次插入0 次删除
  1. 10
    0
      src/geometry/vector2.ts
  2. 10
    0
      src/geometry/vector3.ts

+ 10
- 0
src/geometry/vector2.ts 查看文件

@@ -123,6 +123,16 @@ export class Vector2
123 123
     }
124 124
 
125 125
     /**
126
+     * Clone this vector
127
+     * @returns a clone of this vector
128
+     * @internal
129
+     */
130
+    _clone(): Vector2
131
+    {
132
+        return new Vector2(this.x, this.y);
133
+    }
134
+
135
+    /**
126 136
      * Normalize this vector
127 137
      * @returns this vector, normalized
128 138
      * @internal

+ 10
- 0
src/geometry/vector3.ts 查看文件

@@ -131,6 +131,16 @@ export class Vector3
131 131
     }
132 132
 
133 133
     /**
134
+     * Clone this vector
135
+     * @returns a clone of this vector
136
+     * @internal
137
+     */
138
+    _clone(): Vector3
139
+    {
140
+        return new Vector3(this.x, this.y, this.z);
141
+    }
142
+
143
+    /**
134 144
      * Normalize this vector
135 145
      * @returns this vector, normalized
136 146
      * @internal

Loading…
取消
儲存