From 493b8606d2a487733815cee6484725d0dc63618a Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Tue, 20 Feb 2024 09:17:52 -0500 Subject: [PATCH] InstancedMesh.getMorphAt() + docs --- types/three/src/objects/InstancedMesh.d.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/types/three/src/objects/InstancedMesh.d.ts b/types/three/src/objects/InstancedMesh.d.ts index 1a6ec7f81..7ac790434 100644 --- a/types/three/src/objects/InstancedMesh.d.ts +++ b/types/three/src/objects/InstancedMesh.d.ts @@ -83,6 +83,10 @@ export class InstancedMesh< */ instanceMatrix: InstancedBufferAttribute; + /** + * Represents the morph target weights of all instances. You have to set its {@link .needsUpdate} flag to true if + * you modify instanced data via {@link .setMorphAt}. + */ morphTexture: DataTexture | null; /** @@ -120,6 +124,13 @@ export class InstancedMesh< */ getMatrixAt(index: number, matrix: Matrix4): void; + /** + * Get the morph target weights of the defined instance. + * @param index The index of an instance. Values have to be in the range [0, count]. + * @param mesh The {@link .morphTargetInfluences} property of this mesh will be filled with the morph target weights of the defined instance. + */ + getMorphAt(index: number, mesh: Mesh): void; + /** * Sets the given local transformation matrix to the defined instance. * @remarks @@ -129,7 +140,13 @@ export class InstancedMesh< */ setMatrixAt(index: number, matrix: Matrix4): void; - setMorphAt(index: number, dummy: Mesh): void; + /** + * Sets the morph target weights to the defined instance. Make sure you set {@link .morphTexture}{@link .needsUpdate} + * to true after updating all the influences. + * @param index The index of an instance. Values have to be in the range [0, count]. + * @param mesh A mesh with {@link .morphTargetInfluences} property containing the morph target weights of a single instance. + */ + setMorphAt(index: number, mesh: Mesh): void; /** * No effect in {@link InstancedMesh}.