• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MeltyPlayer / MeltyTool / 19622977055

24 Nov 2025 04:05AM UTC coverage: 41.989% (+2.1%) from 39.89%
19622977055

push

github

MeltyPlayer
Switched float precision to fix broken tests.

6747 of 18131 branches covered (37.21%)

Branch coverage included in aggregate %.

28639 of 66144 relevant lines covered (43.3%)

65384.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/FinModelUtility/Fin/Fin/src/scene/instance/SceneModelInstanceImpl.cs
1
using System;
2
using System.Linq;
3

4
using fin.animation;
5
using fin.data.dictionaries;
6
using fin.math;
7
using fin.model;
8
using fin.model.skeleton;
9

10
namespace fin.scene.instance;
11

12
public partial class SceneInstanceImpl {
13
  private class SceneModelInstanceImpl : ISceneModelInstance {
14
    private readonly ListDictionary<IReadOnlyBone, ISceneModelInstance>
×
15
        children_ = new();
×
16

17
    public SceneModelInstanceImpl(IReadOnlySceneModel model) {
×
18
      this.Definition = model;
×
19
      this.SimpleBoneTransformView = new();
×
20
      this.BoneTransformManager = new BoneTransformManager();
×
21
      this.TextureTransformManager = new TextureTransformManager();
×
22

23
      this.Init_(model);
×
24
    }
×
25

26
    private SceneModelInstanceImpl(IReadOnlySceneModel model,
×
27
                                   SceneModelInstanceImpl parent,
×
28
                                   IReadOnlyBone bone) {
×
29
      this.Definition = model;
×
30
      this.SimpleBoneTransformView = new();
×
31
      this.BoneTransformManager = new BoneTransformManager(
×
32
          (parent.BoneTransformManager, bone));
×
33
      this.TextureTransformManager = new TextureTransformManager();
×
34

35
      this.Init_(model);
×
36
    }
×
37

38
    private void Init_(IReadOnlySceneModel model) {
×
39
      foreach (var (bone, children) in model.Children.GetPairs()) {
×
40
        foreach (var child in children) {
×
41
          this.children_.Add(bone,
×
42
                             new SceneModelInstanceImpl(child, this, bone));
×
43
        }
×
44
      }
×
45

46
      this.BoneTransformManager.CalculateStaticMatricesForManualProjection(
×
47
          this.Model,
×
48
          true);
×
49

50
      this.AnimationPlaybackManager = new FrameAdvancer {
×
51
          LoopPlayback = true,
×
52
      };
×
53

54
      this.Animation =
×
55
          this.Model.AnimationManager.Animations.FirstOrDefault();
×
56
      this.AnimationPlaybackManager.IsPlaying = true;
×
57
    }
×
58

59
    ~SceneModelInstanceImpl() => this.ReleaseUnmanagedResources_();
×
60

61
    public void Dispose() {
×
62
      this.ReleaseUnmanagedResources_();
×
63
      GC.SuppressFinalize(this);
×
64
    }
×
65

66
    private void ReleaseUnmanagedResources_() {
×
67
      foreach (var child in this.children_.Values) {
×
68
        child.Dispose();
×
69
      }
×
70
    }
×
71

72
    public void Tick() {
×
73
      this.AnimationPlaybackManager.Tick();
×
74
    }
×
75

76
    public IReadOnlySceneModel Definition { get; }
×
77

78

79
    public IReadOnlyListDictionary<IReadOnlyBone, ISceneModelInstance>
80
        Children => this.children_;
×
81

82
    public IReadOnlyModel Model => this.Definition.Model;
×
83

84
    public IBoneTransformManager BoneTransformManager { get; }
×
85
    public SimpleBoneTransformView SimpleBoneTransformView { get; }
×
86
    public ITextureTransformManager TextureTransformManager { get; }
×
87

88
    public IReadOnlyModelAnimation? Animation {
89
      get;
×
90
      set {
×
91
        if (field == value) {
×
92
          return;
×
93
        }
94

95
        field = value;
×
96
        this.SimpleBoneTransformView.AnimatedBoneTransformView.Animation
×
97
            = value;
×
98

99
        var apm = this.AnimationPlaybackManager;
×
100
        apm.Frame = 0;
×
101
        apm.FrameRate = (int) (value?.FrameRate ?? 20);
×
102
        apm.TotalFrames = value?.FrameCount ?? 0;
×
103
      }
×
104
    }
105

106
    public IAnimationPlaybackManager AnimationPlaybackManager {
107
      get;
×
108
      private set {
×
109
        field = value;
×
110
        this.SimpleBoneTransformView.AnimatedBoneTransformView.PlaybackManager
×
111
            = value;
×
112
      }
×
113
    }
114

115
    public float ViewerScale { get; set; } = 1;
×
116
  }
117
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc