diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-12-14 15:51:43 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-12-29 11:31:00 +0100 |
| commit | cc6d1b973002b4d366bc81ec6bf9e8240ad7b404 (patch) | |
| tree | 66827195ef82f22e545fc9ee4e0bade9baa8031b /src/data | |
| parent | 9bf1321f8f1d2e116f44c2461a53f302c4ef4171 (diff) | |
| download | rapier-cc6d1b973002b4d366bc81ec6bf9e8240ad7b404.tar.gz rapier-cc6d1b973002b4d366bc81ec6bf9e8240ad7b404.tar.bz2 rapier-cc6d1b973002b4d366bc81ec6bf9e8240ad7b404.zip | |
Outsource the Shape trait, wquadtree, and shape types.
Diffstat (limited to 'src/data')
| -rw-r--r-- | src/data/arena.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/data/arena.rs b/src/data/arena.rs index fcec017..a3af45c 100644 --- a/src/data/arena.rs +++ b/src/data/arena.rs @@ -3,6 +3,7 @@ //! See https://github.com/fitzgen/generational-arena/blob/master/src/lib.rs. //! This has been modified to have a fully deterministic deserialization (including for the order of //! Index attribution after a deserialization of the arena. +use buckler::partitioning::IndexedData; use std::cmp; use std::iter::{self, Extend, FromIterator, FusedIterator}; use std::mem; @@ -51,6 +52,16 @@ pub struct Index { generation: u64, } +impl IndexedData for Index { + fn default() -> Self { + Self::from_raw_parts(crate::INVALID_USIZE, crate::INVALID_U64) + } + + fn index(&self) -> usize { + self.into_raw_parts().0 + } +} + impl Index { /// Create a new `Index` from its raw parts. /// |
