Changeset 430 for trunk/src/gfx
- Timestamp:
- 07/20/15 15:24:51 (10 years ago)
- Location:
- trunk/src/gfx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/keyframed_mesh.cc
r428 r430 13 13 using namespace nv; 14 14 15 nv::keyframed_mesh::keyframed_mesh( context* a_context, const mesh_data* a_data, const mesh_nodes_data* a_tag_map )15 nv::keyframed_mesh::keyframed_mesh( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ) 16 16 : animated_mesh() 17 17 , m_context( a_context ) 18 , m_mesh_data( a_data )19 18 , m_tag_map( a_tag_map ) 20 19 , m_last_frame( 0 ) … … 23 22 , m_active( false ) 24 23 { 25 m_index_count = m_mesh_data->get_channel_size( slot::INDEX );26 m_vertex_count = m_mesh_data->get_channel_size<vertex_t>();27 uint32 pos_size = m_mesh_data->get_channel_size<vertex_pnt>();24 m_index_count = a_data->get_channel_size( slot::INDEX ); 25 m_vertex_count = a_data->get_channel_size<vertex_t>(); 26 uint32 pos_size = a_data->get_channel_size<vertex_pnt>(); 28 27 if ( pos_size == 0 ) 29 28 { 30 pos_size = m_mesh_data->get_channel_size<vertex_pn>();29 pos_size = a_data->get_channel_size<vertex_pn>(); 31 30 m_has_tangent = false; 32 31 m_vsize = sizeof( vertex_pn ); … … 127 126 } 128 127 129 nv::keyframed_mesh_gpu::keyframed_mesh_gpu( context* a_context, const mesh_data* a_data, const mesh_nodes_data* a_tag_map )128 nv::keyframed_mesh_gpu::keyframed_mesh_gpu( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ) 130 129 : keyframed_mesh( a_context, a_data, a_tag_map ) 131 130 , m_loc_next_position( -1 ) … … 186 185 } 187 186 188 nv::keyframed_mesh_cpu::keyframed_mesh_cpu( context* a_context, const mesh_data* a_data, const mesh_nodes_data* a_tag_map )187 nv::keyframed_mesh_cpu::keyframed_mesh_cpu( context* a_context, const data_channel_set* a_data, const mesh_nodes_data* a_tag_map ) 189 188 : keyframed_mesh( a_context, a_data, a_tag_map ) 190 189 { … … 194 193 m_context->add_vertex_buffers( m_va, m_pbuffer, vchannel->descriptor() ); 195 194 196 buffer vb = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * sizeof( vec2 ), m_mesh_data->get_channel_data<vertex_t>() );197 m_context->add_vertex_buffers( m_va, vb, m_mesh_data->get_channel<vertex_t>()->descriptor() );198 199 const raw_data_channel* index_channel = m_mesh_data->get_channel( slot::INDEX );195 buffer vb = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * sizeof( vec2 ), a_data->get_channel_data<vertex_t>() ); 196 m_context->add_vertex_buffers( m_va, vb, a_data->get_channel<vertex_t>()->descriptor() ); 197 198 const raw_data_channel* index_channel = a_data->get_channel( slot::INDEX ); 200 199 buffer ib = m_context->get_device()->create_buffer( INDEX_BUFFER, STATIC_DRAW, index_channel->raw_size(), index_channel->raw_data() ); 201 200 m_context->set_index_buffer( m_va, ib, index_channel->descriptor()[0].etype, true ); 202 201 203 202 m_data = new uint8[ m_vertex_count * m_vsize ]; 203 204 m_model_data = vchannel->raw_data(); 204 205 } 205 206 … … 210 211 if ( m_has_tangent ) 211 212 { 212 const vertex_pnt* data = m_mesh_data->get_channel_data<vertex_pnt>();213 const vertex_pnt* data = reinterpret_cast< const vertex_pnt* >( m_model_data ); 213 214 const vertex_pnt* prev = data + m_vertex_count * m_last_frame; 214 215 const vertex_pnt* next = data + m_vertex_count * m_next_frame; … … 223 224 else 224 225 { 225 const vertex_pn* data = m_mesh_data->get_channel_data<vertex_pn>();226 const vertex_pn* data = reinterpret_cast< const vertex_pn* >( m_model_data ); 226 227 const vertex_pn* prev = data + m_vertex_count * m_last_frame; 227 228 const vertex_pn* next = data + m_vertex_count * m_next_frame; -
trunk/src/gfx/mesh_creator.cc
r428 r430 385 385 386 386 387 bool nv::mesh_data_creator::is_same_format( mesh_data* other )387 bool nv::mesh_data_creator::is_same_format( data_channel_set* other ) 388 388 { 389 389 if ( m_data->size() != other->size() ) return false; … … 396 396 } 397 397 398 void nv::mesh_data_creator::merge( mesh_data* other )398 void nv::mesh_data_creator::merge( data_channel_set* other ) 399 399 { 400 400 if ( !is_same_format( other ) ) return; -
trunk/src/gfx/skeletal_mesh.cc
r428 r430 11 11 #include "nv/stl/unordered_map.hh" 12 12 13 nv::skeletal_mesh_cpu::skeletal_mesh_cpu( context* a_context, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )13 nv::skeletal_mesh_cpu::skeletal_mesh_cpu( context* a_context, const data_channel_set* a_mesh_data, const mesh_nodes_data* bones ) 14 14 : skeletal_mesh( a_context ) 15 15 { … … 234 234 } 235 235 236 nv::skeletal_mesh_gpu::skeletal_mesh_gpu( context* a_context, const mesh_data* a_mesh, const mesh_nodes_data* a_bone_data )236 nv::skeletal_mesh_gpu::skeletal_mesh_gpu( context* a_context, const data_channel_set* a_mesh, const mesh_nodes_data* a_bone_data ) 237 237 : skeletal_mesh( a_context ), m_bone_data( a_bone_data ), m_transform( nullptr ) 238 238 {
Note: See TracChangeset
for help on using the changeset viewer.