Address MR 1888 review comments.

- Delete obsolete symbolic links.
- Add suggested comments.
- Remove dead code.
This commit is contained in:
Avi Weinstock 2021-03-12 18:19:10 -05:00
parent aa56166c80
commit a32be4ac5a
11 changed files with 17 additions and 75 deletions

Binary file not shown.

BIN
assets/voxygen/voxel/object/airship.vox (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -22,6 +22,13 @@ impl Body {
}
}
/// Terrain is 11.0 scale relative to small-scale voxels, and all figures get
/// multiplied by 0.8 in rendering. For now, have a constant in `comp::Scale`
/// that compensates for both of these, but there might be a more elegant way
/// (e.g. using `Scale(0.8)` for everything else and not having a magic number
/// in figure rendering, and multiplying terrain models by 11.0 in animation).
pub const AIRSHIP_SCALE: f32 = 11.0 / 0.8;
/// Duplicate of some of the things defined in `voxygen::scene::figure::load` to
/// avoid having to refactor all of that to `common` for using voxels as
/// collider geometry

View File

@ -475,7 +475,9 @@ impl<'a> PhysicsData<'a> {
Collider::Voxel { .. } => {
// for now, treat entities with voxel colliders as their bounding
// cylinders for the purposes of colliding them with terrain
// Actually no, make them smaller to avoid lag
// Additionally, multiply radius by 0.1 to make the cylinder smaller to
// avoid lag
let radius = collider.get_radius() * scale * 0.1;
let (z_min, z_max) = collider.get_z_limits(scale);

View File

@ -1009,7 +1009,7 @@ fn handle_spawn_airship(
server
.state
.create_ship(pos, comp::ship::Body::DefaultAirship, 1, destination)
.with(comp::Scale(11.0 / 0.8))
.with(comp::Scale(comp::ship::AIRSHIP_SCALE))
.with(LightEmitter {
col: Rgb::new(1.0, 0.65, 0.2),
strength: 2.0,

View File

@ -27,7 +27,9 @@ impl Entity {
pub fn get_body(&self) -> comp::Body {
match self.rng(PERM_GENUS).gen::<f32>() {
//we want 5% airships, 45% birds, 50% humans
// we want 5% airships, 45% birds, 50% humans
// TODO: uncomment this to re-enable RtSim airships once physics is interpolated well
// in multiplayer.
//x if x < 0.05 => comp::Body::Ship(comp::ship::Body::DefaultAirship),
x if x < 0.50 => {
let species = *(&comp::bird_medium::ALL_SPECIES)

View File

@ -123,7 +123,7 @@ impl<'a> System<'a> for Sys {
_ => comp::Alignment::Wild,
},
scale: match body {
comp::Body::Ship(_) => comp::Scale(11.0 / 0.8),
comp::Body::Ship(_) => comp::Scale(comp::ship::AIRSHIP_SCALE),
_ => comp::Scale(1.0),
},
drop_item: None,

View File

@ -249,6 +249,8 @@ impl StateExt for State {
.with(comp::Controller::default())
.with(comp::inventory::Inventory::new_empty())
.with(comp::CharacterState::default())
// TODO: some of these are required in order for the character_behavior system to
// recognize a possesed airship; that system should be refactored to use `.maybe()`
.with(comp::Energy::new(ship.into(), level))
.with(comp::Health::new(ship.into(), level))
.with(comp::Stats::new("Airship".to_string()))

View File

@ -4112,17 +4112,6 @@ impl QuadrupedLowLateralSpec {
#[derive(Deserialize)]
struct ObjectCentralSpec(HashMap<object::Body, SidedObjectCentralVoxSpec>);
/*
#[derive(Deserialize)]
struct ShipCentralSpec(HashMap<ship::Body, SidedShipCentralVoxSpec>);
#[derive(Deserialize)]
struct SidedShipCentralVoxSpec {
bone0: ObjectCentralSubSpec,
bone1: ObjectCentralSubSpec,
bone2: ObjectCentralSubSpec,
}*/
#[derive(Deserialize)]
struct SidedObjectCentralVoxSpec {
bone0: ObjectCentralSubSpec,
@ -4193,54 +4182,6 @@ impl ObjectCentralSpec {
}
}
/*make_vox_spec!(
ship::Body,
struct ShipSpec {
central: ShipCentralSpec = "server.manifests.ship_manifest",
},
|FigureKey { body, .. }, spec| {
[
Some(spec.central.read().0.mesh_bone(
body, |spec| &spec.bone0,
)),
Some(spec.central.read().0.mesh_bone(
body, |spec| &spec.bone1
)),
Some(spec.central.read().0.mesh_bone(
body, |spec| &spec.bone2
)),
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
]
},
);
impl ShipCentralSpec {
fn mesh_bone<F: Fn(&SidedShipCentralVoxSpec) -> &ObjectCentralSubSpec>(&self, obj: &ship::Body, f: F) -> BoneMeshes {
let spec = match self.0.get(&obj) {
Some(spec) => spec,
None => {
error!("No specification exists for {:?}", obj);
return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5));
},
};
let bone = f(spec);
let central = graceful_load_segment(&bone.central.0);
(central, Vec3::from(bone.offset))
}
}*/
fn mesh_ship_bone<K: fmt::Debug + Eq + Hash, V, F: Fn(&V) -> &ShipCentralSubSpec>(
map: &HashMap<K, V>,
obj: &K,