public void setMaterial(Material m) { material=m; }
public void addMaterial(string key, Material m) { materialData.Add(key, m); }
// Material loader public void loadMaterial(Material material) { color = material.color; transparency = material.transparency; reflectivity = material.reflectivity; texture = material.texture; if (material.envmap != null) envmap = material.envmap.pixel; else envmap = null; if (texture != null) { tw = texture.width - 1; th = texture.height - 1; tbitW = texture.bitWidth; tbitH = texture.bitHeight; } mode = 0; if (!material.flat) mode |= P; if (envmap != null) mode |= E; if (texture != null) mode |= T; if (material.wireframe) mode |= W; materialLoaded = true; ready = lightmapLoaded && materialLoaded; }