-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLighting.java
More file actions
27 lines (22 loc) · 794 Bytes
/
Lighting.java
File metadata and controls
27 lines (22 loc) · 794 Bytes
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
import java.util.ArrayList;
public class Lighting
{
//direction that the light faces.
public Vector3 lightDirection;
//how bright should the illuminated side of meshes be?
public double lightIntensity;
//how dark should the unilluminated side of meshes be?
public double shadowIntensity;
public Lighting(Vector3 lightDirectionIn, double lightIntensityIn, double shadowIntensityIn)
{
lightDirection = lightDirectionIn;
lightIntensity = lightIntensityIn;
shadowIntensity = shadowIntensityIn;
}
//goes through the specified meshes and updates all their lighting's
public void update(ArrayList<Mesh> meshes)
{
for (int i = 0; i < meshes.size(); i++)
meshes.get(i).calculateLighting(this);
}
}