2
0
Эх сурвалжийг харах

Port changes from @types/three

Nathan Bierema 6 жил өмнө
parent
commit
a5cb67909a

+ 1 - 0
src/core/BufferGeometry.d.ts

@@ -44,6 +44,7 @@ export class BufferGeometry extends EventDispatcher {
   boundingBox: Box3;
   boundingBox: Box3;
   boundingSphere: Sphere;
   boundingSphere: Sphere;
   drawRange: { start: number; count: number };
   drawRange: { start: number; count: number };
+  userData: {[key: string]: any};
 
 
   getIndex(): BufferAttribute;
   getIndex(): BufferAttribute;
   setIndex(index: BufferAttribute | number[]): void;
   setIndex(index: BufferAttribute | number[]): void;

+ 2 - 0
src/core/Object3D.d.ts

@@ -308,6 +308,8 @@ export class Object3D extends EventDispatcher {
    */
    */
   updateMatrixWorld(force: boolean): void;
   updateMatrixWorld(force: boolean): void;
 
 
+  updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void;
+
   toJSON(meta?: {
   toJSON(meta?: {
     geometries: any;
     geometries: any;
     materials: any;
     materials: any;

+ 1 - 0
src/math/Color.d.ts

@@ -125,4 +125,5 @@ export class Color {
   equals(color: Color): boolean;
   equals(color: Color): boolean;
   fromArray(rgb: number[], offset?: number): this;
   fromArray(rgb: number[], offset?: number): this;
   toArray(array?: number[], offset?: number): number[];
   toArray(array?: number[], offset?: number): number[];
+  toArray(xyz: ArrayLike<number>, offset?: number): ArrayLike<number>;
 }
 }

+ 9 - 0
src/math/Vector2.d.ts

@@ -401,9 +401,18 @@ export class Vector2 implements Vector {
    * Returns an array [x, y], or copies x and y into the provided array.
    * Returns an array [x, y], or copies x and y into the provided array.
    * @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
    * @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
    * @param offset (optional) optional offset into the array.
    * @param offset (optional) optional offset into the array.
+   * @return The created or provided array.
    */
    */
   toArray(array?: number[], offset?: number): number[];
   toArray(array?: number[], offset?: number): number[];
 
 
+  /**
+   * Copies x and y into the provided array-like.
+   * @param array array-like to store the vector to.
+   * @param offset (optional) optional offset into the array.
+   * @return The provided array-like.
+   */
+  toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>;
+
   /**
   /**
    * Sets this vector's x and y values from the attribute.
    * Sets this vector's x and y values from the attribute.
    * @param attribute the source attribute.
    * @param attribute the source attribute.

+ 17 - 1
src/math/Vector3.d.ts

@@ -112,7 +112,7 @@ export class Vector3 implements Vector {
 
 
   applyQuaternion(q: Quaternion): this;
   applyQuaternion(q: Quaternion): this;
 
 
-  project(camrea: Camera): this;
+  project(camera: Camera): this;
 
 
   unproject(camera: Camera): this;
   unproject(camera: Camera): this;
 
 
@@ -246,7 +246,23 @@ export class Vector3 implements Vector {
   equals(v: Vector3): boolean;
   equals(v: Vector3): boolean;
 
 
   fromArray(xyz: number[], offset?: number): Vector3;
   fromArray(xyz: number[], offset?: number): Vector3;
+
+  /**
+   * Returns an array [x, y, z], or copies x, y and z into the provided array.
+   * @param array (optional) array to store the vector to. If this is not provided, a new array will be created.
+   * @param offset (optional) optional offset into the array.
+   * @return The created or provided array.
+   */
   toArray(xyz?: number[], offset?: number): number[];
   toArray(xyz?: number[], offset?: number): number[];
+
+  /**
+   * Copies x, y and z into the provided array-like.
+   * @param array array-like to store the vector to.
+   * @param offset (optional) optional offset into the array.
+   * @return The provided array-like.
+   */
+  toArray(xyz: ArrayLike<number>, offset?: number): ArrayLike<number>;
+
   fromBufferAttribute(
   fromBufferAttribute(
     attribute: BufferAttribute,
     attribute: BufferAttribute,
     index: number,
     index: number,