Package org.kalimullin.fsraytracer.ray

Examples of org.kalimullin.fsraytracer.ray.Ray


                GeometryTestData.POINT_TWO, GeometryTestData.POINT_THREE)));
    }

    @Test
    public void testHit() {
        Ray hitRay = new Ray(new Point(5,5,3), new Point(-1,-1,-1));
        assertEquals(new HitPoint(new Point(2, 2, 0), Math.sqrt(27)),
                GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(hitRay));
    }
View Full Code Here


                GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(hitRay));
    }

    @Test
    public void testHitFromAnotherSide() {
        Ray hitRay = new Ray(new Point(5,5,-3), new Point(-1,-1,1));
        assertEquals(new HitPoint(new Point(2, 2, 0), Math.sqrt(27)),
                GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(hitRay));
    }
View Full Code Here

                GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(hitRay));
    }

    @Test
    public void testMissNeverIntersectedPlaneRay() {
        Ray missRay = new Ray(new Point(5,5,3), new Point(1,1,1));
        assertEquals(HitPoint.MISSED, GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(missRay));
    }
View Full Code Here

        assertEquals(HitPoint.MISSED, GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(missRay));
    }

    @Test
    public void testMissedButIntersectedPlaneRay() {
        Ray missRayButIntersectsPlane = new Ray(new Point(25,25,2), new Point(-1,-1,-1));
        assertEquals(HitPoint.MISSED, GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(missRayButIntersectsPlane));
    }
View Full Code Here

        assertEquals(HitPoint.MISSED, GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(missRayButIntersectsPlane));
    }

    @Test
    public void testParallelPlaneAndRay() {
        Ray parallelRay = new Ray(new Point(10,25,1), new Point(4,3,0));
        assertEquals(HitPoint.MISSED, GeometryTestData.XY_PYRAMID_POLYGON_FACE.getHitPoint(parallelRay));
    }
View Full Code Here

TOP

Related Classes of org.kalimullin.fsraytracer.ray.Ray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.