From 7ae85aef508e2e4630bba4da645924ff1d655990 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Fri, 4 Feb 2022 23:59:57 -0500 Subject: [PATCH] tweaks --- common/src/states/wallrun.rs | 5 +-- voxygen/anim/src/character/wallrun.rs | 48 +++------------------------ voxygen/src/scene/figure/mod.rs | 9 +---- 3 files changed, 8 insertions(+), 54 deletions(-) diff --git a/common/src/states/wallrun.rs b/common/src/states/wallrun.rs index 122a7ddd16..4b802f1cbe 100644 --- a/common/src/states/wallrun.rs +++ b/common/src/states/wallrun.rs @@ -1,6 +1,6 @@ use super::utils::*; use crate::{ - comp::{character_state::OutputEvents, CharacterState, InventoryAction, StateUpdate}, + comp::{character_state::OutputEvents, CharacterState, StateUpdate}, states::{ behavior::{CharacterBehavior, JoinData}, idle, @@ -9,7 +9,7 @@ use crate::{ use serde::{Deserialize, Serialize}; use vek::Vec2; -const WALLRUN_ANTIGRAV: f32 = crate::consts::GRAVITY * 0.90; +const WALLRUN_ANTIGRAV: f32 = crate::consts::GRAVITY * 0.5; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Data; @@ -20,6 +20,7 @@ impl CharacterBehavior for Data { handle_wield(data, &mut update); handle_jump(data, output_events, &mut update, 1.0); + handle_climb(data, &mut update); { let lift = WALLRUN_ANTIGRAV; diff --git a/voxygen/anim/src/character/wallrun.rs b/voxygen/anim/src/character/wallrun.rs index 2bac4a428f..acb91dd4da 100644 --- a/voxygen/anim/src/character/wallrun.rs +++ b/voxygen/anim/src/character/wallrun.rs @@ -2,23 +2,11 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::comp::item::{Hands, ToolKind}; -use core::{f32::consts::PI, ops::Mul}; +use core::f32::consts::PI; pub struct WallrunAnimation; -type WallrunAnimationDependency = ( - Option, - Option, - (Option, Option), - Vec3, - Vec3, - Vec3, - f32, - Vec3, - f32, - Option>, -); +type WallrunAnimationDependency = (Vec3, f32, Option>); impl Animation for WallrunAnimation { type Dependency<'a> = WallrunAnimationDependency; @@ -31,49 +19,27 @@ impl Animation for WallrunAnimation { fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - ( - active_tool_kind, - second_tool_kind, - hands, - velocity, - orientation, - last_ori, - global_time, - avg_vel, - acc_vel, - wall, - ): Self::Dependency<'a>, - anim_time: f32, + (orientation, acc_vel, wall): Self::Dependency<'a>, + _anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let speed = Vec2::::from(velocity).magnitude(); *rate = 1.0; - let speednorm = (speed / 9.4).powf(0.6); let lab: f32 = 0.8; let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * 1.6 * lab + PI * 1.4).sin()).powi(2))) .sqrt()) * ((acc_vel * 1.6 * lab + PI * 1.4).sin()); - let footrotr = ((1.0 / (0.5 + (0.5) * ((acc_vel * 1.6 * lab + PI * 0.4).sin()).powi(2))) .sqrt()) * ((acc_vel * 1.6 * lab + PI * 0.4).sin()); - let shorte = ((1.0 / (0.8 + 0.2 * ((acc_vel * lab * 1.6).sin()).powi(2))).sqrt()) - * ((acc_vel * lab * 1.6).sin()); - let foothoril = (acc_vel * 2.2 * lab + PI * 1.45).sin(); let foothorir = (acc_vel * 2.2 * lab + PI * (0.45)).sin(); - let footvertl = (acc_vel * 1.6 * lab).sin(); - let footvertr = (acc_vel * 1.6 * lab + PI).sin(); - let footvertsl = (acc_vel * 1.6 * lab).sin(); - let footvertsr = (acc_vel * 1.6 * lab + PI * 0.5).sin(); - let shortalt = (acc_vel * lab * 2.2 + PI / 1.0).sin(); let short = ((5.0 / (1.5 + 3.5 * ((acc_vel * lab * 1.6).sin()).powi(2))).sqrt()) @@ -98,16 +64,10 @@ impl Animation for WallrunAnimation { next.belt.orientation = Quaternion::rotation_x(0.3); next.shorts.orientation = Quaternion::rotation_x(0.5); - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + shortalt * 0.0); - // - - next.shoulder_l.position = Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); next.shoulder_l.orientation = Quaternion::rotation_x(short * 0.15); - next.shoulder_r.position = Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2); next.shoulder_r.orientation = Quaternion::rotation_x(short * -0.15); if wall.map_or(false, |e| e.y > 0.5) { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index ff4cd12dec..99a87ef74f 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1712,18 +1712,11 @@ impl FigureMgr { skeleton_attr, ) }, - CharacterState::Wallrun(data) => { + CharacterState::Wallrun { .. } => { anim::character::WallrunAnimation::update_skeleton( &target_base, ( - active_tool_kind, - second_tool_kind, - hands, - rel_vel, ori * anim::vek::Vec3::::unit_y(), - state.last_ori * anim::vek::Vec3::::unit_y(), - time, - rel_avg_vel, state.acc_vel, wall_dir, ),