Exemple #1
0
        public void Touch(Ray ray)
        {
            Vector3 point = ray.GetIntersectionPoint(plane);

            int x = (int)( point.X / extents.X );
            int y = (int)( point.Z / extents.Z );

            if(x >= 0 && x < DimX && y >= 0 && y < DimZ)
                buffer1[ y + x * DimZ ] = 10.0f;
        }
        public void Touch(Ray ray)
        {
            foreach(Component comp in components)
            {
                BoundingBox curBox = new BoundingBox(comp.Box);

                curBox.Center = Vector3.Transform(curBox.Center, this.Transform);
                curBox.Scale(this.scale);

                Vector3? intersection = ray.GetIntersectionPoint(curBox);

                if(intersection != null)
                {
                    React();
                    return;
                }
            }
        }