jme3-terrain: handle 2 more ByteBuffer cases
This commit is contained in:
parent
c85e2bcfd4
commit
3a5f9661ab
@ -33,6 +33,7 @@ package com.jme3.terrain.geomipmap;
|
||||
|
||||
import com.jme3.scene.VertexBuffer.Type;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
|
||||
@ -180,6 +181,8 @@ public class UpdatedTerrainPatch {
|
||||
updatedPatch.getMesh().setBuffer(Type.Index, 3, (IntBuffer)newIndexBuffer);
|
||||
else if (newIndexBuffer instanceof ShortBuffer)
|
||||
updatedPatch.getMesh().setBuffer(Type.Index, 3, (ShortBuffer)newIndexBuffer);
|
||||
else
|
||||
updatedPatch.getMesh().setBuffer(Type.Index, 3, (ByteBuffer)newIndexBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ import com.jme3.scene.VertexBuffer;
|
||||
import com.jme3.scene.VertexBuffer.Type;
|
||||
import com.jme3.util.BufferUtils;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
@ -78,6 +79,8 @@ public class EntropyComputeUtil {
|
||||
terrainBlock.setBuffer(Type.Index, 3, (IntBuffer)lodIndices);
|
||||
else if (lodIndices instanceof ShortBuffer) {
|
||||
terrainBlock.setBuffer(Type.Index, 3, (ShortBuffer) lodIndices);
|
||||
} else {
|
||||
terrainBlock.setBuffer(Type.Index, 3, (ByteBuffer) lodIndices);
|
||||
}
|
||||
|
||||
// Recalculate collision mesh
|
||||
|
Loading…
x
Reference in New Issue
Block a user