Package org.oscim.renderer.bucket
Class LineTexBucket
java.lang.Object
org.oscim.utils.pool.Inlist<RenderBucket>
org.oscim.renderer.bucket.RenderBucket
org.oscim.renderer.bucket.LineBucket
org.oscim.renderer.bucket.LineTexBucket
RenderElement for textured or stippled lines
Interleave two segment quads in one block to be able to use
vertices twice. pos0 and pos1 use the same vertex array where
pos1 has an offset of one vertex. The vertex shader will use
pos0 when the vertexId is even, pos1 when the Id is odd.
As there is no gl_VertexId in gles 2.0 an additional 'flip'
array is used. Depending on 'flip' extrusion is inverted.
Indices and flip buffers can be static.
First pass: using even vertex array positions (used vertices are in braces) vertex id 0 1 2 3 4 5 6 7 pos0 x (0) 1 (2) 3 (4) 5 (6) 7 x pos1 x (0) 1 (2) 3 (4) 5 (6) 7 x flip 0 1 0 1 0 1 0 1 Second pass: using odd vertex array positions vertex id 0 1 2 3 4 5 6 7 pos0 x 0 (1) 2 (3) 4 (5) 6 (7) x pos1 x 0 (1) 2 (3) 4 (5) 6 (7) x flip 0 1 0 1 0 1 0 1Vertex layout (here: 1 unit == 1 short): [2 unit] position, [2 unit] extrusion, [1 unit] line length [1 unit] unused indices, for two blocks: 0, 1, 2, 2, 1, 3, 4, 5, 6, 6, 5, 7, BIG NOTE: renderer assumes to be able to offset vertex array position so that in the first pass 'pos1' offset will be < 0 if no data precedes - in our case there is always the polygon fill array at start - see addLine hack otherwise.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.oscim.utils.pool.Inlist
Inlist.List<T extends Inlist<?>> -
Field Summary
FieldsFields inherited from class org.oscim.renderer.bucket.LineBucket
DIR_SCALE, heightOffset, line, MIN_DIST, outlines, roundCap, scaleFields inherited from class org.oscim.renderer.bucket.RenderBucket
BITMAP, CIRCLE, EXTRUSION, HAIRLINE, indiceItems, indiceOffset, LINE, MESH, numIndices, numVertices, POLYGON, SYMBOL, TEXLINE, type, vertexItems, vertexOffset -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLine(GeometryBuffer geom) protected voidclear()Clear all resources.protected voidcompile(ShortBuffer vboData, ShortBuffer iboData) voidsetTexRepeat(boolean texRepeat) Methods inherited from class org.oscim.renderer.bucket.LineBucket
addLine, addOutline, setBevelDistance, setDropDistance, setExtentsMethods inherited from class org.oscim.renderer.bucket.RenderBucket
compileIndicesItems, compileVertexItems, getIndiceOffset, getVertexOffset, prepare, setLevel, setVertexOffsetMethods inherited from class org.oscim.utils.pool.Inlist
appendItem, appendList, get, last, next, prependRelative, push, remove, size
-
Field Details
-
evenQuads
public int evenQuads -
oddQuads
public int oddQuads
-
-
Method Details
-
setTexRepeat
public void setTexRepeat(boolean texRepeat) -
addLine
- Overrides:
addLinein classLineBucket
-
clear
protected void clear()Description copied from class:RenderBucketClear all resources.- Overrides:
clearin classRenderBucket
-
compile
- Overrides:
compilein classRenderBucket
-