Class MollerTrumbore

    • Constructor Detail

      • MollerTrumbore

        public MollerTrumbore​(Mesh mesh)
    • Method Detail

      • rayIntersectsTriangle

        public boolean rayIntersectsTriangle​(long id,
                                             double ox,
                                             double oy,
                                             double oz,
                                             double rx,
                                             double ry,
                                             double rz,
                                             double[] intersection)
        Returns true if the specified ray intersects with the specified triangle in the mesh, and if yes, store the position of intersection in an array. The intersection is calculated for ray that originates from the point. Only one direction is considered.
        Parameters:
        id - the triangle to test.
        ox - the X position of the ray origin.
        oy - the Y position of the ray origin.
        oz - the Z position of the ray origin.
        rx - the X coordinate of the ray vector.
        ry - the Y coordinate of the ray vector.
        rz - the Z coordinate of the ray vector.
        intersection - a double[] array of at least 3 elements to store the intersection position. Is not modified if the ray does not intersect the triangle.
        Returns:
        true if the ray intersects the triangle.