Skip to content

Commit

Permalink
InstancedMesh.getMorphAt() + docs (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Feb 20, 2024
1 parent 2106c34 commit 942cbe7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion types/three/src/objects/InstancedMesh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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
Expand All @@ -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}.
Expand Down

0 comments on commit 942cbe7

Please sign in to comment.