Project

General

Profile

Download (4.09 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / type / Float3D.java @ a4835695

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 3-dimensional data structure containing three floats. The floats have no particular meaning; 
25
 * when this data structure is used in Interpolators, we can think of it as a 3-dimensional Point 
26
 * a few of which the Interpolator interpolates between.
27
 */
28

    
29
public class Float3D extends Float2D 
30
  {
31
  float z;
32
  
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34
/**
35
 * Constructor that initialises the value of the three floats to (vx,vy,vz).   
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
 */ 
41
  public Float3D(int vx, int vy, int vz)
42
    {
43
    super(vx,vy);
44
    z = vz;
45
    }
46

    
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48
/**
49
 * Constructor that initialises the value of the three floats to (vx,vy,vz).   
50
 *   
51
 * @param vx value of the first float.
52
 * @param vy value of the second float.
53
 * @param vz value of the third float.
54
 */ 
55
  public Float3D(float vx, float vy, float vz)
56
    {
57
    super(vx,vy);
58
    z = vz;
59
    }
60

    
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62
/**
63
 * Reset the value of the floats to (vx,vy,vz).
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
 */
69
  public void set(int vx, int vy, int vz)
70
    {
71
    x = vx;
72
    y = vy;
73
    z = vz;
74
    }
75

    
76
///////////////////////////////////////////////////////////////////////////////////////////////////
77
/**
78
 * Reset the value of the floats to (vx,vy,vz).
79
 * 
80
 * @param vx new value of the first float
81
 * @param vy new value of the second float
82
 * @param vz new value of the third float
83
 */
84
  public void set(float vx, float vy, float vz)
85
    {
86
    x = vx;
87
    y = vy;
88
    z = vz;
89
    }
90
  
91
///////////////////////////////////////////////////////////////////////////////////////////////////
92
/**
93
 * Return the value of the third float contained.
94
 * 
95
 * @return The third float.
96
 */
97
  public float getZ()
98
    {
99
    return z;  
100
    }
101
  
102
///////////////////////////////////////////////////////////////////////////////////////////////////
103
// end of class   
104
  }
(3-3/10)