class AnimationNodeBlendSpace2D
package godot
extends AnimationRootNode › AnimationNode › Resource › Reference › Object
A resource to add to an godot.AnimationNodeBlendTree
.
This node allows you to blend linearly between three animations using a godot.Vector2
weight.
You can add vertices to the blend space with godot.AnimationNodeBlendSpace2D.addBlendPoint
and automatically triangulate it by setting godot.AnimationNodeBlendSpace2D.autoTriangles
to true
. Otherwise, use godot.AnimationNodeBlendSpace2D.addTriangle
and godot.AnimationNodeBlendSpace2D.removeTriangle
to create up the blend space by hand.
Constructor
Variables
autoTriangles:Bool
If true
, the blend space is triangulated automatically. The mesh updates every time you add or remove points with godot.AnimationNodeBlendSpace2D.addBlendPoint
and godot.AnimationNodeBlendSpace2D.removeBlendPoint
.
blendMode:AnimationNodeBlendSpace2D_BlendModeEnum
Controls the interpolation between animations. See godot.AnimationNodeBlendSpace2D_BlendModeEnum
constants.
maxSpace:Vector2
The blend space's X and Y axes' upper limit for the points' position. See godot.AnimationNodeBlendSpace2D.addBlendPoint
.
minSpace:Vector2
The blend space's X and Y axes' lower limit for the points' position. See godot.AnimationNodeBlendSpace2D.addBlendPoint
.
Methods
addBlendPoint(node:AnimationRootNode, pos:Vector2, ?atIndex:Int):Void
Adds a new point that represents a node
at the position set by pos
. You can insert it at a specific index using the at_index
argument. If you use the default value for at_index
, the point is inserted at the end of the blend points array.
addTriangle(x:Int, y:Int, z:Int, ?atIndex:Int):Void
Creates a new triangle using three points x
, y
, and z
. Triangles can overlap. You can insert the triangle at a specific index using the at_index
argument. If you use the default value for at_index
, the point is inserted at the end of the blend points array.
getBlendPointNode(point:Int):AnimationRootNode
Returns the godot.AnimationRootNode
referenced by the point at index point
.
getTrianglePoint(triangle:Int, point:Int):Int
Returns the position of the point at index point
in the triangle of index triangle
.
setBlendPointNode(point:Int, node:AnimationRootNode):Void
Changes the godot.AnimationNode
referenced by the point at index point
.
setBlendPointPosition(point:Int, pos:Vector2):Void
Updates the position of the point at index point
on the blend axis.