ShadeRec(ShadeRec sr) { hit_an_object = (sr.hit_an_object); material_ptr = (sr.material_ptr); hit_point = (sr.hit_point); local_hit_point = (sr.local_hit_point); normal = (sr.normal); ray = (sr.ray); depth = (sr.depth); color = (sr.color); t = (sr.t); u = (sr.u); v = (sr.v); w = (sr.w); }
World w; // world reference ShadeRec(World wr) // constructor { hit_an_object = false; material_ptr = null; hit_point = new Point3D(); local_hit_point = new Point3D(); normal = new Normal3D(); ray = new Ray(); depth = 0; color = new ColorRGB(0,0,0); t = (0.0); u = (0.0f); v = (0.0f); w = (wr); }
public static ColorRGB operator /(ColorRGB c, float a) { ColorRGB c2 = new ColorRGB(c.r / a, c.g / a, c.b / a); return c2; }
public static ColorRGB operator *(ColorRGB c1, ColorRGB c2) { ColorRGB c3 = new ColorRGB(c1.r * c2.r, c1.g * c2.g, c1.b * c2.b); return c3; }
public static ColorRGB operator *(float a, ColorRGB c) { ColorRGB c2 = new ColorRGB(c.r * a, c.g * a, c.b * a); return c2; }
public static ColorRGB operator +(ColorRGB c1, ColorRGB c2) { ColorRGB c3 = new ColorRGB(c1.r + c2.r, c1.g + c2.g, c1.b + c2.b); return c3; }