From: Ian Jackson Date: Wed, 8 Jul 2020 13:19:37 +0000 (+0100) Subject: Z order docs X-Git-Tag: otter-0.2.0~1397 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8695d7f91c01fafd9d4ba2855c1e74558a2b0cc0;p=otter.git Z order docs --- diff --git a/PROTOCOL.md b/PROTOCOL.md index 09b092c5..8d444662 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -228,3 +228,21 @@ note, the client knows the server is up to date, and deletes the note. If the client sees a Server update message, and the client has a note, it knows that there was a conflict. + + +LEVEL (Z ORDER) +=============== + +Each piece has a Z level which is a finite f64, set by the client +which manipulates the piece, according to the protocol above. + +Each piece *also* has a Z level generation. This is set by the +server. The server guarantees to set it to the server generation, and +guarantees to do so as the result of any client Z level update. + +So the client which sends a Z level update can assume that a server +update to the generation will turn up, and with a higher value. + +The Z generation is used to disambiguate the Z order for pieces with +identical Z level. Higher values are closer to the user (ie, occlude +lower values).