mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Hitboxes no longer cast shadows.
This commit is contained in:
parent
18657fdb66
commit
e72719ddf1
@ -265,6 +265,7 @@ pub struct Debug {
|
||||
pending_locals: HashMap<DebugShapeId, ([f32; 4], [f32; 4], [f32; 4])>,
|
||||
pending_deletes: HashSet<DebugShapeId>,
|
||||
models: HashMap<DebugShapeId, (Model<DebugVertex>, Bound<Consts<DebugLocals>>)>,
|
||||
casts_shadow: HashSet<DebugShapeId>,
|
||||
}
|
||||
|
||||
impl Debug {
|
||||
@ -275,12 +276,16 @@ impl Debug {
|
||||
pending_locals: HashMap::new(),
|
||||
pending_deletes: HashSet::new(),
|
||||
models: HashMap::new(),
|
||||
casts_shadow: HashSet::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_shape(&mut self, shape: DebugShape) -> DebugShapeId {
|
||||
let id = DebugShapeId(self.next_shape_id.0);
|
||||
self.next_shape_id.0 += 1;
|
||||
if matches!(shape, DebugShape::TrainTrack { .. }) {
|
||||
self.casts_shadow.insert(id);
|
||||
}
|
||||
self.pending_shapes.insert(id, shape);
|
||||
id
|
||||
}
|
||||
@ -335,8 +340,10 @@ impl Debug {
|
||||
}
|
||||
|
||||
pub fn render_shadows<'a>(&'a self, drawer: &mut DebugShadowDrawer<'_, 'a>) {
|
||||
for (model, locals) in self.models.values() {
|
||||
drawer.draw(model, locals);
|
||||
for id in self.casts_shadow.iter() {
|
||||
if let Some((model, locals)) = self.models.get(id) {
|
||||
drawer.draw(model, locals);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user