aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src/traits/models.rs
blob: 58b5f7417887625803a999ccf6ea136f05ebc4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use na::Vector3;
use std::ops::Range;

use super::{HasBrushes, HasFaces};
use crate::coords::CoordSystem;

#[derive(Debug, Clone)]
pub struct Model {
    pub mins: Vector3<f32>,
    pub maxs: Vector3<f32>,
    pub faces_idx: Range<u32>,
    pub brushes_idx: Range<u32>,
}

pub trait HasModels<S: CoordSystem>: HasFaces<S> + HasBrushes<S> {
    type ModelsIter<'a>: Iterator<Item = &'a Model>;

    fn models_iter(&self) -> Self::ModelsIter<'_>;
    fn get_model(&self, index: u32) -> &Model;
}