diff options
Diffstat (limited to 'src/3rdparty/assimp/code/assbin_chunks.h')
-rw-r--r-- | src/3rdparty/assimp/code/assbin_chunks.h | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/src/3rdparty/assimp/code/assbin_chunks.h b/src/3rdparty/assimp/code/assbin_chunks.h index 9a2333700..15e4af5e7 100644 --- a/src/3rdparty/assimp/code/assbin_chunks.h +++ b/src/3rdparty/assimp/code/assbin_chunks.h @@ -1,11 +1,10 @@ - #ifndef INCLUDED_ASSBIN_CHUNKS_H #define INCLUDED_ASSBIN_CHUNKS_H #define ASSBIN_VERSION_MAJOR 1 #define ASSBIN_VERSION_MINOR 0 -/** +/** @page assfile .ASS File formats @section over Overview @@ -21,7 +20,7 @@ the 'aiScene' data structure returned by the APIs. The focus for the binary form (<tt>.assbin</tt>) is fast loading. Optional deflate compression helps reduce file size. The XML flavour, <tt>.assxml</tt> or simply .xml, is just a plain-to-xml conversion of aiScene. -ASSBIN is Assimp's binary interchange format. assimp_cmd (<tt><root>/tools/assimp_cmd</tt>) is able to +ASSBIN is Assimp's binary interchange format. assimp_cmd (<tt><root>/tools/assimp_cmd</tt>) is able to write it and the core library provides a loader for it. @section assxml XML File format @@ -47,7 +46,7 @@ in <tt><root>/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo ------------------------------------------------------------------------------- ---------------------- -| Header (500 bytes) | +| Header (512 bytes) | ---------------------- | Variable chunks | ---------------------- @@ -56,76 +55,77 @@ in <tt><root>/tools/assimp_cmd/WriteDumb.cpp</tt> (yes, the 'b' is no typo 2. Definitions: ------------------------------------------------------------------------------- -integer is four bytes wide, stored in little-endian byte order. -short is two bytes wide, stored in little-endian byte order. -byte is a single byte. +integer is four bytes wide, stored in little-endian byte order. +short is two bytes wide, stored in little-endian byte order. +byte is a single byte. string is an integer n followed by n UTF-8 characters, not terminated by zero -float is an IEEE 754 single-precision floating-point value -double is an IEEE 754 double-precision floating-point value +float is an IEEE 754 single-precision floating-point value +double is an IEEE 754 double-precision floating-point value t[n] is an array of n elements of type t ------------------------------------------------------------------------------- 2. Header: ------------------------------------------------------------------------------- -byte[44] Magic identification string for ASSBIN files. +byte[44] Magic identification string for ASSBIN files. 'ASSIMP.binary' -integer Major version of the Assimp library which wrote the file -integer Minor version of the Assimp library which wrote the file +integer Major version of the Assimp library which wrote the file +integer Minor version of the Assimp library which wrote the file match these against ASSBIN_VERSION_MAJOR and ASSBIN_VERSION_MINOR -integer SVN revision of the Assimp library (intended for our internal +integer SVN revision of the Assimp library (intended for our internal debugging - if you write Ass files from your own APPs, set this value to 0. -integer Assimp compile flags +integer Assimp compile flags -short 0 for normal files, 1 for shortened dumps for regression tests +short 0 for normal files, 1 for shortened dumps for regression tests these should have the file extension assbin.regress short 1 if the data after the header is compressed with the DEFLATE algorithm, 0 for uncompressed files. For compressed files, the first integer after the header is always the uncompressed data size - -byte[256] Zero-terminated source file name, UTF-8 -byte[128] Zero-terminated command line parameters passed to assimp_cmd, UTF-8 -byte[64] Reserved for future use +byte[256] Zero-terminated source file name, UTF-8 +byte[128] Zero-terminated command line parameters passed to assimp_cmd, UTF-8 + +byte[64] Reserved for future use ---> Total length: 512 bytes ------------------------------------------------------------------------------- 3. Chunks: ------------------------------------------------------------------------------- -integer Magic chunk ID (ASSBIN_CHUNK_XXX) -integer Chunk data length, in bytes +integer Magic chunk ID (ASSBIN_CHUNK_XXX) +integer Chunk data length, in bytes (unknown chunks are possible, a good reader skips over them) + (chunk-data-length does not include the first two integers) -byte[n] length-of-chunk bytes of data, depending on the chunk type +byte[n] chunk-data-length bytes of data, depending on the chunk type Chunks can contain nested chunks. Nested chunks are ALWAYS at the end of the chunk, -their size is included in length-of-chunk. +their size is included in chunk-data-length. The chunk layout for all ASSIMP data structures is derived from their C declarations. The general 'rule' to get from Assimp headers to the serialized layout is: - 1. POD members (i.e. aiMesh::mPrimitiveTypes, aiMesh::mNumVertices), + 1. POD members (i.e. aiMesh::mPrimitiveTypes, aiMesh::mNumVertices), in order of declaration. - 2. Array-members (aiMesh::mFaces, aiMesh::mVertices, aiBone::mWeights), + 2. Array-members (aiMesh::mFaces, aiMesh::mVertices, aiBone::mWeights), in order of declaration. - 2. Object array members (i.e aiMesh::mBones, aiScene::mMeshes) are stored in + 2. Object array members (i.e aiMesh::mBones, aiScene::mMeshes) are stored in subchunks directly following the data written in 1.) and 2.) - Of course, there are some exceptions to this general order: + Of course, there are some exceptions to this general order: [[aiScene]] - The root node holding the scene structure is naturally stored in - a ASSBIN_CHUNK_AINODE subchunk following 1.) and 2.) (which is - empty for aiScene). + a ASSBIN_CHUNK_AINODE subchunk following 1.) and 2.) (which is + empty for aiScene). [[aiMesh]] @@ -133,18 +133,18 @@ The general 'rule' to get from Assimp headers to the serialized layout is: [number of used uv channels times] integer mNumUVComponents[n] - float mTextureCoords[n][mNumUVComponents[n]] + float mTextureCoords[n][3] - -> more than AI_MAX_TEXCOORD_CHANNELS can be stored. This allows Assimp - builds with different settings for AI_MAX_TEXCOORD_CHANNELS to exchange - data. Unlike the in-memory format, only the used components of the - UV coordinates are written to disk. If mNumUVComponents[0] is 1, the - corresponding mTextureCoords array consists of mNumTextureCoords*1 - single floats. + -> more than AI_MAX_TEXCOORD_CHANNELS can be stored. This allows Assimp + builds with different settings for AI_MAX_TEXCOORD_CHANNELS to exchange + data. + -> the on-disk format always uses 3 floats to write UV coordinates. + If mNumUVComponents[0] is 1, the corresponding mTextureCoords array + consists of 3 floats. - - The array member block of aiMesh is prefixed with an integer that specifies - the kinds of vertex components actually present in the mesh. This is a - bitwise combination of the ASSBIN_MESH_HAS_xxx constants. + - The array member block of aiMesh is prefixed with an integer that specifies + the kinds of vertex components actually present in the mesh. This is a + bitwise combination of the ASSBIN_MESH_HAS_xxx constants. [[aiFace]] @@ -171,26 +171,26 @@ The general 'rule' to get from Assimp headers to the serialized layout is: #define ASSBIN_HEADER_LENGTH 512 // these are the magic chunk identifiers for the binary ASS file format -#define ASSBIN_CHUNK_AICAMERA 0x1234 -#define ASSBIN_CHUNK_AILIGHT 0x1235 -#define ASSBIN_CHUNK_AITEXTURE 0x1236 -#define ASSBIN_CHUNK_AIMESH 0x1237 -#define ASSBIN_CHUNK_AINODEANIM 0x1238 -#define ASSBIN_CHUNK_AISCENE 0x1239 -#define ASSBIN_CHUNK_AIBONE 0x123a -#define ASSBIN_CHUNK_AIANIMATION 0x123b -#define ASSBIN_CHUNK_AINODE 0x123c -#define ASSBIN_CHUNK_AIMATERIAL 0x123d -#define ASSBIN_CHUNK_AIMATERIALPROPERTY 0x123e - -#define ASSBIN_MESH_HAS_POSITIONS 0x1 -#define ASSBIN_MESH_HAS_NORMALS 0x2 -#define ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS 0x4 -#define ASSBIN_MESH_HAS_TEXCOORD_BASE 0x100 -#define ASSBIN_MESH_HAS_COLOR_BASE 0x10000 - -#define ASSBIN_MESH_HAS_TEXCOORD(n) (ASSBIN_MESH_HAS_TEXCOORD_BASE << n) -#define ASSBIN_MESH_HAS_COLOR(n) (ASSBIN_MESH_HAS_COLOR_BASE << n) +#define ASSBIN_CHUNK_AICAMERA 0x1234 +#define ASSBIN_CHUNK_AILIGHT 0x1235 +#define ASSBIN_CHUNK_AITEXTURE 0x1236 +#define ASSBIN_CHUNK_AIMESH 0x1237 +#define ASSBIN_CHUNK_AINODEANIM 0x1238 +#define ASSBIN_CHUNK_AISCENE 0x1239 +#define ASSBIN_CHUNK_AIBONE 0x123a +#define ASSBIN_CHUNK_AIANIMATION 0x123b +#define ASSBIN_CHUNK_AINODE 0x123c +#define ASSBIN_CHUNK_AIMATERIAL 0x123d +#define ASSBIN_CHUNK_AIMATERIALPROPERTY 0x123e + +#define ASSBIN_MESH_HAS_POSITIONS 0x1 +#define ASSBIN_MESH_HAS_NORMALS 0x2 +#define ASSBIN_MESH_HAS_TANGENTS_AND_BITANGENTS 0x4 +#define ASSBIN_MESH_HAS_TEXCOORD_BASE 0x100 +#define ASSBIN_MESH_HAS_COLOR_BASE 0x10000 + +#define ASSBIN_MESH_HAS_TEXCOORD(n) (ASSBIN_MESH_HAS_TEXCOORD_BASE << n) +#define ASSBIN_MESH_HAS_COLOR(n) (ASSBIN_MESH_HAS_COLOR_BASE << n) #endif // INCLUDED_ASSBIN_CHUNKS_H |