From 969dddf9423b3738ce9b6527f785e643bf8cd6e5 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Thu, 20 Mar 2014 08:02:04 +0100 Subject: Fixes a regression found by the JGO member orange451 http://www.java-gaming.org/index.php?action=profile;u=49424 The tags of all frames weren't loaded, only 'numTags' tags were loaded --- .../com/ardor3d/extension/model/md3/Md3Importer.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'ardor3d-extras') diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Importer.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Importer.java index c86eada..5d64642 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Importer.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Importer.java @@ -106,16 +106,18 @@ public class Md3Importer { } // Parse out tags - final Md3Tag[] tags = new Md3Tag[header._numTags]; + final Md3Tag[][] tags = new Md3Tag[header._numFrames][header._numTags]; bis.seek(header._offsetTag); final Vector3 origin = new Vector3(); final Matrix3 axis = new Matrix3(); - for (int i = 0; i < header._numTags; i++) { - final String name = bis.readString(64); - origin.set(bis.readFloat(), bis.readFloat(), bis.readFloat()); - axis.set(bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat(), - bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat()); - tags[i] = new Md3Tag(name, origin, axis); + for (int i = 0; i < header._numFrames; i++) { + for (int j = 0; j < header._numTags; j++) { + final String name = bis.readString(64).trim(); + origin.set(bis.readFloat(), bis.readFloat(), bis.readFloat()); + axis.set(bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat(), + bis.readFloat(), bis.readFloat(), bis.readFloat(), bis.readFloat()); + tags[i][j] = new Md3Tag(name, origin, axis); + } } // Parse out surfaces -- cgit v1.2.3