Example #1
0
        public override Ray Reflect(Vector vec, Vector dir, float dist, Ray ray)
        {
            Vector nextOrgin = new Vector(ray.orgin + dist * ray.dir);
            //Vector nextOrgin = dist * ray.dir;
            Vector nextNormal = norm;

            return(SurfaceFunc.Reflect(m_mat, nextOrgin, ray.dir, nextNormal));
        }
Example #2
0
        public override Ray Reflect(Vector vec, Vector dir, float dist, Ray ray)
        {
            //dir = (dist * ray.dir + (ray.orgin - pos)).Normalize();

            //Vector nextOrgin = new Vector(vec + dist * ray.dir);
            Vector nextOrgin  = new Vector(ray.orgin + dist * ray.dir);
            Vector nextNormal = (nextOrgin - this.pos).Normalize();

            //Vector nextNormal = (dist * ray.dir + (ray.orgin - pos)).Normalize();
            nextOrgin = nextOrgin + nextNormal * 0.01f;
            return(SurfaceFunc.Reflect(m_mat, nextOrgin, ray.dir, nextNormal));
        }
Example #3
0
 public override Ray Reflect(Vector vec, Vector normal, float dist, Ray ray)
 {
     //Bounce off the surface then just f**k off
     return(new Ray(SurfaceFunc.Reflect(vec, normal)));;
 }