Package raymarcher

Interface Mesh

All Known Implementing Classes:
Box, MeshGroup, MeshGroup.IntersectionGroup, MeshGroup.SubtractGroup, MeshGroup.UnionGroup, RoundedBox, Sphere, Torus, TriangularPrism

public interface Mesh
The interface class of the template for each mesh within the scene
  • Method Summary

    Modifier and Type Method Description
    java.awt.Color getMeshColor()
    Gives the mesh's color
    double sdf​(Vector3 position)
    The signed distance function for the mesh, which tells the mesh's distance to a point in 3D space
  • Method Details

    • sdf

      double sdf​(Vector3 position)
      The signed distance function for the mesh, which tells the mesh's distance to a point in 3D space
      Parameters:
      position - The vector representation of the position of the point to measure the distance to
      Returns:
      The signed distance of the mesh to the point. Values > 0 indicate the point is outside the mesh, values = 0 are points on the surface, and values < 0 are points inside the mesh.
    • getMeshColor

      java.awt.Color getMeshColor()
      Gives the mesh's color
      Returns:
      The color of the mesh