1 | package pl.vorg.mowa.core.graphics;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * The base class of a vertex attribute used in buffers.
|
---|
5 | *
|
---|
6 | * @author vorg
|
---|
7 | */
|
---|
8 | public abstract class VertexAttrib {
|
---|
9 | /**
|
---|
10 | * The attribute's name IS meaningful and it corresponds to the attribute's
|
---|
11 | * semantics. Basic attributes are, e.g.: pos, normal, texCoord0.
|
---|
12 | */
|
---|
13 | private String name = "";
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Number of elements that an attributes contains. E.g., a position contains
|
---|
17 | * 3 floats x,y,z. It should be used in VertexArrays, however, since they
|
---|
18 | * don't work in JOGL under OSX, those values are hard-coded in
|
---|
19 | * Geometry.displayImmediately(), and the dataType field hasn't been used.
|
---|
20 | */
|
---|
21 | private int dataType;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * Constructor.
|
---|
25 | *
|
---|
26 | * @param name
|
---|
27 | * The attribute's name. It IS meaningful and it corresponds to
|
---|
28 | * the attribute's semantics. Basic attributes are, e.g.: pos,
|
---|
29 | * normal, texCoord0.
|
---|
30 | */
|
---|
31 | public VertexAttrib(String name) {
|
---|
32 | this.name = name;
|
---|
33 | }
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * @return Number of elements that an attributes contains.
|
---|
37 | */
|
---|
38 | public int getDataType() {
|
---|
39 | return dataType;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void setDataType(int dataType) {
|
---|
43 | this.dataType = dataType;
|
---|
44 | }
|
---|
45 |
|
---|
46 | public String getName() {
|
---|
47 | return name;
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * Sets the attribute's name. It IS meaningful and it corresponds to the
|
---|
52 | * attribute's semantics. Basic attributes are, e.g.: pos, normal,
|
---|
53 | * texCoord0.
|
---|
54 | *
|
---|
55 | * @param name
|
---|
56 | * The attribute's name.
|
---|
57 | */
|
---|
58 | public void setName(String name) {
|
---|
59 | this.name = name;
|
---|
60 | }
|
---|
61 | }
|
---|