Revision 05403bba
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/MeshCubes.java | ||
---|---|---|
730 | 730 |
if( remainingVert!=0 ) |
731 | 731 |
android.util.Log.d("CUBES", "remainingVert " +remainingVert ); |
732 | 732 |
|
733 |
mGridPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
734 |
mGridPositions.put(positionData).position(0);
|
|
733 |
mMeshPositions = ByteBuffer.allocateDirect(POSITION_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
734 |
mMeshPositions.put(positionData).position(0);
|
|
735 | 735 |
|
736 |
mGridNormals = ByteBuffer.allocateDirect(NORMAL_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
737 |
mGridNormals.put(normalData).position(0);
|
|
736 |
mMeshNormals = ByteBuffer.allocateDirect(NORMAL_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
737 |
mMeshNormals.put(normalData).position(0);
|
|
738 | 738 |
|
739 |
mGridTexture = ByteBuffer.allocateDirect(TEX_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
740 |
mGridTexture.put(textureData).position(0);
|
|
739 |
mMeshTexture = ByteBuffer.allocateDirect(TEX_DATA_SIZE*dataLength*BYTES_PER_FLOAT).order(ByteOrder.nativeOrder()).asFloatBuffer();
|
|
740 |
mMeshTexture.put(textureData).position(0);
|
|
741 | 741 |
} |
742 | 742 |
|
743 | 743 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
744 | 744 |
// PUBLIC API |
745 | 745 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
746 | 746 |
/** |
747 |
* Creates the underlying grid of vertices, normals, texture coords.
|
|
747 |
* Creates the underlying mesh of vertices, normals, texture coords.
|
|
748 | 748 |
* |
749 | 749 |
* @param cols Integer helping to parse the next parameter. |
750 | 750 |
* @param desc String describing the subset of a MxNx1 cuboid that we want to create. |
... | ... | |
776 | 776 |
|
777 | 777 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
778 | 778 |
/** |
779 |
* Creates a full, hole-less underlying grid of vertices, normals, texture coords and colors.
|
|
779 |
* Creates a full, hole-less underlying mesh of vertices, normals, texture coords and colors.
|
|
780 | 780 |
* |
781 | 781 |
* @param cols Number of columns. |
782 | 782 |
* @param rows Number of rows. |
Also available in: Unified diff
rename all the 'grid' variables to 'mesh'.