Example #1
0
        public void RayCast(H1Ray[] InRays, ref H1RenderTarget OutRenderTarget)
        {
            Int32 Index = 0;

            foreach (H1Ray Ray in InRays)
            {
                float T0 = float.MaxValue;
                foreach (H1RayTracerComponent Component in RayTracerComponents)
                {
                    float CurrT0, CurrT1;
                    if (Component.IsCollide(Ray, out CurrT0, out CurrT1))
                    {
                        if (T0 > CurrT0)
                        {
                            OutRenderTarget[Index] = new H1Color(1, 0, 0, 1);
                            T0 = CurrT0;
                        }
                    }
                }

                Index++;
            }
        }
 protected H1RayTracer(Int32 InWidth, Int32 InHeight)
 {
     // create back buffer
     BackBuffer = new H1RenderTarget(InWidth, InHeight);
 }