Revision 7958d843
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
52 | 52 |
private static final int ASSOC_UBO_BINDING = 3; |
53 | 53 |
private static final int CENTER_UBO_BINDING = 4; |
54 | 54 |
|
55 |
public static int MAX_EFFECT_COMPONENTS= 100; |
|
56 |
|
|
57 | 55 |
// sizes of attributes of an individual vertex. |
58 | 56 |
private static final int POS_DATA_SIZE= 3; // vertex coordinates: x,y,z |
59 | 57 |
private static final int NOR_DATA_SIZE= 3; // normal vector: x,y,z |
... | ... | |
86 | 84 |
private static final int TEX_COMP_SIZE = 5; // 5 four-byte entities inside the component |
87 | 85 |
|
88 | 86 |
private static boolean mUseCenters; |
87 |
private static int mStride; |
|
88 |
private static int mMaxComponents = 100; |
|
89 | 89 |
|
90 | 90 |
private boolean mShowNormals; // when rendering this mesh, draw normal vectors? |
91 | 91 |
private InternalBuffer mVBO1, mVBO2, mTFO; // main vertex buffer and transform feedback buffer |
... | ... | |
96 | 96 |
private final UniformBlockAssociation mUBA; |
97 | 97 |
private UniformBlockCenter mUBC; |
98 | 98 |
private boolean mStrideCorrected; |
99 |
private static int mStride; |
|
100 | 99 |
|
101 | 100 |
DeferredJobs.JobNode[] mJobNode; |
102 | 101 |
|
... | ... | |
399 | 398 |
if( j==numEffComponents-1 ) index += extraVerticesAfter; |
400 | 399 |
mEffComponent.add(index); |
401 | 400 |
|
402 |
if( origEffComponents<MAX_EFFECT_COMPONENTS )
|
|
401 |
if( origEffComponents<mMaxComponents )
|
|
403 | 402 |
{ |
404 | 403 |
mUBA.copy(origEffComponents, mesh.mUBA, j); |
405 | 404 |
if( mUseCenters ) mUBC.copy(origEffComponents, mesh.mUBC, j); |
... | ... | |
570 | 569 |
|
571 | 570 |
public static int getMaxEffComponents() |
572 | 571 |
{ |
573 |
return MAX_EFFECT_COMPONENTS;
|
|
572 |
return mMaxComponents;
|
|
574 | 573 |
} |
575 | 574 |
|
576 | 575 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
579 | 578 |
*/ |
580 | 579 |
public static void setMaxEffComponents(int max) |
581 | 580 |
{ |
582 |
MAX_EFFECT_COMPONENTS = max;
|
|
581 |
mMaxComponents = max;
|
|
583 | 582 |
} |
584 | 583 |
|
585 | 584 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
1246 | 1245 |
*/ |
1247 | 1246 |
public void setEffectAssociation(int component, int andAssociation, int equAssociation) |
1248 | 1247 |
{ |
1249 |
if( component>=0 && component<MAX_EFFECT_COMPONENTS )
|
|
1248 |
if( component>=0 && component<mMaxComponents )
|
|
1250 | 1249 |
{ |
1251 | 1250 |
if( mJobNode[0]==null ) |
1252 | 1251 |
{ |
... | ... | |
1274 | 1273 |
*/ |
1275 | 1274 |
public void setComponentCenter(int component, float centerX, float centerY, float centerZ) |
1276 | 1275 |
{ |
1277 |
if( component>=0 && component<MAX_EFFECT_COMPONENTS )
|
|
1276 |
if( component>=0 && component<mMaxComponents )
|
|
1278 | 1277 |
{ |
1279 | 1278 |
if( mJobNode[0]==null ) |
1280 | 1279 |
{ |
Also available in: Unified diff
MeshBase's 'MAX_NUM_COMPONENTS' is not a constant - rename!