• 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

96.47
/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
        this.LocalTransform.SetTranslation(x, y, z);
119✔
38

39
        this.skeleton_.bones.Add(this);
119✔
40

41
        this.Children = new ReadOnlyCollection<IBone>(this.children_);
119✔
42

43
        this.counter_ = (parent as BoneImpl)?.counter_ ?? new Counter();
119✔
44
        this.Index = this.counter_.GetAndIncrement();
119✔
45
      }
119✔
46

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

58
        this.skeleton_.bones.Add(this);
3,928✔
59

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

62
        this.counter_ = (parent as BoneImpl ?? root as BoneImpl)!.counter_;
3,928!
63
        this.Index = this.counter_.GetAndIncrement();
3,928✔
64
      }
3,928✔
65

66
      public string Name { get; set; }
12,580✔
67
      public int Index { get; set; }
806,208✔
68

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

71
      public IBone Root { get; }
3,928✔
72
      public IBone? Parent { get; }
176✔
73
      public IReadOnlyList<IBone> Children { get; }
142,474✔
74

75

76
      public IBone AddRoot(float x, float y, float z) {
7✔
77
        var child = new BoneImpl(this.skeleton_, this, x, y, z);
7✔
78
        this.children_.Add(child);
7✔
79
        return child;
7✔
80
      }
7✔
81

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

88
      public ITransform3d LocalTransform { get; } = new Transform3d();
4,044,774✔
89
      public bool IgnoreParentScale { get; set; }
4,636✔
90

91
      public IBone AlwaysFaceTowardsCamera(
92
          FaceTowardsCameraType faceTowardsCameraType)
93
        => this.AlwaysFaceTowardsCamera(faceTowardsCameraType, Quaternion.Identity);
5✔
94
      public IBone AlwaysFaceTowardsCamera(
95
          FaceTowardsCameraType faceTowardsCameraType,
96
          in Quaternion adjustment) {
5✔
97
        this.FaceTowardsCameraType = faceTowardsCameraType;
5✔
98
        this.FaceTowardsCameraAdjustment = adjustment;
5✔
99
        return this;
5✔
100
      }
5✔
101

102
      public FaceTowardsCameraType FaceTowardsCameraType { get; private set; }
3,896✔
103
      public Quaternion FaceTowardsCameraAdjustment { get; private set; }
5✔
104
    }
105

106
    IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator();
×
107

108
    public IEnumerator<IReadOnlyBone> GetEnumerator() {
1,664✔
109
      var queue = new Queue<IReadOnlyBone>();
1,664✔
110
      queue.Enqueue(this.Root);
1,664✔
111
      while (queue.Count > 0) {
270,298✔
112
        var bone = queue.Dequeue();
134,317✔
113
        yield return bone;
134,317✔
114

115
        foreach (var child in bone.Children) {
800,910✔
116
          queue.Enqueue(child);
132,653✔
117
        }
132,653✔
118
      }
134,317✔
119
    }
1,664✔
120
  }
121
}
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