Class IcoSphereCreator
java.lang.Object
gaiasky.render.gdx.creators.ModelCreator
gaiasky.render.gdx.creators.IcoSphereCreator
-
Nested Class Summary
Nested classes/interfaces inherited from class ModelCreator
ModelCreator.Face, ModelCreator.IFaceModifier and TypeClassDescriptionclassContains the index info for a face.static interface -
Field Summary
Fields inherited from class ModelCreator
binormals, faces, flipNormals, hardEdges, index, name, normals, tangents, uv, vertices -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(float radius, int recursionLevel) create(float radius, int divisions, boolean flipNormals, boolean hardEdges, float jitter) Creates an ico-sphere.create(float radius, int divisions, boolean flipNormals, float jitter) Creates an ico-sphere.create(float radius, int recursionLevel, float jitter) static voidprotected intvertex(com.badlogic.gdx.math.Vector3 p, float radius) Adds a vertex and its UV mapping.protected intvertex(com.badlogic.gdx.math.Vector3 p, float radius, float jitter) Adds a vertex and its UV mapping.Methods inherited from class ModelCreator
addFace, addVertex, dumpObj, flipModifier and TypeMethodDescriptionprotected voidaddFace(List<ModelCreator.IFace> faces, boolean flipNormals, int... v) protected intaddVertex(com.badlogic.gdx.math.Vector3 p) Adds a vertex.voiddumpObj(OutputStream os) Exports the model to the .obj (Wavefront) format in the given output stream.protected int[]flip(int[] v, int startIndex)
-
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.
-
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
-
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.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
-