• 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

0.0
/FinModelUtility/Fin/Fin/src/model/skeleton/SimpleBoneTransformView.cs
1
using System.Numerics;
2

3
using fin.data.indexable;
4

5

6
using fin.model.util;
7

8
namespace fin.model.skeleton;
9

10
/// <summary>
11
///   Well, this is simple for downstream users at least.
12
/// </summary>
13
public sealed class SimpleBoneTransformView : IBoneTransformView {
14
  private const bool USE_FASTER_TRANSFORM_VIEW = false;
15

16
  private readonly IBoneTransformView[] impls_;
17

18
  private IndexableDictionary<IReadOnlyBone, Vector3> worldTranslationOverrides_
×
19
      = new();
×
20

21
  private IndexableDictionary<IReadOnlyBone, Quaternion> worldRotationOverrides_
×
22
      = new();
×
23

24
  private IndexableDictionary<IReadOnlyBone, Vector3> worldScaleOverrides_
×
25
      = new();
×
26

27
  private IReadOnlyBone? bone_;
28

29
  public SimpleBoneTransformView() {
×
30
    this.AnimatedBoneTransformView = new();
×
31
    this.impls_ = [
×
32
        this.AnimatedBoneTransformView,
×
33
        new RootBoneTransformView(),
×
34
    ];
×
35
  }
×
36

37
  #if USE_FASTER_TRANSFORM_VIEW
38
  public FasterAnimatedBoneTransformView AnimatedBoneTransformView { get; }
39
  #else
40
  public AnimatedBoneTransformView AnimatedBoneTransformView { get; }
×
41
  #endif
42

43
  public bool HasAnyOverrides
44
    => this.worldTranslationOverrides_.Count > 0 ||
×
45
       this.worldRotationOverrides_.Count > 0 ||
×
46
       this.worldScaleOverrides_.Count > 0;
×
47

48
  public void OverrideWorldTranslation(IReadOnlyBone bone,
49
                                       Vector3 translation)
50
    => this.worldTranslationOverrides_[bone] = translation;
×
51

52
  public void OverrideWorldRotation(IReadOnlyBone bone, Quaternion rotation)
53
    => this.worldRotationOverrides_[bone] = rotation;
×
54

55
  public void OverrideWorldScale(IReadOnlyBone bone, Vector3 scale)
56
    => this.worldScaleOverrides_[bone] = scale;
×
57

58
  public void ClearWorldTranslationOverride(IReadOnlyBone bone)
59
    => this.worldTranslationOverrides_.Remove(bone);
×
60

61
  public void ClearWorldRotationOverride(IReadOnlyBone bone)
62
    => this.worldRotationOverrides_.Remove(bone);
×
63

64
  public void ClearWorldScaleOverride(IReadOnlyBone bone)
65
    => this.worldScaleOverrides_.Remove(bone);
×
66

67
  public void TargetBone(IReadOnlyBone bone) {
×
68
    this.bone_ = bone;
×
69
    foreach (var impl in this.impls_) {
×
70
      impl.TargetBone(bone);
×
71
    }
×
72
  }
×
73

74
  public bool TryGetWorldTranslation(out Vector3 translation) {
×
75
    if (this.worldTranslationOverrides_.TryGetValue(
×
76
            this.bone_,
×
77
            out translation)) {
×
78
      return true;
×
79
    }
80

81
    foreach (var impl in this.impls_) {
×
82
      if (impl.TryGetWorldTranslation(out translation)) {
×
83
        return true;
×
84
      }
85
    }
×
86

87
    translation = default;
×
88
    return false;
×
89
  }
×
90

91
  public bool TryGetWorldRotation(out Quaternion rotation) {
×
92
    if (this.worldRotationOverrides_.TryGetValue(
×
93
            this.bone_,
×
94
            out rotation)) {
×
95
      return true;
×
96
    }
97

98
    if (this.bone_?.TryGetFaceCameraQuaternion(out rotation) ?? false) {
×
99
      return true;
×
100
    }
101

102
    foreach (var impl in this.impls_) {
×
103
      if (impl.TryGetWorldRotation(out rotation)) {
×
104
        return true;
×
105
      }
106
    }
×
107

108
    rotation = default;
×
109
    return false;
×
110
  }
×
111

112
  public bool TryGetWorldScale(out Vector3 scale) {
×
113
    if (this.worldScaleOverrides_.TryGetValue(
×
114
            this.bone_,
×
115
            out scale)) {
×
116
      return true;
×
117
    }
118

119
    foreach (var impl in this.impls_) {
×
120
      if (impl.TryGetWorldScale(out scale)) {
×
121
        return true;
×
122
      }
123
    }
×
124

125
    scale = default;
×
126
    return false;
×
127
  }
×
128

129
  public bool TryGetLocalTranslation(out Vector3 translation) {
×
130
    foreach (var impl in this.impls_) {
×
131
      if (impl.TryGetLocalTranslation(out translation)) {
×
132
        return true;
×
133
      }
134
    }
×
135

136
    translation = default;
×
137
    return false;
×
138
  }
×
139

140
  public bool TryGetLocalRotation(out Quaternion rotation) {
×
141
    foreach (var impl in this.impls_) {
×
142
      if (impl.TryGetLocalRotation(out rotation)) {
×
143
        return true;
×
144
      }
145
    }
×
146

147
    rotation = default;
×
148
    return false;
×
149
  }
×
150

151
  public bool TryGetLocalScale(out Vector3 scale) {
×
152
    foreach (var impl in this.impls_) {
×
153
      if (impl.TryGetLocalScale(out scale)) {
×
154
        return true;
×
155
      }
156
    }
×
157

158
    scale = default;
×
159
    return false;
×
160
  }
×
161
}
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