Package gaia.cu9.ari.gaiaorbit.util.gdx
Class IcoSphereCreator
- java.lang.Object
-
- gaia.cu9.ari.gaiaorbit.util.gdx.ModelCreator
-
- gaia.cu9.ari.gaiaorbit.util.gdx.IcoSphereCreator
-
public class IcoSphereCreator extends ModelCreator
Helper generic class to create icospheres.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gaia.cu9.ari.gaiaorbit.util.gdx.ModelCreator
ModelCreator.Face, ModelCreator.IFace
-
-
Field Summary
-
Fields inherited from class gaia.cu9.ari.gaiaorbit.util.gdx.ModelCreator
faces, flipNormals, hardEdges, index, name, normals, uv, vertices
-
-
Constructor Summary
Constructors Constructor Description IcoSphereCreator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addUV(com.badlogic.gdx.math.Vector3 p)
Implements the spherical UV mappingIcoSphereCreator
create(float radius, int recursionLevel)
IcoSphereCreator
create(float radius, int divisions, boolean flipNormals)
Creates an ico-sphere.IcoSphereCreator
create(float radius, int divisions, boolean flipNormals, boolean hardEdges)
Creates an ico-sphere.static void
main(java.lang.String[] args)
protected int
vertex(com.badlogic.gdx.math.Vector3 p, float radius)
Adds a vertex and its UV mapping.-
Methods inherited from class gaia.cu9.ari.gaiaorbit.util.gdx.ModelCreator
addFace, dumpObj, flip
-
-
-
-
Method Detail
-
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:
-
addUV
protected void addUV(com.badlogic.gdx.math.Vector3 p)
Implements the spherical UV mapping- Parameters:
p
- The normalized point
-
create
public IcoSphereCreator create(float radius, int recursionLevel)
-
create
public IcoSphereCreator create(float radius, int divisions, boolean flipNormals)
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.- Returns:
- This creator
-
create
public IcoSphereCreator create(float radius, int divisions, boolean flipNormals, boolean hardEdges)
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
-
main
public static void main(java.lang.String[] args)
-
-