From 435f2d4d05da30f3a3a6650fac611292e5f2d42e Mon Sep 17 00:00:00 2001 From: Nehon Date: Sun, 17 Dec 2017 18:46:46 +0100 Subject: [PATCH] Prevents NaN time when animation length is 0 (case of a pose) --- .../src/main/java/com/jme3/animation/AnimationUtils.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/animation/AnimationUtils.java b/jme3-core/src/main/java/com/jme3/animation/AnimationUtils.java index 9cbe5d7dd..2254638e7 100644 --- a/jme3-core/src/main/java/com/jme3/animation/AnimationUtils.java +++ b/jme3-core/src/main/java/com/jme3/animation/AnimationUtils.java @@ -31,10 +31,6 @@ */ package com.jme3.animation; -import static com.jme3.animation.LoopMode.Cycle; -import static com.jme3.animation.LoopMode.DontLoop; -import static com.jme3.animation.LoopMode.Loop; - /** * * @author Nehon @@ -52,7 +48,7 @@ public class AnimationUtils { * @return */ public static float clampWrapTime(float time, float duration, LoopMode loopMode){ - if (time == 0) { + if (time == 0 || duration == 0) { return 0; // prevent division by 0 errors } switch (loopMode) {