View difference between Paste ID: pAjPwy2c and iixrK7wA
SHOW: | | - or go back to the newest paste.
1
class Vector3
2
{
3
float[] mainArray;  //referencja na główną tablicę
4
5
static List<Vector3> CreateForArray(float[] mainArray)
6
{
7-
	List<Vector3> arrayList = new ArrayList<Vector
7+
	List<Vector3> arrayList = new ArrayList<Vector>();
8
	for(int i = 0; i < mainArray.length / 3; i++)
9
	{
10-
		Vector3 v3 = new Vector3(i*3, mainArray);
10+
		Vector3 v = new Vector3(i*3, mainArray);
11-
		arrayList.add(v3);
11+
		arrayList.add(v);
12
	} 
13
	
14
	return arrayList;
15
16
}
17
18
int offset;
19
20
Vector3(int offset, float[] mainArray)
21
{
22
   this.offset = offset;
23
   this.mainArray = mainArray;
24
}
25
26
float getX()
27
{ 
28
   return mainArray[offset];
29
}
30
float getY()
31
{ 
32
   return mainArray[offset + 1];
33
}
34
35
float getZ()
36
{ 
37
   return mainArray[offset + 2];
38
}
39
40
void set(float x, float y, float z)
41
{
42
 mainArray[offset] = x;
43
 mainArray[offset + 1] = y;
44
 mainArray[offset + 2] = z;
45
}
46
47
}