001/** 002 * Copyright (c) 2008-2014 Ardor Labs, Inc. 003 * 004 * This file is part of Ardor3D. 005 * 006 * Ardor3D is free software: you can redistribute it and/or modify it 007 * under the terms of its license which may be found in the accompanying 008 * LICENSE file or at <http://www.ardor3d.com/LICENSE>. 009 */ 010 011package com.ardor3d.extension.model.md3; 012 013/** 014 * header of MD3: http://en.wikipedia.org/wiki/MD3_%28file_format%29#MD3_header 015 */ 016final class Md3Header { 017 /** identifier of the file: magic number: "IDP3" */ 018 final int _magic; 019 /** version number of the file */ 020 final int _version; 021 /** name, usually its pathname in the PK3. ASCII character string, NULL-terminated (C-style) */ 022 final String _name; 023 /** flags, unused yet */ 024 final int _flags; 025 /** Number of Frame objects, with a maximum of MD3_MAX_FRAMES. Current value of MD3_MAX_FRAMES is 1024. */ 026 final int _numFrames; 027 /** 028 * Number of Tag objects, with a maximum of MD3_MAX_TAGS. Current value of MD3_MAX_TAGS is 16. There is one set of 029 * tags per frame so the total number of tags to read is (NUM_TAGS * NUM_FRAMES). 030 */ 031 final int _numTags; 032 /** Number of Surface objects, with a maximum of MD3_MAX_SURFACES. Current value of MD3_MAX_SURFACES is 32. */ 033 final int _numSurfaces; 034 /** Number of Skin objects, unused */ 035 final int _numSkins; 036 /** 037 * Relative offset from start of MD3 object where Frame objects start. The Frame objects are written sequentially, 038 * that is, when you read one Frame object, you do not need to seek() for the next object. 039 */ 040 final int _offsetFrame; 041 /** Relative offset from start of MD3 where Tag objects start. Similarly written sequentially. */ 042 final int _offsetTag; 043 /** Relative offset from start of MD3 where Surface objects start. Again, written sequentially. */ 044 final int _offsetSurface; 045 /** Relative offset from start of MD3 to the end of the MD3 object */ 046 final int _offsetEnd; 047 048 Md3Header(final int magic, final int version, final String name, final int flags, final int numFrames, 049 final int numTags, final int numSurfaces, final int numSkins, final int offsetFrame, final int offsetTag, 050 final int offsetSurface, final int offsetEnd) { 051 super(); 052 _magic = magic; 053 _version = version; 054 _name = name; 055 _flags = flags; 056 _numFrames = numFrames; 057 _numTags = numTags; 058 _numSurfaces = numSurfaces; 059 _numSkins = numSkins; 060 _offsetFrame = offsetFrame; 061 _offsetTag = offsetTag; 062 _offsetSurface = offsetSurface; 063 _offsetEnd = offsetEnd; 064 } 065}