Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1051 chris 1
package com.gebauz.bauzoid.graphics.model;
2
 
3
/** Helper class for filling geometry arrays. */
4
public class AttributeArray
5
{
6
        private float[] mAttributeArray = null;
7
        private int mCurrentIndex = 0;
8
 
9
        public AttributeArray(int size)
10
        {
11
                mAttributeArray = new float[size];
12
                mCurrentIndex = 0;
13
        }
14
 
15
        public void fill(float x)
16
        {
17
                mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
18
        }
19
 
20
        public void fill(float x, float y)
21
        {
22
                mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
23
                mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;
24
        }
25
 
26
        public void fill(float x, float y, float z)
27
        {
28
                mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
29
                mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;           
30
                mAttributeArray[mCurrentIndex] = z; mCurrentIndex++;
31
        }
32
 
33
        public void fill(float x, float y, float z, float w)
34
        {
35
                mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
36
                mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;           
37
                mAttributeArray[mCurrentIndex] = z; mCurrentIndex++;
38
                mAttributeArray[mCurrentIndex] = w; mCurrentIndex++;                   
39
        }
40
 
41
        public float[] getAttributeArray()
42
        {
43
                return mAttributeArray;
44
        }
45
 
46
        public int getUsedCount()
47
        {
48
                return mCurrentIndex;
49
        }
50
}