ent_blend (STRING* scene, var anim_percent, var blend_percent);

Interpoliert den Animationsframe bzw. das Skelett der my Modell-Entity zwischen zwei Animationsszenen. Die Quell-Szene ist die gegenwärtige Skelettposition oder der gegenwärtige frame-Parameter, der von ent_animate gesetzt wird.

Parameter:

scene Name der Zielanimationsszene ohne die Trailing-Nummer; STRING* oder char*
anim_percent Prozent der Zielanimation, 0..100
blend_percent Prozentuale Überblendung zwischen voriger und neuer Szene, 0..100

Modifiziert:

my.frame Neuer Quellframe plus Interpolationsfaktor (nur bei Sprite- oder Vertex-Szenen)
my.next_frame Neuer Zielframe (nur bei Vertex-Animationsszenen)

Geschwindigkeit:

Mittel (Vertex-Animation).
Langsam (Bones-Animation).

Bemerkungen:

Algorithmus:

//vertex scenes only
ent_blend (STRING* name, var anim_percent, var blend_percent)
{ 
  var oldframe = my.frame; 
  if (fraction(oldframe) > 0.5) { 
    if (my.next_frame)
      oldframe = my.next_frame; 
    else 
      oldframe += 1;
  } 
  ent_animate(my,name,anim_percent,0); 
  my.next_frame = integer(my.frame); 
  my.frame = integer(oldframe) + blend_percent*0.01; 
}

Beispiel:

//Sets the entity to a vertex frame within 50% of the walk cycle,
//and then blends over to the first frame of the stand cycle.
ent_animate(my,"walk",50,ANM_CYCLE);
ent_blend("stand",0,25);
//The result of this code is a frame mixed from 75% of the middle 
//of the "walk" cycle and 25% of first frame of the "stand" cycle.

Siehe auch:

ent_animate, frame, pose, ent_blendpose

► Aktuelle Version Online