aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-extras
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2014-03-20 08:02:04 +0100
committerJulien Gouesse <[email protected]>2014-03-20 08:02:04 +0100
commit969dddf9423b3738ce9b6527f785e643bf8cd6e5 (patch)
tree4e339b60ed348fbe4b32f953688d749e39ec3493 /ardor3d-extras
parent8e256dabec13303ab5e04fe150c9daa08c5285c1 (diff)
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
Diffstat (limited to 'ardor3d-extras')
-rw-r--r--ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Importer.java16
1 files changed, 9 insertions, 7 deletions
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