1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2016 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Distorted. //
|
5
|
// //
|
6
|
// Distorted is free software: you can redistribute it and/or modify //
|
7
|
// it under the terms of the GNU General Public License as published by //
|
8
|
// the Free Software Foundation, either version 2 of the License, or //
|
9
|
// (at your option) any later version. //
|
10
|
// //
|
11
|
// Distorted is distributed in the hope that it will be useful, //
|
12
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14
|
// GNU General Public License for more details. //
|
15
|
// //
|
16
|
// You should have received a copy of the GNU General Public License //
|
17
|
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. //
|
18
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19
|
|
20
|
package org.distorted.library.type;
|
21
|
|
22
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
23
|
/**
|
24
|
* A 5-dimensional data structure containing five floats. The floats have no particular meaning;
|
25
|
* when this data structure is used in Dynamics, we can think of it as a 5-dimensional Point
|
26
|
* a few of which the Dynamic interpolates between.
|
27
|
*/
|
28
|
|
29
|
public class Static5D extends Static4D implements Data5D
|
30
|
{
|
31
|
float v;
|
32
|
|
33
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
34
|
/**
|
35
|
* Constructor that initialises the value of the five floats to (vx,vy,vz,vw,vv).
|
36
|
*
|
37
|
* @param vx value of the first float.
|
38
|
* @param vy value of the second float.
|
39
|
* @param vz value of the third float.
|
40
|
* @param vw value of the fourth float.
|
41
|
* @param vv value of the fifth float.
|
42
|
*/
|
43
|
public Static5D(int vx, int vy, int vz, int vw, int vv)
|
44
|
{
|
45
|
super(vx,vy,vz,vw);
|
46
|
v = vv;
|
47
|
}
|
48
|
|
49
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
50
|
/**
|
51
|
* Constructor that initialises the value of the five floats to (vx,vy,vz,vw,vv).
|
52
|
*
|
53
|
* @param vx value of the first float.
|
54
|
* @param vy value of the second float.
|
55
|
* @param vz value of the third float.
|
56
|
* @param vw value of the fourth float.
|
57
|
* @param vv value of the fifth float.
|
58
|
*/
|
59
|
public Static5D(float vx, float vy, float vz, float vw, float vv)
|
60
|
{
|
61
|
super(vx,vy,vz,vw);
|
62
|
v = vv;
|
63
|
}
|
64
|
|
65
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
66
|
/**
|
67
|
* Reset the value of the floats to (vx,vy,vz,vw,vv).
|
68
|
*
|
69
|
* @param vx new value of the first float
|
70
|
* @param vy new value of the second float
|
71
|
* @param vz new value of the third float
|
72
|
* @param vw new value of the fourth float
|
73
|
* @param vv new value of the fifth float
|
74
|
*/
|
75
|
public void set(int vx, int vy, int vz, int vw, int vv)
|
76
|
{
|
77
|
x = vx;
|
78
|
y = vy;
|
79
|
z = vz;
|
80
|
w = vw;
|
81
|
v = vv;
|
82
|
}
|
83
|
|
84
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
85
|
/**
|
86
|
* Reset the value of the floats to (vx,vy,vz,vw,vv).
|
87
|
*
|
88
|
* @param vx new value of the first float
|
89
|
* @param vy new value of the second float
|
90
|
* @param vz new value of the third float
|
91
|
* @param vw new value of the fourth float
|
92
|
* @param vv new value of the fifth float
|
93
|
*/
|
94
|
public void set(float vx, float vy, float vz, float vw, float vv)
|
95
|
{
|
96
|
x = vx;
|
97
|
y = vy;
|
98
|
z = vz;
|
99
|
w = vw;
|
100
|
v = vv;
|
101
|
}
|
102
|
|
103
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
104
|
/**
|
105
|
* Resets the value of the fifth float.
|
106
|
*
|
107
|
* @param ov new value of the fifth float.
|
108
|
*/
|
109
|
public void set5(int ov)
|
110
|
{
|
111
|
v = ov;
|
112
|
}
|
113
|
|
114
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
115
|
/**
|
116
|
* Resets the value of the fifth float.
|
117
|
*
|
118
|
* @param ov new value of the fifth float.
|
119
|
*/
|
120
|
public void set5(float ov)
|
121
|
{
|
122
|
v = ov;
|
123
|
}
|
124
|
|
125
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
126
|
/**
|
127
|
* Return the value of the fifth float contained.
|
128
|
*
|
129
|
* @return The fifth float.
|
130
|
*/
|
131
|
public float getV()
|
132
|
{
|
133
|
return v;
|
134
|
}
|
135
|
|
136
|
}
|