1 |
6a06a912
|
Leszek Koltunski
|
package org.distorted.library;
|
2 |
|
|
|
3 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
4 |
|
|
/**
|
5 |
|
|
* A 4-dimensional data structure containing four floats. The floats have no particular meaning;
|
6 |
|
|
* when this data structure is used in Interpolators, we can think of it as a 4-dimensional Point
|
7 |
|
|
* a few of which the Interpolator interpolates between.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
|
|
public class Float4D extends Float3D
|
11 |
|
|
{
|
12 |
|
|
float w;
|
13 |
|
|
|
14 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
15 |
|
|
/**
|
16 |
|
|
* Constructor that initialises the value of the four floats to (vx,vy,vz,vw).
|
17 |
|
|
*
|
18 |
|
|
* @param vx value of the first float.
|
19 |
|
|
* @param vy value of the second float.
|
20 |
|
|
* @param vz value of the third float.
|
21 |
|
|
* @param vw value of the fourth float.
|
22 |
|
|
*/
|
23 |
|
|
public Float4D(int vx, int vy, int vz, int vw)
|
24 |
|
|
{
|
25 |
|
|
super(vx,vy,vz);
|
26 |
|
|
w = vw;
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
30 |
|
|
/**
|
31 |
|
|
* Constructor that initialises the value of the four floats to (vx,vy,vz,vw).
|
32 |
|
|
*
|
33 |
|
|
* @param vx value of the first float.
|
34 |
|
|
* @param vy value of the second float.
|
35 |
|
|
* @param vz value of the third float.
|
36 |
|
|
* @param vw value of the fourth float.
|
37 |
|
|
*/
|
38 |
|
|
public Float4D(float vx, float vy, float vz, float vw)
|
39 |
|
|
{
|
40 |
|
|
super(vx,vy,vz);
|
41 |
|
|
w = vw;
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
45 |
|
|
/**
|
46 |
|
|
* Reset the value of the floats to (vx,vy,vz,vw).
|
47 |
|
|
*
|
48 |
|
|
* @param vx new value of the first float
|
49 |
|
|
* @param vy new value of the second float
|
50 |
|
|
* @param vz new value of the third float
|
51 |
d7bbef2f
|
Leszek Koltunski
|
* @param vw new value of the fourth float
|
52 |
6a06a912
|
Leszek Koltunski
|
*/
|
53 |
|
|
public void set(int vx, int vy, int vz, int vw)
|
54 |
|
|
{
|
55 |
|
|
x = vx;
|
56 |
|
|
y = vy;
|
57 |
|
|
z = vz;
|
58 |
|
|
w = vw;
|
59 |
|
|
}
|
60 |
|
|
|
61 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
62 |
|
|
/**
|
63 |
|
|
* Reset the value of the floats to (vx,vy,vz,vw).
|
64 |
|
|
*
|
65 |
|
|
* @param vx new value of the first float
|
66 |
|
|
* @param vy new value of the second float
|
67 |
|
|
* @param vz new value of the third float
|
68 |
d7bbef2f
|
Leszek Koltunski
|
* @param vw new value of the fourth float
|
69 |
6a06a912
|
Leszek Koltunski
|
*/
|
70 |
|
|
public void set(float vx, float vy, float vz, float vw)
|
71 |
|
|
{
|
72 |
|
|
x = vx;
|
73 |
|
|
y = vy;
|
74 |
|
|
z = vz;
|
75 |
|
|
w = vw;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
|
|
/**
|
80 |
|
|
* Return the value of the fourth float contained.
|
81 |
|
|
*
|
82 |
|
|
* @return The fourth float.
|
83 |
|
|
*/
|
84 |
|
|
public float getW()
|
85 |
|
|
{
|
86 |
|
|
return w;
|
87 |
|
|
}
|
88 |
|
|
|
89 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
90 |
|
|
// end of class
|
91 |
|
|
}
|