mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-09 23:28:03 +08:00
Animation evaluation improvements
This commit is contained in:
parent
629ee125a5
commit
d60234469a
@ -496,8 +496,7 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public override float EvaluateFloat(int frame)
|
public override float EvaluateFloat(int frame)
|
||||||
{
|
{
|
||||||
if(frame<Frames?.Length) return Values[Frames[frame]];
|
if (Frames?.Length > 0) return Values[Frames[frame % Frames.Length]];
|
||||||
if (Values?.Length > 0) return Values[0];
|
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,8 +525,7 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public override float EvaluateFloat(int frame)
|
public override float EvaluateFloat(int frame)
|
||||||
{
|
{
|
||||||
if (frame < Values?.Length) return Values[frame];
|
if (Values?.Length > 0) return Values[frame%Values.Length];
|
||||||
if (Values?.Length > 0) return Values[0];
|
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -637,8 +635,7 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public override float EvaluateFloat(int frame)
|
public override float EvaluateFloat(int frame)
|
||||||
{
|
{
|
||||||
if (frame < Values?.Length) return Values[frame];
|
if (Values?.Length > 0) return Values[frame % Values.Length];
|
||||||
if (Values?.Length > 0) return Values[0];
|
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -690,8 +687,7 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
public override float EvaluateFloat(int frame)
|
public override float EvaluateFloat(int frame)
|
||||||
{
|
{
|
||||||
if (frame < Values?.Length) return Values[frame];
|
if (Values?.Length > 0) return Values[frame % Values.Length];
|
||||||
if (Values?.Length > 0) return Values[0];
|
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,11 +430,12 @@ namespace CodeWalker.Rendering
|
|||||||
var clipanimlist = cme.Clip as ClipAnimationList;
|
var clipanimlist = cme.Clip as ClipAnimationList;
|
||||||
if (clipanimlist?.Animations != null)
|
if (clipanimlist?.Animations != null)
|
||||||
{
|
{
|
||||||
float t = clipanimlist.GetPlaybackTime(CurrentAnimTime);
|
//float t = clipanimlist.GetPlaybackTime(CurrentAnimTime);
|
||||||
foreach (var canim in clipanimlist.Animations)
|
foreach (var canim in clipanimlist.Animations)
|
||||||
{
|
{
|
||||||
if (canim?.Animation == null) continue;
|
if (canim?.Animation == null) continue;
|
||||||
UpdateAnim(canim.Animation, t*canim.Rate + canim.StartTime);
|
//UpdateAnim(canim.Animation, t*canim.Rate + canim.StartTime);
|
||||||
|
UpdateAnim(canim.Animation, canim.GetPlaybackTime(CurrentAnimTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,11 +562,12 @@ namespace CodeWalker.Rendering
|
|||||||
var clipanimlist = cme.Clip as ClipAnimationList;
|
var clipanimlist = cme.Clip as ClipAnimationList;
|
||||||
if (clipanimlist?.Animations != null)
|
if (clipanimlist?.Animations != null)
|
||||||
{
|
{
|
||||||
float t = clipanimlist.GetPlaybackTime(CurrentAnimTime);
|
//float t = clipanimlist.GetPlaybackTime(CurrentAnimTime);
|
||||||
foreach (var canim in clipanimlist.Animations)
|
foreach (var canim in clipanimlist.Animations)
|
||||||
{
|
{
|
||||||
if (canim?.Animation == null) continue;
|
if (canim?.Animation == null) continue;
|
||||||
UpdateAnimUV(canim.Animation, t*canim.Rate + canim.StartTime, rgeom);
|
//UpdateAnimUV(canim.Animation, t * canim.Rate + canim.StartTime, rgeom);
|
||||||
|
UpdateAnimUV(canim.Animation, canim.GetPlaybackTime(CurrentAnimTime), rgeom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user