mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added giant trees to LoD
This commit is contained in:
parent
d4fd9d2d0e
commit
907ba3dcbc
BIN
assets/voxygen/lod/giant_tree.obj
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/lod/giant_tree.obj
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -19,6 +19,7 @@ pub enum ObjectKind {
|
||||
Oak,
|
||||
Pine,
|
||||
House,
|
||||
GiantTree,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
@ -64,6 +64,10 @@ impl Lod {
|
||||
(lod::ObjectKind::Oak, make_lod_object("oak", renderer)),
|
||||
(lod::ObjectKind::Pine, make_lod_object("pine", renderer)),
|
||||
(lod::ObjectKind::House, make_lod_object("house", renderer)),
|
||||
(
|
||||
lod::ObjectKind::GiantTree,
|
||||
make_lod_object("giant_tree", renderer),
|
||||
),
|
||||
]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
@ -119,6 +123,7 @@ impl Lod {
|
||||
lod::ObjectKind::Pine => Rgb::new(0, 25, 12),
|
||||
lod::ObjectKind::Oak => Rgb::new(13, 50, 5),
|
||||
lod::ObjectKind::House => Rgb::new(20, 15, 0),
|
||||
lod::ObjectKind::GiantTree => Rgb::new(13, 50, 5),
|
||||
};
|
||||
objects
|
||||
.entry(object.kind)
|
||||
|
@ -543,6 +543,29 @@ impl World {
|
||||
}),
|
||||
);
|
||||
|
||||
// Add giant trees
|
||||
objects.extend(
|
||||
index
|
||||
.sites
|
||||
.iter()
|
||||
.filter(|(_, site)| {
|
||||
site.get_origin()
|
||||
.map2(min_wpos.zip(max_wpos), |e, (min, max)| e >= min && e < max)
|
||||
.reduce_and()
|
||||
})
|
||||
.filter(|(_, site)| matches!(&site.kind, SiteKind::GiantTree(_)))
|
||||
.map(|(_, site)| lod::Object {
|
||||
kind: lod::ObjectKind::GiantTree,
|
||||
pos: {
|
||||
let wpos2d = site.get_origin();
|
||||
(wpos2d - min_wpos)
|
||||
.map(|e| e as i16)
|
||||
.with_z(self.sim().get_alt_approx(wpos2d).unwrap_or(0.0) as i16)
|
||||
},
|
||||
flags: lod::Flags::empty(),
|
||||
}),
|
||||
);
|
||||
|
||||
lod::Zone { objects }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user