MorpherComponent
morpher component
| Type | Name | Interface Description |
|---|---|---|
| Variables | calculateNormal: boolean | • Function: Gets or sets whether to calculate normals for the morphed mesh. When true, normals are calculated to ensure proper lighting on the morphed mesh. When false, performance may be better but lighting may appear incorrect. |
| Functions | constructor() | |
| Functions | clearBlendShapeWeights(): void | • Function: Resets all blend shape weights to 0, effectively clearing all morphing effects. This returns the mesh to its base state without any blend shape deformations. |
| Functions | getBlendShapeWeight(name: string): number | • Function: Gets the weight value of the blend shape channel with the specified name. The name must match a blend shape channel defined on the mesh/morpher. Returns 0 if no weight is found for the given name. Parameters • Returns The weight value of the blend shape channel |
| Functions | hasBlendShapeWeight(name: string): boolean | • Function: Checks if this component has a weight for the blend shape with the specified name. The name must match a blend shape channel defined on the mesh/morpher. Parameters • Returns True if a weight exists for the blend shape, false otherwise |
| Functions | setBlendShapeWeight(name: string, weight: number): void | • Function: Sets the weight value of the blend shape channel with the specified name. The name should normally match an existing blend shape channel defined on the mesh/morpher. If no channel exists with the given name, one will be created. Parameters • • |
Examples
constructor()
let obj = new APJS.MorpherComponent();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use MorpherComponent here
}
onUpdate(deltaTime: number) {
}
}