weightsArray[i + j] = data.value; sum += data.value; if (data.value > 0 && (j + 1) > mesh.getMaxNumWeights()) { mesh.setMaxNumWeights(j + 1);
int maxWeightsPerVert = mesh.getMaxNumWeights();
int maxWeightsPerVert = mesh.getMaxNumWeights(); if (maxWeightsPerVert <= 0) { throw new IllegalStateException("Max weights per vert is incorrectly set!");
int maxWeightsPerVert = mesh.getMaxNumWeights();
int maxWeightsPerVert = mesh.getMaxNumWeights(); if (maxWeightsPerVert <= 0) { throw new IllegalStateException("Max weights per vert is incorrectly set!");
setMaxNumWeights(other.getMaxNumWeights());
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());
weightsArray[i + j] = data.value; sum += data.value; if (data.value > 0 && (j + 1) > mesh.getMaxNumWeights()) { mesh.setMaxNumWeights(j + 1);
private void softwareSkinUpdate(Mesh mesh, Matrix4f[] offsetMatrices) { int maxWeightsPerVert = mesh.getMaxNumWeights(); int fourMinusMaxWeights = 4 - maxWeightsPerVert;
int maxWeightsPerVert = mesh.getMaxNumWeights(); if (maxWeightsPerVert <= 0) { throw new IllegalStateException("Max weights per vert is incorrectly set!");
int maxWeightsPerVert = mesh.getMaxNumWeights();
int maxWeightsPerVert = mesh.getMaxNumWeights();
int maxWeightsPerVert = mesh.getMaxNumWeights(); if (maxWeightsPerVert <= 0) { throw new IllegalStateException("Max weights per vert is incorrectly set!");
/** creates MeshData from mesh */ public MeshData(Mesh mesh) { this.maxNumOfWeights = mesh.getMaxNumWeights(); vertexArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.Position)); normalArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.Normal)); int numOfTexcoordinates = 0; for (int i = 0; i < MAX_TEX_COORDS; i++) { if (mesh.getBuffer(Utilities.getTexCoordType(i)) != null) numOfTexcoordinates++; } this.uvArrays = new float[numOfTexcoordinates][]; for (int i = 0; i < numOfTexcoordinates; i++) { uvArrays[i] = BufferUtils.getFloatArray(mesh.getFloatBuffer(Utilities.getTexCoordType(i))); } indexArray = Utilities.getShortArray(mesh.getShortBuffer(Type.Index)); boneWeightArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.BoneWeight)); VertexBuffer boneIndexBuffer = mesh.getBuffer(Type.BoneIndex); if (boneIndexBuffer != null) boneIndexArray = (Utilities.getByteArray((ByteBuffer) boneIndexBuffer.getData())); }
/** creates MeshData from mesh */ public MeshData(Mesh mesh) { this.maxNumOfWeights = mesh.getMaxNumWeights(); vertexArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.Position)); normalArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.Normal)); int numOfTexcoordinates = 0; for (int i = 0; i < MAX_TEX_COORDS; i++) { if (mesh.getBuffer(Utilities.getTexCoordType(i)) != null) numOfTexcoordinates++; } this.uvArrays = new float[numOfTexcoordinates][]; for (int i = 0; i < numOfTexcoordinates; i++) { uvArrays[i] = BufferUtils.getFloatArray(mesh.getFloatBuffer(Utilities.getTexCoordType(i))); } indexArray = Utilities.getShortArray(mesh.getShortBuffer(Type.Index)); boneWeightArray = BufferUtils.getFloatArray(mesh.getFloatBuffer(Type.BoneWeight)); VertexBuffer boneIndexBuffer = mesh.getBuffer(Type.BoneIndex); if (boneIndexBuffer != null) boneIndexArray = (Utilities.getByteArray((ByteBuffer) boneIndexBuffer.getData())); }
setMaxNumWeights(other.getMaxNumWeights());
setMaxNumWeights(other.getMaxNumWeights());
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());