|
51 | 51 | import com.jme3.asset.AssetLoadException; |
52 | 52 | import com.jme3.plugins.json.JsonElement; |
53 | 53 | import com.jme3.plugins.json.JsonObject; |
54 | | -import com.jme3.renderer.opengl.GL; |
55 | 54 | import com.jme3.scene.Mesh; |
56 | 55 | import com.jme3.scene.VertexBuffer; |
57 | 56 | import com.jme3.scene.VertexBuffer.Type; |
@@ -216,15 +215,16 @@ private static DracoMesh readDracoMesh(GltfLoader loader, JsonElement extension) |
216 | 215 | */ |
217 | 216 | VertexBuffer createIndicesVertexBuffer(GltfLoader loader, int componentType, int indices[]) { |
218 | 217 | Buffer data = null; |
219 | | - if (componentType == GL.GL_UNSIGNED_BYTE) { |
| 218 | + if (componentType == GltfConstants.GL_UNSIGNED_BYTE) { |
220 | 219 | data = createByteBuffer(indices); |
221 | | - } else if (componentType == GL.GL_UNSIGNED_SHORT) { |
| 220 | + } else if (componentType == GltfConstants.GL_UNSIGNED_SHORT) { |
222 | 221 | data = createShortBuffer(indices); |
223 | | - } else if (componentType == GL.GL_UNSIGNED_INT) { |
| 222 | + } else if (componentType == GltfConstants.GL_UNSIGNED_INT) { |
224 | 223 | data = BufferUtils.createIntBuffer(indices); |
225 | 224 | } else { |
226 | 225 | throw new AssetLoadException("The indices accessor must have a component type of " |
227 | | - + GL.GL_UNSIGNED_BYTE + ", " + GL.GL_UNSIGNED_SHORT + ", or " + GL.GL_UNSIGNED_INT |
| 226 | + + GltfConstants.GL_UNSIGNED_BYTE + ", " + GltfConstants.GL_UNSIGNED_SHORT + ", or " |
| 227 | + + GltfConstants.GL_UNSIGNED_INT |
228 | 228 | + ", but has " + componentType); |
229 | 229 | } |
230 | 230 | VertexBuffer vb = new VertexBuffer(VertexBuffer.Type.Index); |
@@ -365,30 +365,31 @@ private static VertexBuffer createAttributeVertexBuffer(String attributeName, Js |
365 | 365 | int componentCount = getAccessorComponentCount(accessor); |
366 | 366 | Type bufferType = getVertexBufferType(attributeName); |
367 | 367 |
|
368 | | - if (componentType == GL.GL_BYTE || componentType == GL.GL_UNSIGNED_BYTE) { |
| 368 | + if (componentType == GltfConstants.GL_BYTE || componentType == GltfConstants.GL_UNSIGNED_BYTE) { |
369 | 369 | ByteBuffer attributeData = readByteDracoAttribute(pointAttribute, indices, count, componentCount); |
370 | 370 | VertexBuffer attributeVertexBuffer = createByteAttributeVertexBuffer(accessor, bufferType, |
371 | 371 | attributeData); |
372 | 372 | return attributeVertexBuffer; |
373 | 373 | } |
374 | | - if (componentType == GL.GL_SHORT || componentType == GL.GL_UNSIGNED_SHORT) { |
| 374 | + if (componentType == GltfConstants.GL_SHORT || componentType == GltfConstants.GL_UNSIGNED_SHORT) { |
375 | 375 | ShortBuffer attributeData = readShortDracoAttribute(pointAttribute, indices, count, |
376 | 376 | componentCount); |
377 | 377 | VertexBuffer attributeVertexBuffer = createShortAttributeVertexBuffer(accessor, bufferType, |
378 | 378 | attributeData); |
379 | 379 | return attributeVertexBuffer; |
380 | 380 | } |
381 | | - if (componentType == GL.GL_FLOAT) { |
| 381 | + if (componentType == GltfConstants.GL_FLOAT) { |
382 | 382 | FloatBuffer attributeData = readFloatDracoAttribute(pointAttribute, indices, count, |
383 | 383 | componentCount); |
384 | 384 | VertexBuffer attributeVertexBuffer = createFloatAttributeVertexBuffer(accessor, bufferType, |
385 | 385 | attributeData); |
386 | 386 | return attributeVertexBuffer; |
387 | 387 | } |
388 | 388 | throw new AssetLoadException( |
389 | | - "The accessor for attribute " + attributeName + " must have a component type of " + GL.GL_BYTE |
390 | | - + ", " + GL.GL_UNSIGNED_BYTE + ", " + GL.GL_SHORT + ", " + GL.GL_UNSIGNED_SHORT + ", " |
391 | | - + "or " + GL.GL_FLOAT + ", but has " + componentType); |
| 389 | + "The accessor for attribute " + attributeName + " must have a component type of " |
| 390 | + + GltfConstants.GL_BYTE + ", " + GltfConstants.GL_UNSIGNED_BYTE + ", " |
| 391 | + + GltfConstants.GL_SHORT + ", " + GltfConstants.GL_UNSIGNED_SHORT + ", " + "or " |
| 392 | + + GltfConstants.GL_FLOAT + ", but has " + componentType); |
392 | 393 | } |
393 | 394 |
|
394 | 395 | /** |
|
0 commit comments