diff --git a/assets/common/manifests/ship_manifest.ron b/assets/common/manifests/ship_manifest.ron index 344306f506..9fef44499e 100644 --- a/assets/common/manifests/ship_manifest.ron +++ b/assets/common/manifests/ship_manifest.ron @@ -227,7 +227,7 @@ 13: Air(Window1, 2), 14: Air(Crate, 0), 15: Air(Cauldron, 2), - 16: Air(Tent, 0), + 16: Air(ChairSingle, 0), 17: Air(CookingPot, 0), 18: Air(WallLampSmall, 4), 19: Air(Lantern, 4), diff --git a/assets/common/voxel/carriage/structure.vox b/assets/common/voxel/carriage/structure.vox index 3ecbf70875..e8ce0a52e4 100644 --- a/assets/common/voxel/carriage/structure.vox +++ b/assets/common/voxel/carriage/structure.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f22fb1ea1c6cd2cb3a59a21c5b267635f08dfcca9f342b5f575a43e27a4fda98 -size 2256 +oid sha256:921ac0669e15444d5e80d0f34077dee27122eab3ba9c0cdb673b256c8102de1f +size 2356 diff --git a/common/src/mounting.rs b/common/src/mounting.rs index 5e32a78a2e..52d378f0f8 100644 --- a/common/src/mounting.rs +++ b/common/src/mounting.rs @@ -211,10 +211,11 @@ impl VolumePos { uid_allocator: &UidAllocator, mut read_pos_and_ori: impl FnMut(Entity) -> Option<(comp::Pos, comp::Ori)>, colliders: &ReadStorage, - ) -> Option<(Mat4, Block)> { + ) -> Option<(Mat4, comp::Ori, Block)> { match self.kind { Volume::Terrain => Some(( Mat4::translation_3d(self.pos.as_()), + comp::Ori::default(), *terrain.get(self.pos).ok()?, )), Volume::Entity(uid) => { @@ -234,7 +235,7 @@ impl VolumePos { let trans = Mat4::from(ori.to_quat()).translated_3d(pos.0) * Mat4::::translation_3d(local_translation); - Some((trans, block)) + Some((trans, ori, block)) }) }, } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index ec9579bcf0..85b6db550e 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -642,7 +642,9 @@ pub fn handle_orientation( // very rough guess let ticks_from_target_guess = ori_absdiff(&update.ori, &target_ori) / half_turns_per_tick; let instantaneous = ticks_from_target_guess < 1.0; - update.ori = if instantaneous { + update.ori = if data.volume_mount_data.is_some() { + update.ori + } else if instantaneous { target_ori } else { let target_fraction = { diff --git a/common/systems/src/mount.rs b/common/systems/src/mount.rs index 9061380c14..08ed26ebcb 100644 --- a/common/systems/src/mount.rs +++ b/common/systems/src/mount.rs @@ -103,7 +103,7 @@ impl<'a> System<'a> for Sys { // For each volume rider. for (entity, is_volume_rider) in (&entities, &is_volume_riders).join() { - if let Some((mut mat, _)) = is_volume_rider.pos.get_block_and_transform( + if let Some((mut mat, volume_ori, _)) = is_volume_rider.pos.get_block_and_transform( &terrain, &uid_allocator, |e| positions.get(e).copied().zip(orientations.get(e).copied()), @@ -114,21 +114,27 @@ impl<'a> System<'a> for Sys { continue; }; - if let Some(ori) = is_volume_rider.block.get_ori() { + let mount_block_ori = if let Some(ori) = is_volume_rider.block.get_ori() { mat *= Mat4::identity() .translated_3d(mount_offset) .rotated_z(std::f32::consts::PI * 0.25 * ori as f32) .translated_3d(Vec3::new(0.5, 0.5, 0.0)); + ori } else { mat *= Mat4::identity().translated_3d(mount_offset + Vec3::new(0.5, 0.5, 0.0)); - } + 0 + }; if let Some(pos) = positions.get_mut(entity) { pos.0 = mat.mul_point(Vec3::zero()); } if let Some(ori) = orientations.get_mut(entity) { - *ori = Ori::from_unnormalized_vec(mat.mul_direction(mount_dir)) - .unwrap_or_default(); + *ori = volume_ori.rotated( + Ori::from_unnormalized_vec(mount_dir) + .unwrap_or_default() + .to_quat() + .rotated_z(std::f32::consts::PI * 0.25 * mount_block_ori as f32), + ); } } let v = match is_volume_rider.pos.kind { diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 1b54f1bab0..b0e3a57b81 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -158,7 +158,7 @@ pub fn handle_mount_volume(server: &mut Server, rider: EcsEntity, volume_pos: Vo &state.read_storage(), ); - if let Some((mat, block)) = block_transform + if let Some((mat, _, block)) = block_transform && let Some(mount_offset) = block.mount_offset() { let mount_pos = (mat * mount_offset.0.with_w(1.0)).xyz(); let within_range = { diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index ef669fbeed..2fb6c3eb41 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -801,7 +801,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv }, &state.read_storage(), ) - .map(|(mat, _)| mat.mul_point(Vec3::broadcast(0.5))) + .map(|(mat, _, _)| mat.mul_point(Vec3::broadcast(0.5))) }); if !in_range { debug!( diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index b8afcb2879..79206cffdf 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2042,7 +2042,7 @@ impl Hud { // Render overtime for an interactable block if let Some(Interactable::Block(block, pos, interaction)) = interactable - && let Some((mat, _)) = pos.get_block_and_transform( + && let Some((mat, _, _)) = pos.get_block_and_transform( &ecs.read_resource(), &ecs.read_resource(), |e| ecs.read_storage::().get(e).map(|interpolated| (comp::Pos(interpolated.pos), interpolated.ori)), @@ -4751,7 +4751,7 @@ impl Hud { }, &client.state().read_storage(), ) - .map_or(false, |(mat, block)| { + .map_or(false, |(mat, _, block)| { block.get_sprite() == Some(*sprite) && mat.mul_point(Vec3::broadcast(0.5)).distance(player_pos) < MAX_PICKUP_RANGE