Revision a56bc359
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/DistortedCubesGrid.java | ||
---|---|---|
25 | 25 |
|
26 | 26 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
27 | 27 |
|
28 |
class DistortedCubesGrid extends DistortedObjectGrid |
|
28 |
public class DistortedCubesGrid extends DistortedObjectGrid
|
|
29 | 29 |
{ |
30 | 30 |
private static final float R = 0.0f;//0.2f; |
31 | 31 |
private static final float FRONTZ = 0.5f; |
... | ... | |
743 | 743 |
/** |
744 | 744 |
* Creates the underlying grid of vertices, normals, texture coords and colors. |
745 | 745 |
* |
746 |
* @param cols See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)} |
|
747 |
* @param desc See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)} |
|
748 |
* @param frontOnly See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)} |
|
746 |
* @param cols Integer helping to parse the next parameter. |
|
747 |
* @param desc String describing the subset of a MxNx1 cuboid that we want to create. |
|
748 |
* Its MxN characters - all 0 or 1 - decide of appropriate field is taken or not. |
|
749 |
* <p></p> |
|
750 |
* <p> |
|
751 |
* <pre> |
|
752 |
* For example, (cols=2, desc="111010") describes the following shape: |
|
753 |
* |
|
754 |
* XX |
|
755 |
* X |
|
756 |
* X |
|
757 |
* |
|
758 |
* whereas (cols=2,desc="110001") describes |
|
759 |
* |
|
760 |
* XX |
|
761 |
* |
|
762 |
* X |
|
763 |
* </pre> |
|
764 |
* </p> |
|
765 |
* @param frontOnly Only create the front wall or side and back as well? |
|
749 | 766 |
*/ |
750 |
DistortedCubesGrid(int cols, String desc, boolean frontOnly) |
|
767 |
public DistortedCubesGrid(int cols, String desc, boolean frontOnly)
|
|
751 | 768 |
{ |
752 | 769 |
prepareDataStructures(cols,desc,frontOnly); |
753 | 770 |
build(frontOnly); |
... | ... | |
757 | 774 |
/** |
758 | 775 |
* Creates a full, hole-less underlying grid of vertices, normals, texture coords and colors. |
759 | 776 |
* |
760 |
* @param cols See {@link DistortedCubes#DistortedCubes(int,int,int,boolean)}
|
|
761 |
* @param rows See {@link DistortedCubes#DistortedCubes(int,int,int,boolean)}
|
|
762 |
* @param frontOnly See {@link DistortedCubes#DistortedCubes(int,int,int,boolean)}
|
|
777 |
* @param cols Number of columns.
|
|
778 |
* @param rows Number of rows.
|
|
779 |
* @param frontOnly Only create the front wall or side and back as well?
|
|
763 | 780 |
*/ |
764 |
DistortedCubesGrid(int cols, int rows, boolean frontOnly) |
|
781 |
public DistortedCubesGrid(int cols, int rows, boolean frontOnly)
|
|
765 | 782 |
{ |
766 | 783 |
prepareDataStructures(cols,rows,frontOnly); |
767 | 784 |
build(frontOnly); |
Also available in: Unified diff
Major change in API: separate the GRID from DistortedObject; completely remove classes derived from DistortedObject.