diff options
author | PilzAdam <adam-k@outlook.com> | 2012-11-10 10:33:16 -0800 |
---|---|---|
committer | PilzAdam <adam-k@outlook.com> | 2012-11-10 10:33:16 -0800 |
commit | 1db033478797f0c98afa53896fd7767d7566d69e (patch) | |
tree | b30bd3f9aed9a6a10c5800dc8483940e77a4cc61 /src/camera.cpp | |
parent | 5f1d3ad754e66144aaee2dcd2153db125195e9cc (diff) | |
parent | 6e2ba111afe3de84c871b494397dc40ad4d44bfa (diff) | |
download | minetest-1db033478797f0c98afa53896fd7767d7566d69e.tar.gz minetest-1db033478797f0c98afa53896fd7767d7566d69e.tar.bz2 minetest-1db033478797f0c98afa53896fd7767d7566d69e.zip |
Merge pull request #286 from PilzAdam/digging_animation
Add jordan4ibanez' better digging animation
Diffstat (limited to 'src/camera.cpp')
-rw-r--r-- | src/camera.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/camera.cpp b/src/camera.cpp index f87f660e9..43f26cd8f 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -189,7 +189,7 @@ void Camera::step(f32 dtime) if (m_digging_button != -1) { - f32 offset = dtime * 3.5; + f32 offset = dtime * 4.5; float m_digging_anim_was = m_digging_anim; m_digging_anim += offset; if (m_digging_anim >= 1) @@ -336,13 +336,13 @@ void Camera::update(LocalPlayer* player, f32 frametime, v2u32 screensize, if (m_digging_button != -1) { f32 digfrac = m_digging_anim; - wield_position.X -= 30 * sin(pow(digfrac, 0.8f) * M_PI); - wield_position.Y += 15 * sin(digfrac * 2 * M_PI); - wield_position.Z += 5 * digfrac; - + wield_position.X -= 50 * sin(pow(digfrac, 0.8f) * M_PI); + wield_position.Y += 24 * sin(digfrac * 1.8 * M_PI); + wield_position.Z += 25 * 0.5; + // Euler angles are PURE EVIL, so why not use quaternions? core::quaternion quat_begin(wield_rotation * core::DEGTORAD); - core::quaternion quat_end(v3f(90, -10, -130) * core::DEGTORAD); + core::quaternion quat_end(v3f(80, 30, 100) * core::DEGTORAD); core::quaternion quat_slerp; quat_slerp.slerp(quat_begin, quat_end, sin(digfrac * M_PI)); quat_slerp.toEuler(wield_rotation); |