Switched to 64FNV-1a as shapes keying algorithm as collision resistant

Allow shapes to be sent in bulk as one / few packets
Optimized rendering of shapes that not render all faces
Moving shapes render now smoothly with higher framerates
This commit is contained in:
gnembon committed 2020-06-08 21:24:56 -03:00
1 parent 2739ef9d44
commit 2f102a7785
9 files changed
+595 -193

No files matched your search

@@ -94,7 +94,7 @@ __structure_renderer(player_name) ->
l(from, to) = structure_data;
total_size = _euclidean(from, to);
density = max(10, total_size/10);
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', 0x00FFFFFF, 'width', 3, 'fill', 0x00FFFF22);
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', 0x00FFFFFF, 'line', 3, 'fill', 0x00FFFF22);
structure_pieces = slice(sort_key(structure_pieces, _euclidean_sq((_:2+_:3)/2,ppos)), 0, config:'max_pieces');
for (structure_pieces, l(piece, direction, from, to) = _;
r = 255 - floor(128 * _i/config:'max_pieces');
@@ -133,12 +133,14 @@ __chunk_renderer(player_name) ->
b = 30;
a = max(0, 255-player_distance);
color = a+256*(b+256*(g+256*r));
draw_shape('line', 15, 'from', top_00, 'to', top_10, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_10, 'to', top_11, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_11, 'to', top_01, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_01, 'to', top_00, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_00, 'to', top_11, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_01, 'to', top_10, 'color', color, 'width', 3);
draw_shape(l(
l('line', 15, 'from', top_00, 'to', top_10, 'color', color, 'line', 3),
l('line', 15, 'from', top_10, 'to', top_11, 'color', color, 'line', 3),
l('line', 15, 'from', top_11, 'to', top_01, 'color', color, 'line', 3),
l('line', 15, 'from', top_01, 'to', top_00, 'color', color, 'line', 3),
l('line', 15, 'from', top_00, 'to', top_11, 'color', color, 'line', 3),
l('line', 15, 'from', top_01, 'to', top_10, 'color', color, 'line', 3)
));
)
)
)