Browse Source

Add _clone() to Vector2 and to Vector3

customisations
alemart 10 months ago
parent
commit
730a51ce3f
2 changed files with 20 additions and 0 deletions
  1. 10
    0
      src/geometry/vector2.ts
  2. 10
    0
      src/geometry/vector3.ts

+ 10
- 0
src/geometry/vector2.ts View File

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
      * Normalize this vector
136
      * Normalize this vector
127
      * @returns this vector, normalized
137
      * @returns this vector, normalized
128
      * @internal
138
      * @internal

+ 10
- 0
src/geometry/vector3.ts View File

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
      * Normalize this vector
144
      * Normalize this vector
135
      * @returns this vector, normalized
145
      * @returns this vector, normalized
136
      * @internal
146
      * @internal

Loading…
Cancel
Save