|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmonkeyengine.tralala.MeshData
public final class MeshData
Immutable class that transforms the mesh. It is immutable to minimize get/set/construct array operations, and doesnt copy data unless it has to modify it. Since it is immutable remember to use the returned value, because the class internal state / method arguments dont change.
Field Summary | |
---|---|
static int |
MAX_TEX_COORDS
|
Constructor Summary | |
---|---|
MeshData(float[] vertexArray,
float[] normalArray,
float[][] uvArrays,
short[] indexArray,
float[] boneWeightArray,
byte[] boneIndexArray,
int maxNumOfWeights)
Creates a mesh with the specified values. |
|
MeshData(float[] vertexArray,
float[] normalArray,
float[] uvArray,
short[] indexArray)
Creates a mesh without animation, and only 1 tex coord. |
|
MeshData(com.jme3.scene.Mesh mesh)
creates MeshData from mesh |
Method Summary | |
---|---|
MeshData |
compress()
removes all unindexed vertex/normals/uvs. |
com.jme3.scene.Mesh |
createMesh()
|
MeshData |
createSymmetricMesh(com.jme3.math.Vector3f planeOrigin,
com.jme3.math.Vector3f planeNormal,
float weldThreshold)
Applies symmetry modifier to mesh, and creates a new mesh from the 2 submeshes. |
MeshData |
flipIndexes()
Changes the order of indexes, e.g from 1,2,3 it becomes 3,2,1. |
MeshData |
flipU(int TexCoordNumber)
|
MeshData |
flipV(int TexCoordNumber)
|
java.util.LinkedHashSet<java.lang.Short> |
getAdjacentIndices(short index)
For each triangle, when this index is refered in a triangle, the triangle indexes are returned. |
byte[] |
getBoneIndexArrayCopy()
|
float[] |
getBoneWeightArrayCopy()
|
void |
getBounds(com.jme3.math.Vector3f min,
com.jme3.math.Vector3f max)
Usage : Vector3f min = new Vector3f(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); Vector3f max = new Vector3f(-Float.MAX_VALUE, -Float.MAX_VALUE, -Float.MAX_VALUE); getBounds(min,max); |
com.jme3.math.Vector3f |
getCenter()
|
short |
getIndex(int i)
|
short[] |
getIndexArrayCopy()
|
com.jme3.math.Vector3f |
getNormal(int i)
|
float[] |
getNormalArrayCopy()
|
int |
getNumberOfIndexElements()
|
int |
getNumberOfNormalElements()
|
int |
getNumberOfUvElements(int TexCoordNumber)
|
int |
getNumberOfVertexElements()
|
com.jme3.math.Vector2f |
getUv(int i)
|
com.jme3.math.Vector2f |
getUv(int i,
int TexCoordNumber)
|
float[] |
getUvArrayCopy(int TexCoordNumber)
|
com.jme3.math.Vector3f |
getVertex(int i)
|
float[] |
getVertexArrayCopy()
|
MeshData |
merge(MeshData mesh2)
Merges 2 meshes into 1. |
MeshData |
mirror(com.jme3.math.Vector3f planeOrigin,
com.jme3.math.Vector3f planeNormal)
|
MeshData |
moveUV(com.jme3.math.Vector2f uvMoveOffset,
int TexCoordNumber)
|
MeshData |
removeDuplicateData()
Removes duplicate and unindexed vertex, uv, normals if it can. |
MeshData |
rotateUV(float uvRotateAngle,
int TexCoordNumber)
|
com.jme3.scene.Mesh |
save(com.jme3.scene.Mesh mesh)
sets mesh to have the same data as this. |
MeshData |
scale(com.jme3.math.Vector3f size)
|
MeshData |
scale(com.jme3.math.Vector3f size,
com.jme3.math.Vector3f pivot)
|
MeshData |
scaleUV(com.jme3.math.Vector2f uvScaleAmount,
int TexCoordNumber)
|
MeshData |
setBoneIndexArray(byte[] boneIndexArray)
|
MeshData |
setBoneWeightArray(float[] boneWeightArray)
|
MeshData |
setIndexArray(short[] indexArray)
|
MeshData |
setNormalArray(float[] normalArray)
|
MeshData |
setUvArray(float[] uvArray,
int TexCoordNumber)
|
MeshData |
setVertexArray(float[] vertexArray)
|
MeshData |
switchUV(int TexCoordNumber)
switches u with v. |
MeshData |
translate(com.jme3.math.Vector3f translate)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_TEX_COORDS
Constructor Detail |
---|
public MeshData(float[] vertexArray, float[] normalArray, float[] uvArray, short[] indexArray)
public MeshData(float[] vertexArray, float[] normalArray, float[][] uvArrays, short[] indexArray, float[] boneWeightArray, byte[] boneIndexArray, int maxNumOfWeights)
public MeshData(com.jme3.scene.Mesh mesh)
Method Detail |
---|
public MeshData merge(MeshData mesh2)
shareSkeleton
- if the resulting mesh will have the skeleton of mesh1, (or mesh2 if mesh1 skeleton is null).public MeshData mirror(com.jme3.math.Vector3f planeOrigin, com.jme3.math.Vector3f planeNormal)
planeOrigin
- the planeOrigin e.g (0,0,0)planeNormal
- the planeNormal is a vector that points upward from the plane e.g Vector3f.UNIT_Zpublic MeshData createSymmetricMesh(com.jme3.math.Vector3f planeOrigin, com.jme3.math.Vector3f planeNormal, float weldThreshold)
planeOrigin
- the planeOrigin e.g (0,0,0)planeNormal
- the planeNormal is a vector that points upward from the plane e.g Vector3f.UNIT_ZweldThreshold
- how much to smooth the vertices near the plane suggested amount from 0.001 until 0.1.
Set it to negative number to disable welding.public MeshData scale(com.jme3.math.Vector3f size)
public MeshData scale(com.jme3.math.Vector3f size, com.jme3.math.Vector3f pivot)
public MeshData translate(com.jme3.math.Vector3f translate)
public void getBounds(com.jme3.math.Vector3f min, com.jme3.math.Vector3f max)
public com.jme3.math.Vector3f getCenter()
public MeshData flipIndexes()
public MeshData flipU(int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData flipV(int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData moveUV(com.jme3.math.Vector2f uvMoveOffset, int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData rotateUV(float uvRotateAngle, int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData scaleUV(com.jme3.math.Vector2f uvScaleAmount, int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData switchUV(int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public com.jme3.scene.Mesh save(com.jme3.scene.Mesh mesh)
public MeshData removeDuplicateData()
public MeshData compress()
public java.util.LinkedHashSet<java.lang.Short> getAdjacentIndices(short index)
public com.jme3.scene.Mesh createMesh()
public MeshData setIndexArray(short[] indexArray)
public MeshData setNormalArray(float[] normalArray)
public MeshData setUvArray(float[] uvArray, int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public MeshData setVertexArray(float[] vertexArray)
public MeshData setBoneWeightArray(float[] boneWeightArray)
public MeshData setBoneIndexArray(byte[] boneIndexArray)
public com.jme3.math.Vector3f getVertex(int i)
public com.jme3.math.Vector3f getNormal(int i)
public com.jme3.math.Vector2f getUv(int i)
public com.jme3.math.Vector2f getUv(int i, int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public short getIndex(int i)
public int getNumberOfVertexElements()
public int getNumberOfNormalElements()
public int getNumberOfUvElements(int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public int getNumberOfIndexElements()
public float[] getVertexArrayCopy()
public float[] getNormalArrayCopy()
public float[] getUvArrayCopy(int TexCoordNumber)
TexCoordNumber
- which array of tex coords to affect. Usual choice : 0public short[] getIndexArrayCopy()
public float[] getBoneWeightArrayCopy()
public byte[] getBoneIndexArrayCopy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |