Package gaiasky.util.gdx
Class IcoSphereCreator
java.lang.Object
gaiasky.util.gdx.ModelCreator
gaiasky.util.gdx.IcoSphereCreator
-
Nested Class Summary
Nested classes/interfaces inherited from class gaiasky.util.gdx.ModelCreator
ModelCreator.Face, ModelCreator.IFace
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addUV
(com.badlogic.gdx.math.Vector3 p) Implements the spherical UV mappingcreate
(float radius, int recursionLevel) create
(float radius, int divisions, boolean flipNormals) Creates an ico-sphere.create
(float radius, int divisions, boolean flipNormals, boolean hardEdges) Creates an ico-sphere.static void
protected int
vertex
(com.badlogic.gdx.math.Vector3 p, float radius) Adds a vertex and its UV mapping.Methods inherited from class gaiasky.util.gdx.ModelCreator
addFace, addVertex, dumpObj, flip
-
Constructor Details
-
IcoSphereCreator
public IcoSphereCreator()
-
-
Method Details
-
main
-
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.
-
addUV
protected void addUV(com.badlogic.gdx.math.Vector3 p) Implements the spherical UV mapping- Parameters:
p
- The normalized point
-
create
-
create
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
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
-