#pragma once #include "shared.hpp" #include "vector.hpp" #include "transform_matrix.hpp" #include "compressed.hpp" namespace ace { namespace p3d { class proxy { public: proxy(); proxy(std::istream &, uint32_t); std::string name; //"\ca\a10\agm65" (.p3d is implied) < proxy_p; class stage_texture { public: stage_texture(); stage_texture(std::istream &, uint32_t); uint32_t filter; std::string file; uint32_t transform_id; bool wtf; }; typedef std::shared_ptr stage_texture_p; class material { public: material(); material(std::istream &, uint32_t); std::string name; std::string surface; uint32_t render_flags; uint32_t type; float emissive[4]; float ambient[4]; float diffuse[4]; float forced_diffuse[4]; float specular[4]; float specular_2[4]; float specular_power; uint32_t pixel_shader; uint32_t vertex_shader; uint32_t u_long_1; uint32_t an_index; uint32_t u_long_2; uint32_t u_long_3; std::vector texture_stages; std::vector> transform_stages; }; typedef std::shared_ptr material_p; class edge_set { public: std::vector mlod; std::vector vertex; }; class face { public: face(); face(std::istream &, uint32_t); uint32_t flags; //ODOL7 ONLY see P3D Point and Face Flags uint16_t texture; //ODOL7 ONLY uint8_t type; // 3==Triangle or 4==Box std::vector vertex_table; }; typedef std::shared_ptr face_p; class section { public: section(); section(std::istream &, uint32_t); uint32_t face_offsets[2]; // from / to region of LodFaces used uint32_t material_offsets[2]; // ODOLV4x only uint32_t common_points_user_value; // see P3D Point and Face Flags // 0xC9 -> LodPoints 0x0C90003F // LodPointFlags are in a separate table for arma, and in the VertexTable for ofp (odol7) uint16_t common_texture; // uint32_t common_face_flags; // see P3D Point and Face Flags ///////// // ODOLV4x only////// int32_t material_index; //if MaterialIndex == -1 // { // byte ExtraByte; //} uint8_t extra; uint32_t u_long_1; // ???? New in version 68!!! uint32_t u_long_2; // generally 2 float u_float_resolution_1; float u_float_resolution_2; // generally 1000.0 }; typedef std::shared_ptr
section_p; class named_selection { public: named_selection(); named_selection(std::istream &, uint32_t); std::string name; // "rightleg" or "neck" eg compressed faces; // indexing into the LodFaces Table compressed face_weights; uint32_t Always0Count; bool is_sectional; //Appears in the sections[]= list of a model.cfg compressed sections; //IsSectional must be true. Indexes into the LodSections Table compressed vertex_table; compressed texture_weights; // if present they correspond to (are exentsions of) the VertexTableIndexes }; typedef std::shared_ptr named_selection_p; class frame { public: frame(); frame(std::istream &, uint32_t); float time; std::vector> bone_positions; }; typedef std::shared_ptr frame_p; class uv { public: uv(); uv(std::istream &, uint32_t); float uv_scale[4]; compressed data; }; typedef std::shared_ptr uv_p; class c_vertex_table { public: c_vertex_table(); c_vertex_table(std::istream &, uint32_t, uint32_t); uint32_t size; compressed point_flags; // Potentially compressed std::vector uvsets; compressed> points; compressed> normals; compressed> minmax; compressed> vert_properties; compressed> unknown_vtx; /* uint32_t NoOfPoints; uint32_t nNormals; (A2)LodNormals LodNormals[nNormals]; uint32_t nMinMax; (A2)LodMinMax MinMax[nMinMax]; //optional uint32_t nProperties; VertProperty VertProperties[nProperties]; //optional related to skeleton uint32_t Count; UnknownVtxStruct UnknownVtxStructs[Count]; //optional */ }; typedef std::shared_ptr vertex_table_p; class lod { public: lod(); lod(std::istream &, uint32_t, uint32_t); ~lod(); uint32_t id; std::vector proxies; // see P3D Lod Proxies std::vector items; // potentially compressed std::vector> bone_links; uint32_t point_count; uint32_t u_float_1; float u_float_2; float u_float_3; ace::vector3 min_pos; ace::vector3 max_pos; ace::vector3 autocenter_pos; float sphere; // same as geo or mem values in modelinfo, if this lod is geo or memlod of course std::vector textures; //"ca\characters\hhl\hhl_01_co.paa" std::vector materials; edge_set edges; uint32_t u_count; uint32_t offset_sections; // see below uint16_t u_short_1; uint32_t faces_allocation_size; std::vector faces; std::vector sections; std::vector selections; std::map named_properties; std::vector frames; uint32_t icon_color; uint32_t selected_color; uint32_t u_residue; uint8_t u_byte_1; uint32_t vertex_table_size; vertex_table_p vertices; /* //(including these 4 bytes) LodPointFlags LodPointFlags; // Potentially compressed VertexTable VertexTable;*/ }; typedef std::shared_ptr lod_p; } }