diff --git a/src/Three.d.ts b/src/Three.d.ts index fc61e25f4633cc8605352ea983ec6a169209f145..deb9f697931f0cd76752ec1152f3755a3ed9f94b 100644 --- a/src/Three.d.ts +++ b/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'; diff --git a/src/objects/InstancedMesh.d.ts b/src/objects/InstancedMesh.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6754932dcd70b78d9fdc91e158512c0da1ce936b --- /dev/null +++ b/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; + +} diff --git a/src/objects/InstancedMesh.js b/src/objects/InstancedMesh.js index 3ecc223d1650d721f0fd987ca262cea7998c5e4b..0fbf639ac66b2eb463d2952ebfae3498cc330c19 100644 --- a/src/objects/InstancedMesh.js +++ b/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 ), {