feat(gui): add toolbar widget
feat(gui): add grid_select, toggle, panel, status_bar, image widgets fix(bsp): fill in exterior cells
This commit is contained in:
parent
5a565844dd
commit
8d491612ab
63 changed files with 3150 additions and 1686 deletions
|
|
@ -1,38 +1,23 @@
|
|||
extern crate alloc;
|
||||
|
||||
pub mod stream;
|
||||
|
||||
use crate::bsp::Bsp;
|
||||
use crate::math::Vec3;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||
pub enum ChunkId {
|
||||
Bsp(u32),
|
||||
Bsp { cx: i32, cz: i32 },
|
||||
}
|
||||
|
||||
pub enum Chunk {
|
||||
Bsp { id: u32, bsp: Bsp, version: u32 },
|
||||
Bsp { cx: i32, cz: i32, bsp: Bsp, version: u32 },
|
||||
}
|
||||
|
||||
impl Chunk {
|
||||
pub fn id(&self) -> ChunkId {
|
||||
match self {
|
||||
Chunk::Bsp { id, .. } => ChunkId::Bsp(*id),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn version(&self) -> u32 {
|
||||
match self {
|
||||
Chunk::Bsp { version, .. } => *version,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn trace(&self, from: Vec3, to: Vec3, radius: f32) -> Vec3 {
|
||||
match self {
|
||||
Chunk::Bsp { bsp, .. } => bsp.trace(from, to, radius),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_bsp(&self) -> Option<&Bsp> {
|
||||
match self {
|
||||
Chunk::Bsp { bsp, .. } => Some(bsp),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue