Class ShapeFactory


  • @RequiresApi(api=24)
    public final class ShapeFactory
    extends java.lang.Object
    Utility class used to dynamically construct ModelRenderables for various shapes.
    • Constructor Detail

      • ShapeFactory

        public ShapeFactory()
    • Method Detail

      • makeCube

        public static ModelRenderable makeCube​(Vector3 size,
                                               Vector3 center,
                                               Material material)
        Creates a ModelRenderable in the shape of a cube with the give specifications.
        Parameters:
        size - the size of the constructed cube
        center - the center of the constructed cube
        material - the material to use for rendering the cube
        Returns:
        renderable representing a cube with the given parameters
      • makeSphere

        public static ModelRenderable makeSphere​(float radius,
                                                 Vector3 center,
                                                 Material material)
        Creates a ModelRenderable in the shape of a sphere with the give specifications.
        Parameters:
        radius - the radius of the constructed sphere
        center - the center of the constructed sphere
        material - the material to use for rendering the sphere
        Returns:
        renderable representing a sphere with the given parameters
      • makeCylinder

        public static ModelRenderable makeCylinder​(float radius,
                                                   float height,
                                                   Vector3 center,
                                                   Material material)
        Creates a ModelRenderable in the shape of a cylinder with the give specifications.
        Parameters:
        radius - the radius of the constructed cylinder
        height - the height of the constructed cylinder
        center - the center of the constructed cylinder
        material - the material to use for rendering the cylinder
        Returns:
        renderable representing a cylinder with the given parameters