Browse Source

Merge pull request #17627 from Mugen87/dev38

TS: Added InstancedMesh.d.ts.
Michael Herzog 5 years ago
parent
commit
86f14f5510
3 changed files with 26 additions and 0 deletions
  1. 1 0
      src/Three.d.ts
  2. 23 0
      src/objects/InstancedMesh.d.ts
  3. 2 0
      src/objects/InstancedMesh.js

+ 1 - 0
src/Three.d.ts

@@ -12,6 +12,7 @@ export * from './scenes/Fog';
 export * from './scenes/Scene';
 export * from './objects/Sprite';
 export * from './objects/LOD';
+export * from './objects/InstancedMesh';
 export * from './objects/SkinnedMesh';
 export * from './objects/Skeleton';
 export * from './objects/Bone';

+ 23 - 0
src/objects/InstancedMesh.d.ts

@@ -0,0 +1,23 @@
+import { Geometry } from './../core/Geometry';
+import { BufferGeometry } from '../core/BufferGeometry';
+import { Material } from './../materials/Material';
+import { BufferAttribute } from './../core/BufferAttribute.js';
+import { Mesh } from './Mesh';
+import { Matrix4 } from './../math/Matrix4';
+
+export class InstancedMesh extends Mesh {
+
+	constructor(
+		geometry: Geometry | BufferGeometry,
+		material: Material | Material[],
+		count: number
+	);
+
+	count: number;
+	instanceMatrix: BufferAttribute;
+	isInstancedMesh: true;
+	type: 'InstancedMesh';
+
+	setMatrixAt( index: number, matrix: Matrix4 ): void;
+
+}

+ 2 - 0
src/objects/InstancedMesh.js

@@ -13,6 +13,8 @@ function InstancedMesh( geometry, material, count ) {
 
 	this.count = count;
 
+	this.type = 'InstancedMesh';
+
 }
 
 InstancedMesh.prototype = Object.assign( Object.create( Mesh.prototype ), {