Class IcoSphereCreator

java.lang.Object
gaiasky.render.gdx.creators.ModelCreator
gaiasky.render.gdx.creators.IcoSphereCreator

public class IcoSphereCreator extends ModelCreator
  • Constructor Details

    • IcoSphereCreator

      public IcoSphereCreator()
  • Method Details

    • main

      public static void main(String[] args)
    • vertex

      protected int vertex(com.badlogic.gdx.math.Vector3 p, float radius)
      Adds a vertex and its UV mapping.
      Parameters:
      p - The point.
      radius - The radius.
      Returns:
      Vertex index.
    • vertex

      protected int vertex(com.badlogic.gdx.math.Vector3 p, float radius, float jitter)
      Adds a vertex and its UV mapping.
      Parameters:
      p - The point.
      radius - The radius.
      jitter - Jitter to apply to the position.
      Returns:
      Vertex index.
    • create

      public IcoSphereCreator create(float radius, int recursionLevel)
    • create

      public IcoSphereCreator create(float radius, int recursionLevel, float jitter)
    • create

      public IcoSphereCreator create(float radius, int divisions, boolean flipNormals, float jitter)
      Creates an ico-sphere.
      Parameters:
      radius - The radius of the sphere.
      divisions - The number of divisions, it must be bigger than 0.
      flipNormals - Whether to flip normals or not.
      jitter - Jitter to add to the vertex positions. In [0,1].
      Returns:
      This creator
    • create

      public IcoSphereCreator create(float radius, int divisions, boolean flipNormals, boolean hardEdges, float jitter)
      Creates an ico-sphere.
      Parameters:
      radius - The radius of the sphere.
      divisions - The number of divisions, it must be bigger than 0.
      flipNormals - Whether to flip normals or not.
      hardEdges - Whether to use smoothLighting (all vertices in a face have a different normal) or not.
      Returns:
      This creator