-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPhoton.cs
114 lines (93 loc) · 2.46 KB
/
Photon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* Author : Karan Bhagat
* Global Illumination Final Project
* */
using System;
/**
* Class defining photon map
* */
public class Photon
{
public int numberOfPhotons = 3000;
public int numberOfBounces = 3;
public int[][] photonsPerObject = new int[2][];
public float[][][][][] photonData = new float[5][][][][];
public Photon ()
{
int[] object1 = new int[5];
object1 [0] = object1 [1] = object1 [2] = object1 [3] = object1 [4] = 0;
int[] object2 = new int[5];
object2 [0] = object2 [1] = object2 [2] = object2 [3] = object2 [4] = 0;
photonsPerObject [0] = object1;
photonsPerObject [1] = object2;
initializePhotonData ();
}
public void initializePhotonData() {
int size = photonData.Length;
int sizeA = 5;
int sizeB = 5000;
int sizeC = 3;
int sizeD = 3;
for (int a = 0; a < size; ++a)
{
photonData[a] = new float[sizeA][][][];
for (int b = 0; b < sizeA; ++b)
{
photonData[a][b] = new float[sizeB][][];
for (int c = 0; c < sizeB; ++c)
{
photonData[a][b][c] = new float[sizeC][];
for (int d = 0; d < sizeC; ++d)
{
photonData[a][b][c][d] = new float[sizeD];
}
}
}
}
}
public float getPhotoData(int a, int b, int c, int d, int e) {
return photonData [a] [b] [c] [d] [e];
}
public float[] getPhotonData(int a, int b, int c, int d) {
return photonData [a] [b] [c] [d];
}
public float[][] getPhotonData(int a, int b, int c) {
return photonData [a] [b] [c];
}
public float[][][] getPhotonData(int a, int b) {
return photonData [a] [b];
}
public float[][][][] getPhotonData(int a) {
return photonData [a];
}
public float[][][][][] getPhotonData() {
return photonData;
}
public void setPhotoData(int a, int b, int c, int d, int e, float data) {
photonData [a] [b] [c] [d] [e] = data;
}
public void setPhotonData(int a, int b, int c, int d, float[] data) {
photonData [a] [b] [c] [d] = data;
}
public void setPhotonData(int a, int b, int c, float[][] data) {
photonData [a] [b] [c] = data;
}
public void setPhotonData(int a, int b, float[][][] data) {
photonData [a] [b] = data;
}
public void setPhotonData(int a, float[][][][] data) {
photonData [a] = data;
}
public int getNumberOfPhoton() {
return numberOfPhotons;
}
public void setNumberOfPhoton(int numPhotons) {
numberOfPhotons = numPhotons;
}
public int getNumberOfBounces() {
return numberOfBounces;
}
public void setNumberOfBounces(int numBounces) {
numberOfBounces = numBounces;
}
}