apply method

  1. @override
void apply(
  1. ActorComponent? component,
  2. double mix
)
override

Implementation

@override
void apply(ActorComponent? component, double mix) {
  ActorImage imageNode = component as ActorImage;
  int l = _vertices.length;
  Float32List? wr = imageNode.animationDeformedVertices;
  if (mix == 1.0) {
    for (int i = 0; i < l; i++) {
      wr![i] = _vertices[i];
    }
  } else {
    double mixi = 1.0 - mix;
    for (int i = 0; i < l; i++) {
      wr![i] = wr[i] * mixi + _vertices[i] * mix;
    }
  }

  imageNode.invalidateDrawable();
}