public class Geometry extends AbstractGeometry
Geometry geometry = new Geometry();
geometry.getVertices().add( new Vector3( -10, 10, 0 ) );
geometry.getVertices().add( new Vector3( -10, -10, 0 ) );
geometry.getVertices().add( new Vector3( 10, -10, 0 ) );
geometry.getFaces().add( new Face3( 0, 1, 2 ) );
geometry.computeBoundingSphere();
Modifier and Type | Class and Description |
---|---|
class |
Geometry.MorphColor |
class |
Geometry.MorphNormal |
class |
Geometry.MorphTarget |
class |
Geometry.VertextNormal |
__colorArray, __lineDistanceArray, __normalArray, __tangentArray, __uv2Array, __uvArray, __vertexArray, __webglColorBuffer, __webglCustomAttributesList, __webglFaceBuffer, __webglFaceCount, __webglInit, __webglLineBuffer, __webglLineCount, __webglLineDistanceBuffer, __webglMorphNormalsBuffers, __webglMorphTargetsBuffers, __webglNormalBuffer, __webglParticleCount, __webglSkinIndicesBuffer, __webglSkinWeightsBuffer, __webglTangentBuffer, __webglUV2Buffer, __webglUVBuffer, __webglVertexBuffer, __webglVertexCount
Constructor and Description |
---|
Geometry() |
Modifier and Type | Method and Description |
---|---|
void |
applyMatrix(Matrix4 matrix)
Bakes matrix transform directly into vertex coordinates.
|
Vector3 |
center() |
Geometry |
clone()
Creates a new clone of the Geometry.
|
void |
computeBoundingBox()
Computes bounding box of the geometry.
|
void |
computeBoundingSphere()
Computes bounding sphere of the geometry.
|
void |
computeFaceNormals()
Computes face normals.
|
void |
computeLineDistances()
Compute distances between vertices for Line geometries.
|
void |
computeMorphNormals()
Computes morph normals.
|
void |
computeTangents()
Computes vertex tangents.
|
void |
computeVertexNormals() |
void |
computeVertexNormals(boolean areaWeighted)
Computes vertex normals by averaging face normals.
|
Geometry |
fromBufferGeometry(BufferGeometry geometry) |
java.util.List<Bone> |
getBones() |
java.util.List<Color> |
getColors()
Gets List of vertex
Color s, matching number and order of vertices. |
java.util.List<Face3> |
getFaces()
Gets the List of triangles:
Face3 . |
java.util.List<java.util.List<java.util.List<Vector2>>> |
getFaceVertexUvs()
Gets the List of face
UV layers. |
java.util.List<java.lang.Double> |
getLineDistances() |
java.util.List<Geometry.MorphColor> |
getMorphColors()
Gets the List of
Geometry.MorphColor . |
java.util.List<Geometry.MorphNormal> |
getMorphNormals()
Get the List of
Geometry.MorphNormal . |
java.util.List<Geometry.MorphTarget> |
getMorphTargets()
Gets the List of
Geometry.MorphTarget . |
java.util.List<Vector4> |
getSkinIndices()
Gets the List of skinning indices, matching number and order of vertices.
|
java.util.List<Vector4> |
getSkinWeights()
Gets the List of skinning weights, matching number and order of vertices.
|
java.util.List<Vector3> |
getVertices()
Gets List of
Vector3 . |
boolean |
isDynamic()
Set to true if attribute buffers will need to change in runtime (using "dirty" flags).
|
boolean |
isHasTangents() |
void |
merge(Geometry geometry,
Matrix4 matrix) |
void |
merge(Geometry geometry,
Matrix4 matrix,
int materialIndexOffset)
Merge two geometries or geometry and geometry from object (using object's transform)
|
int |
mergeVertices()
Checks for duplicate vertices with hashmap.
|
void |
setBones(java.util.List<Bone> bones) |
void |
setColors(java.util.List<Color> colors) |
void |
setDynamic(boolean dynamic) |
void |
setFaces(java.util.List<Face3> faces) |
void |
setFaceVertexUvs(java.util.List<java.util.List<java.util.List<Vector2>>> faceVertexUvs) |
void |
setHasTangents(boolean hasTangents) |
void |
setVertices(java.util.List<Vector3> vertices) |
getBoundingBox, getBoundingSphere, getId, getName, isColorsNeedUpdate, isElementsNeedUpdate, isGroupsNeedUpdate, isLineDistancesNeedUpdate, isMorphTargetsNeedUpdate, isNormalsNeedUpdate, isTangentsNeedUpdate, isUvsNeedUpdate, isVerticesNeedUpdate, setBoundingBox, setBoundingSphere, setColorsNeedUpdate, setElementsNeedUpdate, setGroupsNeedUpdate, setId, setLineDistancesNeedUpdate, setMorphTargetsNeedUpdate, setName, setNormalsNeedUpdate, setTangentsNeedUpdate, setUvsNeedUpdate, setVerticesNeedUpdate, toString
dispose
public boolean isDynamic()
public void setDynamic(boolean dynamic)
public java.util.List<Vector4> getSkinWeights()
public java.util.List<Vector4> getSkinIndices()
public java.util.List<java.lang.Double> getLineDistances()
public void setColors(java.util.List<Color> colors)
public java.util.List<Color> getColors()
Color
s, matching number and order of vertices.
Used in PointCloud
, Line
.
Mesh
es use per-face-use-of-vertex colors embedded directly in faces.
To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true.
public void setFaces(java.util.List<Face3> faces)
public java.util.List<Face3> getFaces()
Face3
. The array of faces describe how each vertex in the model is connected with each other.
To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true.public void setVertices(java.util.List<Vector3> vertices)
public java.util.List<Vector3> getVertices()
Vector3
. The array of vertices holds every position of points in the model.
To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true.public java.util.List<Geometry.MorphTarget> getMorphTargets()
Geometry.MorphTarget
.
Morph vertices match number and order of primary vertices.public java.util.List<Geometry.MorphNormal> getMorphNormals()
Geometry.MorphNormal
.
Morph normals have similar structure as morph targetspublic java.util.List<Geometry.MorphColor> getMorphColors()
Geometry.MorphColor
. Morph colors have similar structure as Geometry.MorphTarget
.
Morph colors can match either number and order of faces (face colors) or number of vertices (vertex colors).public java.util.List<java.util.List<java.util.List<Vector2>>> getFaceVertexUvs()
UV
layers.
Each UV layer is an array of UVs matching the order and number of vertices in faces.
To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true.public void setFaceVertexUvs(java.util.List<java.util.List<java.util.List<Vector2>>> faceVertexUvs)
public java.util.List<Bone> getBones()
public void setBones(java.util.List<Bone> bones)
public boolean isHasTangents()
public void setHasTangents(boolean hasTangents)
hasTangents
- the hasTangents to setpublic void applyMatrix(Matrix4 matrix)
public Geometry fromBufferGeometry(BufferGeometry geometry)
public Vector3 center()
public void computeFaceNormals()
public void computeVertexNormals()
computeVertexNormals
in class AbstractGeometry
public void computeVertexNormals(boolean areaWeighted)
public void computeMorphNormals()
public void computeTangents()
Geometry must have vertex UV
s (layer 0 will be used).
computeTangents
in class AbstractGeometry
public void computeLineDistances()
public void computeBoundingBox()
computeBoundingBox
in class AbstractGeometry
public void computeBoundingSphere()
Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null.
computeBoundingSphere
in class AbstractGeometry
public void merge(Geometry geometry, Matrix4 matrix, int materialIndexOffset)
geometry
- matrix
- materialIndexOffset
- public int mergeVertices()
public Geometry clone()
clone
in class java.lang.Object