Package raymarcher

Class Scene

java.lang.Object
raymarcher.Scene

public class Scene
extends java.lang.Object
The scene which the camera will render
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.util.ArrayList<Mesh> meshes
    A List of the meshes to render in this scene
    private int worldColor
    The background color of the world
  • Constructor Summary

    Constructors
    Constructor Description
    Scene()
    Creates a default, empty scene with a world color of sky blue
  • Method Summary

    Modifier and Type Method Description
    void add​(Mesh mesh)
    Adds a mesh to the scene to render
    java.util.ArrayList<Mesh> getMeshes()  
    int getWorldColor()  
    void setMeshes​(java.util.ArrayList<Mesh> meshes)  
    void setWorldColor​(int worldColor)  
    void setWorldColor​(java.awt.Color color)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • meshes

      private java.util.ArrayList<Mesh> meshes
      A List of the meshes to render in this scene
    • worldColor

      private int worldColor
      The background color of the world
  • Constructor Details

    • Scene

      public Scene()
      Creates a default, empty scene with a world color of sky blue
  • Method Details

    • getMeshes

      public java.util.ArrayList<Mesh> getMeshes()
      Returns:
      the list of all meshes currently in the scene
    • setMeshes

      public void setMeshes​(java.util.ArrayList<Mesh> meshes)
      Parameters:
      meshes - the list of meshes to set as the objects for the scene to render
    • getWorldColor

      public int getWorldColor()
      Returns:
      the color of the world background as an RGB int in the default sRGB ColorModel. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).
    • setWorldColor

      public void setWorldColor​(int worldColor)
      Parameters:
      worldColor - the color to set the world background to as an int in the default sRGB ColorModel.
    • setWorldColor

      public void setWorldColor​(java.awt.Color color)
      Parameters:
      color - the color to set the world background to
    • add

      public void add​(Mesh mesh)
      Adds a mesh to the scene to render
      Parameters:
      mesh - The mesh to add to the scene