Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstancedMesh.getMorphAt() + docs #826

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading