Skip to content

quantizeSnapshot

quantizeSnapshot(snapshot, onClamp?): number

Defined in: packages/engine/src/gameplay/replication/delta.ts:130

Rounds snapshot in place to the precision the stream sends, holds each position within worldLimitMetres, and hashes it again, so a replica that holds what arrived dumps the same hash. Hands onClamp the key of each entity it clamped, and returns the coordinates it clamped.

Parameter Type
snapshot StateDump
onClamp? (entity) => void

number