EOS 2  1.1.0
Einfache Objektbasierte Sprache
Material.java
gehe zur Dokumentation dieser Datei
1 package de.lathanda.eos.robot.geom3d;
2 
3 import java.awt.Color;
4 import java.awt.image.BufferedImage;
11 public class Material implements Comparable<Material> {
12  private static int nextID = 0;
13  public BufferedImage image;
14  private final int id;
15  public float[] ka;
16  public float[] kd;
17  public float[] ks;
18 
19  public Material() {
20  id = nextID++;
21  }
22  public Material(Color c) {
23  id = nextID++;
24  ka = c.getComponents(null);
25  kd = c.getComponents(null);
26  ks = c.getComponents(null);
27  }
28  public Material(BufferedImage image) {
29  this(Color.BLACK);
30  this.image = image;
31  }
32  public void setImage(BufferedImage image) {
33  this.image = image;
34  }
35  public void setKD(float[] kd) {
36  this.kd = Color.WHITE.getComponents(null);
37  for(int i = 0; i < kd.length; i++) {
38  this.kd[i] = kd[i];
39  }
40  }
41  public void setKA(float[] ka) {
42  this.ka = Color.WHITE.getComponents(null);
43  for(int i = 0; i < ka.length; i++) {
44  this.ka[i] = ka[i];
45  }
46  }
47  public void setKS(float[] ks) {
48  this.ks = Color.WHITE.getComponents(null);
49  for(int i = 0; i < ks.length; i++) {
50  this.ks[i] = ks[i];
51  }
52  }
53  @Override
54  public int compareTo(Material m) {
55  return m.id - id;
56  }
57 }
void setImage(BufferedImage image)
Definition: Material.java:32
Impressum