From ec66c8cfbc5cf3dd7b521694d0b8c617088161aa Mon Sep 17 00:00:00 2001 From: Marc Sunet Date: Wed, 29 Aug 2012 18:47:14 +0200 Subject: Fix: animation speed now taken into account in update --- Spear.lkshw | 2 +- Spear/Render/AnimatedModel.hs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Spear.lkshw b/Spear.lkshw index b7737af..27e8748 100644 --- a/Spear.lkshw +++ b/Spear.lkshw @@ -1,7 +1,7 @@ Version of workspace file format: 1 Time of storage: - "Wed Aug 29 17:58:31 CEST 2012" + "Wed Aug 29 18:42:19 CEST 2012" Name of the workspace: "Spear" File paths of contained packages: diff --git a/Spear/Render/AnimatedModel.hs b/Spear/Render/AnimatedModel.hs index 6e3c535..552fada 100644 --- a/Spear/Render/AnimatedModel.hs +++ b/Spear/Render/AnimatedModel.hs @@ -150,13 +150,12 @@ animatedModelRenderer animSpeed modelResource = -- | Update the 'AnimatedModelRenderer'. update dt (AnimatedModelRenderer model curAnim startFrame endFrame curFrame fp s) = AnimatedModelRenderer model curAnim startFrame endFrame curFrame' fp' s - where f = fp + dt + where f = fp + dt * s nextFrame = f >= 1.0 fp' = if nextFrame then f - 1.0 else f curFrame' = if nextFrame - then - let x = curFrame + 1 - in if x > endFrame then startFrame else x + then let x = curFrame + 1 + in if x > endFrame then startFrame else x else curFrame -- cgit v1.2.3