diff --git a/HeartLibrary/src/main/java/jme3utilities/MyAnimation.java b/HeartLibrary/src/main/java/jme3utilities/MyAnimation.java index a290a6d..ecb8014 100644 --- a/HeartLibrary/src/main/java/jme3utilities/MyAnimation.java +++ b/HeartLibrary/src/main/java/jme3utilities/MyAnimation.java @@ -734,6 +734,26 @@ public static boolean isJointTrack(AnimTrack track) { return result; } + /** + * Test whether the specified AnimTrack targets a Spatial. + * + * @param track the AnimTrack to test (may be null, unaffected) + * @return true if it targets a Spatial, otherwise false + */ + public static boolean isSpatialTrack(AnimTrack track) { + boolean result = false; + + if (track instanceof TransformTrack) { + TransformTrack transformTrack = (TransformTrack) track; + HasLocalTransform target = transformTrack.getTarget(); + if (target instanceof Spatial) { + result = true; + } + } + + return result; + } + /** * Create a BoneTrack consisting of a single keyframe at t=0. *