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

Class Vec4

src/main/java/field/linalg/Vec4.java:48–1648  ·  view source on GitHub ↗

Contains the definition of a Vector comprising 4 doubles and associated transformations. @author Richard Greenlees @author Kai Burjack with modifications and additions for Field

Source from the content-addressed store, hash-verified

46 * @author Kai Burjack
47 * with modifications and additions for Field
48 */
49@SafeToToString
50public class Vec4 implements Externalizable, Supplier<Vec4>, Mutable, Serializable_safe, OverloadedMath {
51
52
53 private static final long serialVersionUID = 1L;
54
55 /**
56 * The x component of the vector.
57 */
58 @SafeToToString
59 public double x;
60 /**
61 * The y component of the vector.
62 */
63 @SafeToToString
64 public double y;
65 /**
66 * The z component of the vector.
67 */
68 @SafeToToString
69 public double z;
70 /**
71 * The w component of the vector.
72 */
73 @SafeToToString
74 public double w = 1.0;
75
76 /**
77 * Create a new {@link Vec4} of <code>(0, 0, 0, 1)</code>.
78 */
79 public Vec4() {
80 }
81
82 /**
83 * Create a new {@link Vec4} with the same values as <code>v</code>.
84 *
85 * @param v the {@link Vec4} to copy the values from
86 */
87 public Vec4(Vec4 v) {
88 this.x = v.x;
89 this.y = v.y;
90 this.z = v.z;
91 this.w = v.w;
92 }
93
94 protected Vec4(Object... args) {
95 if (args.length == 0) {
96 this.w = 1;
97 } else if (args.length == 1) {
98 this.x = this.y = this.z = ((Number) args[0]).floatValue();
99 this.w = 1;
100 } else if (args.length == 2) {
101 this.x = this.y = this.z = ((Number) args[0]).floatValue();
102 this.w = ((Number) args[1]).floatValue();
103 } else if (args.length == 3) {
104 this.x = ((Number) args[0]).floatValue();
105 this.y = ((Number) args[1]).floatValue();

Callers 15

executeTextFragmentMethod · 0.50
beginMethod · 0.50
endMethod · 0.50
visualizeMethod · 0.50
UIGroupClass · 0.50
helpMethod · 0.50
drawTimesForMethod · 0.50
dispatchTextMethod · 0.50
reportErrorMethod · 0.50
__MINUS__Method · 0.50
__PLUS__Method · 0.50
__MULTIPLY__Method · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected