Ignore:
Timestamp:
07/26/14 09:55:54 (11 years ago)
Author:
epyon
Message:
  • mesh_creator class, currently for transforms, later for const safety
  • pre_transform and transformation moved out of assimp_loader
  • pre_transfrom and transformation works on ANY mesh_data/mesh_nodes_data
  • cleanups
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/formats/assimp_loader.hh

    r291 r293  
    2020        {
    2121        public:
    22                 assimp_loader( const string& a_ext, const mat3& a_rotate_transform, float a_scale, bool pre_transform, uint32 a_assimp_flags = 0 );
    23                 assimp_loader( const string& a_ext, bool pre_transform, uint32 a_assimp_flags = 0 );
     22                explicit assimp_loader( const string& a_ext, uint32 a_assimp_flags = 0 );
    2423                virtual bool load( stream& source );
    2524                virtual mesh_data* release_mesh_data( size_t index = 0 );
     
    3534                bool load_bones( size_t index, std::vector< mesh_node_data >& bones );
    3635                void load_mesh_data( mesh_data* data, size_t index );
    37                 void initialize( const string& a_ext, const mat3& a_rotate_transform, float a_scale, uint32 a_assimp_flags );
    38                 sint16 load_node( uint32 anim_id, mesh_node_data* nodes, const void* vnode, sint16 this_id, sint16 parent_id, uint32& max_frames );
     36                sint16 load_node( uint32 anim_id, mesh_node_data* nodes, const void* vnode, sint16 this_id, sint16 parent_id );
    3937                uint32 count_nodes( const void* node ) const;
    40                 void create_transformed_keys( mesh_node_data* data, const void* vnode, const mesh_node_data* parent );
    41                 void create_direct_keys( mesh_node_data* data, const void* vnode );
     38                void create_keys( mesh_node_data* data, const void* vnode );
    4239
    4340                string_table_creator m_strings;
    4441                string m_ext;
    45                 mat3   m_r33;
    46                 mat3   m_ri33;
    47                 float  m_scale;
    4842                uint32 m_assimp_flags;
    4943                const void* m_scene;
    5044                size_t m_mesh_count;
    51                 bool   m_flat;
    52         };
    53 
    54         struct assimp_plain_vtx
    55         {
    56                 vec3 position;
    57                 vec3 normal;
    58                 vec2 texcoord;
    59                 vec4 tangent;
    60 
    61                 assimp_plain_vtx() {}
    62                 assimp_plain_vtx( const vec3& v, const vec2& t, const vec3& n, const vec4& g )
    63                 {
    64                         position = v;
    65                         texcoord = t;
    66                         normal   = n;
    67                         tangent  = g;
    68                 }
    69         };
    70 
    71         struct assimp_skinned_vtx
    72         {
    73                 vec3  position;
    74                 vec3  normal;
    75                 vec2  texcoord;
    76                 vec4  tangent;
    77                 ivec4 boneindex;
    78                 vec4  boneweight;
    79 
    80                 assimp_skinned_vtx() {}
    81                 assimp_skinned_vtx( const vec3& v, const vec2& t, const vec3& n, const vec4& g )
    82                 {
    83                         position = v;
    84                         texcoord = t;
    85                         normal   = n;
    86                         tangent  = g;
    87                 }
    8845        };
    8946
Note: See TracChangeset for help on using the changeset viewer.