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

MeltyPlayer / MeltyTool / 20982513833

14 Jan 2026 04:35AM UTC coverage: 41.138% (-0.8%) from 41.907%
20982513833

push

github

MeltyPlayer
Fixed broken shader source tests.

6752 of 18485 branches covered (36.53%)

Branch coverage included in aggregate %.

28650 of 67572 relevant lines covered (42.4%)

64006.02 hits per line

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

95.74
/FinModelUtility/Fin/Fin/src/model/impl/SkeletonImpl.cs
1
using System.Collections;
2
using System.Collections.Generic;
3
using System.Collections.ObjectModel;
4
using System.Numerics;
5

6
using fin.data;
7
using fin.math.transform;
8

9
namespace fin.model.impl;
10

11
public partial class ModelImpl<TVertex> {
12
  public ISkeleton Skeleton { get; } = new SkeletonImpl();
2,090✔
13

14
  private class SkeletonImpl : ISkeleton {
15
    public readonly List<IBone> bones = [];
112✔
16

17
    public IBone Root { get; }
31,687✔
18
    public IReadOnlyList<IBone> Bones => this.bones;
156✔
19

20
    public SkeletonImpl() {
224✔
21
      this.Root = new BoneImpl(this, null, 0, 0, 0);
112✔
22
    }
112✔
23

24
    private class BoneImpl : IBone {
25
      private readonly SkeletonImpl skeleton_;
26
      private readonly IList<IBone> children_ = new List<IBone>();
4,047✔
27
      private readonly Counter counter_;
28

29
      public BoneImpl(SkeletonImpl skeletonImpl,
119✔
30
                      IBone? parent,
119✔
31
                      float x,
119✔
32
                      float y,
119✔
33
                      float z) {
238✔
34
        this.skeleton_ = skeletonImpl;
119✔
35
        this.Root = this;
119✔
36
        this.Parent = parent;
119✔
37

38
        this.Transform
119✔
39
            = new Transform3d(parent?.Transform as Transform3d);
119✔
40
        this.Transform.SetTranslation(x, y, z);
119✔
41

42
        this.skeleton_.bones.Add(this);
119✔
43

44
        this.Children = new ReadOnlyCollection<IBone>(this.children_);
119✔
45

46
        this.counter_ = (parent as BoneImpl)?.counter_ ?? new Counter();
119✔
47
        this.Index = this.counter_.GetAndIncrement();
119✔
48
      }
119✔
49

50
      public BoneImpl(SkeletonImpl skeletonImpl,
3,928✔
51
                      IBone root,
3,928✔
52
                      IBone? parent,
3,928✔
53
                      float x,
3,928✔
54
                      float y,
3,928✔
55
                      float z) {
7,856✔
56
        this.skeleton_ = skeletonImpl;
3,928✔
57
        this.Root = root;
3,928✔
58
        this.Parent = parent;
3,928✔
59

60
        this.Transform
3,928!
61
            = new Transform3d(parent?.Transform as Transform3d);
3,928✔
62
        this.Transform.SetTranslation(x, y, z);
3,928✔
63

64
        this.skeleton_.bones.Add(this);
3,928✔
65

66
        this.Children = new ReadOnlyCollection<IBone>(this.children_);
3,928✔
67

68
        this.counter_ = (parent as BoneImpl ?? root as BoneImpl)!.counter_;
3,928!
69
        this.Index = this.counter_.GetAndIncrement();
3,928✔
70
      }
3,928✔
71

72
      public string Name { get; set; }
12,580✔
73
      public int Index { get; set; }
572,713✔
74

75
      public override string ToString() => $"{this.Name} <{this.Index}>";
×
76

77
      public IBone Root { get; }
3,928✔
78
      public IBone? Parent { get; }
176✔
79
      public IReadOnlyList<IBone> Children { get; }
142,474✔
80

81

82
      public IBone AddRoot(float x, float y, float z) {
7✔
83
        var child = new BoneImpl(this.skeleton_, this, x, y, z);
7✔
84
        this.children_.Add(child);
7✔
85
        return child;
7✔
86
      }
7✔
87

88
      public IBone AddChild(float x, float y, float z) {
3,928✔
89
        var child = new BoneImpl(this.skeleton_, this.Root, this, x, y, z);
3,928✔
90
        this.children_.Add(child);
3,928✔
91
        return child;
3,928✔
92
      }
3,928✔
93

94
      public ITransform3d Transform { get; }
4,049,040✔
95

96
      public bool IgnoreParentScale {
97
        get => this.Transform.IgnoreParentScale;
4,144✔
98
        set => this.Transform.IgnoreParentScale = value;
234✔
99
      }
100

101
      public IBone AlwaysFaceTowardsCamera(
102
          FaceTowardsCameraType faceTowardsCameraType)
103
        => this.AlwaysFaceTowardsCamera(faceTowardsCameraType, Quaternion.Identity);
5✔
104
      public IBone AlwaysFaceTowardsCamera(
105
          FaceTowardsCameraType faceTowardsCameraType,
106
          in Quaternion adjustment) {
5✔
107
        this.FaceTowardsCameraType = faceTowardsCameraType;
5✔
108
        this.FaceTowardsCameraAdjustment = adjustment;
5✔
109
        return this;
5✔
110
      }
5✔
111

112
      public FaceTowardsCameraType FaceTowardsCameraType { get; private set; }
5✔
113
      public Quaternion FaceTowardsCameraAdjustment { get; private set; }
5✔
114
    }
115

116
    IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator();
×
117

118
    public IEnumerator<IReadOnlyBone> GetEnumerator() {
1,664✔
119
      var queue = new Queue<IReadOnlyBone>();
1,664✔
120
      queue.Enqueue(this.Root);
1,664✔
121
      while (queue.Count > 0) {
270,298✔
122
        var bone = queue.Dequeue();
134,317✔
123
        yield return bone;
134,317✔
124

125
        foreach (var child in bone.Children) {
800,910✔
126
          queue.Enqueue(child);
132,653✔
127
        }
132,653✔
128
      }
134,317✔
129
    }
1,664✔
130
  }
131
}
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