diff options
author | Julien Gouesse <[email protected]> | 2014-02-07 19:00:59 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2014-02-07 19:00:59 +0100 |
commit | 68891c20e8b7297d339ca760b52ad6ff31e4a0cc (patch) | |
tree | 6bf615a337838d76d52e0ffb816dab080c276211 /ardor3d-extras | |
parent | f5fe0ff4465e8999fc16ac5b9fbdeb2f505b76d8 (diff) |
Adds the very first class of the MD3 importer into ardor3d-extras
Diffstat (limited to 'ardor3d-extras')
-rw-r--r-- | ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Header.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Header.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Header.java new file mode 100644 index 0000000..a7bf15d --- /dev/null +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/md3/Md3Header.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.md3; + +/** + * header of MD3: http://en.wikipedia.org/wiki/MD3_%28file_format%29#MD3_header + */ +final class Md3Header { + /** identifier of the file: magic number: "IDP3" */ + final int _magic; + /** version number of the file */ + final int _version; + /** name, usually its pathname in the PK3. ASCII character string, NULL-terminated (C-style) */ + final String _name; + /** flags, unused yet */ + final int _flags; + /** Number of Frame objects, with a maximum of MD3_MAX_FRAMES. Current value of MD3_MAX_FRAMES is 1024. */ + final int _numFrames; + /** + * Number of Tag objects, with a maximum of MD3_MAX_TAGS. Current value of MD3_MAX_TAGS is 16. There is one set of + * tags per frame so the total number of tags to read is (NUM_TAGS * NUM_FRAMES). + */ + final int _numTags; + /** Number of Surface objects, with a maximum of MD3_MAX_SURFACES. Current value of MD3_MAX_SURFACES is 32. */ + final int _numSurface; + /** Number of Skin objects, unused */ + final int _numSkins; + /** Relative offset from start of MD3 object where Frame objects start. The Frame objects are written sequentially, that is, when you read one Frame object, you do not need to seek() for the next object. */ + final int _offsetFrame; + /** Relative offset from start of MD3 where Tag objects start. Similarly written sequentially. */ + final int _offsetTag; + /** Relative offset from start of MD3 where Surface objects start. Again, written sequentially. */ + final int _offsetSurface; + /** Relative offset from start of MD3 to the end of the MD3 object */ + final int _offsetEnd; + + Md3Header(final int magic, final int version, final String name, final int flags, final int numFrames, + final int numTags, final int numSurface, final int numSkins, final int offsetFrame, final int offsetTag, + final int offsetSurface, final int offsetEnd) { + _magic = magic; + _version = version; + _name = name; + _flags = flags; + _numFrames = numFrames; + _numTags = numTags; + _numSurface = numSurface; + _numSkins = numSkins; + _offsetFrame = offsetFrame; + _offsetTag = offsetTag; + _offsetSurface = offsetSurface; + _offsetEnd = offsetEnd; + } +} |