source: java/client_3D/src/pl/vorg/mowa/core/graphics/VertexStream.java @ 66

Last change on this file since 66 was 66, checked in by Maciej Komosinski, 13 years ago

set 'eol-style' to 'native'

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1package pl.vorg.mowa.core.graphics;
2
3import java.util.ArrayList;
4
5/**
6 * A stream of vertex. Eeach vertex may be described by many different
7 * attributes (position, color, texture coordinates, etc.) contained in buffers.
8 *
9 * Za to jak kolejno ukladaja sie wiercholki odpowiada indexBuffer.
10 *
11 * Np trojkat o wierzcholkach (0,0,0) (1,0,0) (0,1,0) o kolorach czerwonym,
12 * zielonym i niebieskim ze wspolrzednymi tekstury (0,0) (1,0) (0,1)
13 *
14 * wygladalby tak FloatVertexAttrib "pos" : [0, 0, 0, 1, 0, 0, 0, 1, 0]
15 * FloatVertexAttrib "color" : [1, 0, 0, 0, 1, 0, 0, 0, 1] FloatVertexAttrib
16 * "texCoord0" : [0, 0, 1, 0, 0, 1] IndexBuffer : [0, 1, 2]
17 *
18 * @author vorg
19 */
20public class VertexStream {
21        private ArrayList<VertexAttrib> attribs = new ArrayList<VertexAttrib>();
22        private IndexBuffer indexBuffer;
23
24        public ArrayList<VertexAttrib> getAttribs() {
25                return attribs;
26        }
27
28        public VertexAttrib getAttribByName(String name) {
29                for (VertexAttrib attrib : attribs) {
30                        if (attrib.getName().equals(name)) {
31                                return attrib;
32                        }
33                }
34                return null;
35        }
36
37        public void addAttrib(VertexAttrib attrib) {
38                attribs.add(attrib);
39        }
40
41        public IndexBuffer getIndexBuffer() {
42                return indexBuffer;
43        }
44
45        public void setIndexBuffer(IndexBuffer indexBuffer) {
46                this.indexBuffer = indexBuffer;
47        }
48}
Note: See TracBrowser for help on using the repository browser.