* BatchNode / GeometryBatchFactory now batch animated models correctly. Note that any control(s) are removed during the batching process, and must be re-added after batching for animation to work.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9712 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
4fa00b6d9a
commit
6aefda2e38
@ -414,6 +414,7 @@ public class BatchNode extends Node implements Savable {
|
|||||||
int totalVerts = 0;
|
int totalVerts = 0;
|
||||||
int totalTris = 0;
|
int totalTris = 0;
|
||||||
int totalLodLevels = 0;
|
int totalLodLevels = 0;
|
||||||
|
int maxWeights = -1;
|
||||||
|
|
||||||
Mesh.Mode mode = null;
|
Mesh.Mode mode = null;
|
||||||
for (Geometry geom : geometries) {
|
for (Geometry geom : geometries) {
|
||||||
@ -451,6 +452,8 @@ public class BatchNode extends Node implements Savable {
|
|||||||
formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat();
|
formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());
|
||||||
|
|
||||||
if (mode != null && mode != listMode) {
|
if (mode != null && mode != listMode) {
|
||||||
throw new UnsupportedOperationException("Cannot combine different"
|
throw new UnsupportedOperationException("Cannot combine different"
|
||||||
+ " primitive types: " + mode + " != " + listMode);
|
+ " primitive types: " + mode + " != " + listMode);
|
||||||
@ -459,6 +462,7 @@ public class BatchNode extends Node implements Savable {
|
|||||||
compsForBuf[VertexBuffer.Type.Index.ordinal()] = components;
|
compsForBuf[VertexBuffer.Type.Index.ordinal()] = components;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outMesh.setMaxNumWeights(maxWeights);
|
||||||
outMesh.setMode(mode);
|
outMesh.setMode(mode);
|
||||||
if (totalVerts >= 65536) {
|
if (totalVerts >= 65536) {
|
||||||
// make sure we create an UnsignedInt buffer so
|
// make sure we create an UnsignedInt buffer so
|
||||||
|
@ -99,6 +99,7 @@ public class GeometryBatchFactory {
|
|||||||
int totalVerts = 0;
|
int totalVerts = 0;
|
||||||
int totalTris = 0;
|
int totalTris = 0;
|
||||||
int totalLodLevels = 0;
|
int totalLodLevels = 0;
|
||||||
|
int maxWeights = -1;
|
||||||
|
|
||||||
Mode mode = null;
|
Mode mode = null;
|
||||||
for (Geometry geom : geometries) {
|
for (Geometry geom : geometries) {
|
||||||
@ -134,6 +135,8 @@ public class GeometryBatchFactory {
|
|||||||
formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat();
|
formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maxWeights = Math.max(maxWeights, geom.getMesh().getMaxNumWeights());
|
||||||
|
|
||||||
if (mode != null && mode != listMode) {
|
if (mode != null && mode != listMode) {
|
||||||
throw new UnsupportedOperationException("Cannot combine different"
|
throw new UnsupportedOperationException("Cannot combine different"
|
||||||
+ " primitive types: " + mode + " != " + listMode);
|
+ " primitive types: " + mode + " != " + listMode);
|
||||||
@ -142,6 +145,7 @@ public class GeometryBatchFactory {
|
|||||||
compsForBuf[Type.Index.ordinal()] = components;
|
compsForBuf[Type.Index.ordinal()] = components;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
outMesh.setMaxNumWeights(maxWeights);
|
||||||
outMesh.setMode(mode);
|
outMesh.setMode(mode);
|
||||||
if (totalVerts >= 65536) {
|
if (totalVerts >= 65536) {
|
||||||
// make sure we create an UnsignedInt buffer so
|
// make sure we create an UnsignedInt buffer so
|
||||||
|
Loading…
x
Reference in New Issue
Block a user