CAR Format

From ModdingWiki
Jump to navigation Jump to search
CAR Format
Format type3D Model
Model typePolygon
Maximum number of polygons400
Maximum number of vertices938
Games

The CAR Format is used by Chasm: The Rift to store most of the game's monsters and the player.

The data in the CAR is a 0x66 bytes header followed by 3O Format file content

Offset Type Description
0x0000 Array Polygon array.
0x3200 Array Vertex array.
0x4800 UINT16LE[20] Animations array
0x4828 UINT16LE[3][2] Submodel animations array
0x4834 UINT16LE[9] Unknown0 array // 6, 7, 8 - gibs type
0x4846 UINT16LE[7] Sounds array
0x4854 UINT16LE[9] Unknown1 array // 0 - always zero maybe 1-8 values like 64, 96, 128 etc.
0x486A UINT16LE Texture texels
0x486C UINT16LE Textures array

out_model.texture_size[0u] = 64;
out_model.texture_size[1u] = Texture texels / 64;
out_model.texture_data.resize( Texture texels );
std::memcpy(out_model.texture_data.data(), model_file.data() + 0x486C, Texture texels );
const CARHeader* const header= reinterpret_cast<const CARHeader*>( model_file.data() );