MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / TCB3

Class TCB3

src/main/java/trace/util/TCB3.java:13–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13public class TCB3 {
14
15 boolean dirty = true;
16
17 public class Node {
18 protected double x;
19 protected Vec3 v;
20 private double subX = System.identityHashCode(this);
21 private int n;
22
23 public Vec3 tO, tI;
24
25 public Node(double x, Vec3 v) {
26 this.x = x;
27 this.v = new Vec3(v);
28 dirty = true;
29 TCB3.this.n.add(this);
30 }
31
32 public void setSubX(double sub_x) {
33 this.subX = subX;
34 }
35
36 public Function<Triple<Node, Node, Node>, Void> refresh;
37
38 @Override
39 public String toString() {
40 return v + "@" + x + "(" + tI + "->" + tO + "):" + n;
41 }
42
43 public void setV(Vec3 f) {
44 if (!v.equals(f)) {
45 v.set(f);
46 dirty = true;
47 }
48 }
49
50 public Vec3 getV() {
51 return v;
52 }
53
54 public double getX() {
55 return x;
56 }
57 }
58
59 public void respaceByDistance() {
60 double d = 0;
61 for (int i = 0; i < n.size(); i++) {
62 n.get(i).x = d;
63 if (i < n.size() - 1)
64 d += n.get(i).v.distance(n.get(i + 1).v);
65 }
66 dirty = true;
67 }
68
69 public Node newNode(double x, Vec3 y) {
70 Node n = new Node(x, y);

Callers 4

MocapClass · 0.85
CSV2Class · 0.85
TrackClass · 0.85
TrackClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected