From 610ac6ae24617cbca7ab299d950b2a7d8e097387 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Fri, 5 Dec 2014 22:04:26 -0500 Subject: [PATCH] Make sure Mesh.isAnimated() works for hardware skinning --- jme3-core/src/main/java/com/jme3/scene/Mesh.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/scene/Mesh.java b/jme3-core/src/main/java/com/jme3/scene/Mesh.java index 34004c153..5d0e8dcec 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Mesh.java +++ b/jme3-core/src/main/java/com/jme3/scene/Mesh.java @@ -1349,9 +1349,17 @@ public class Mesh implements Savable, Cloneable { return buffersList; } + /** + * Determines if the mesh uses bone animation. + * + * A mesh uses bone animation if it has bone index / weight buffers + * such as {@link Type#BoneIndex} or {@link Type#HWBoneIndex}. + * + * @return true if the mesh uses bone animation, false otherwise + */ public boolean isAnimated() { - //TODO this won't work once we have pose animations, we should find a better way to check for animation - return getBuffer(Type.BindPosePosition) != null && getBuffer(Type.BoneIndex) != null && getBuffer(Type.BoneWeight) != null; + return getBuffer(Type.BoneIndex) != null || + getBuffer(Type.HWBoneIndex) != null; }