- Timestamp:
- 08/16/16 19:45:45 (9 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/engine/model_manager.cc
r512 r515 58 58 if ( table.is_string( "material" ) ) 59 59 cmaterial = m_rm->get< material >( table.get_string128( "material" ) ); 60 61 if ( table.is_string( "tag" ) ) 62 node->tag = table.get_string32( "tag" ); 60 63 61 64 if ( table.has_field( "path" ) ) -
trunk/src/engine/particle_engine.cc
r501 r515 605 605 } 606 606 607 void nv::particle_engine::update( particle_system system, float dtime)607 void nv::particle_engine::update( particle_system system, transform model, float dtime ) 608 608 { 609 609 particle_system_info* info = m_systems.get( system ); … … 621 621 update_emmiters( info, dtime ); 622 622 destroy_particles( info, dtime ); 623 create_particles( info, dtime );623 create_particles( info, model, dtime ); 624 624 update_particles( info, dtime ); 625 625 … … 776 776 } 777 777 778 void nv::particle_engine::create_particles( particle_system_info* info, float dtime )778 void nv::particle_engine::create_particles( particle_system_info* info, transform model, float dtime ) 779 779 { 780 780 uint32 ecount = info->data->emmiter_count; … … 782 782 783 783 random& r = random::get(); 784 vec3 source; 785 mat3 orient; 786 // bool local = info->data->local; 784 bool local = model.is_identity(); 787 785 // if ( !local ) 788 786 // { … … 806 804 edata.emmiter_func( &(info->data->emmiters[i]), &pinfo, 1 ); 807 805 pinfo.position = vec3(); 808 // if ( !local ) pinfo.position = orient * pinfo.position + source;809 806 pinfo.position+= edata.position; 810 pinfo.color = edata.color_min == edata.color_max ? 807 if ( !local ) 808 pinfo.position = pinfo.position * model; 809 pinfo.color = edata.color_min == edata.color_max ? 811 810 edata.color_min : r.range( edata.color_min, edata.color_max ); 812 811 pinfo.size = edata.size_min == edata.size_max ? … … 829 828 float sin_theta = sqrt(1.0f - cos_theta * cos_theta ); 830 829 float phi = r.frange( 0.0f, 2* math::pi<float>() ); 831 pinfo.velocity = orient*830 pinfo.velocity = model.get_orientation() * 832 831 ( edata.odir * ( cos(phi) * sin_theta ) + 833 832 edata.cdir * ( sin(phi)*sin_theta ) + -
trunk/src/gl/gl_context.cc
r505 r515 964 964 glTexParameteri( gl_type, GL_TEXTURE_WRAP_S, GLint( nv::sampler_wrap_to_enum( asampler.wrap_s ) ) ); 965 965 glTexParameteri( gl_type, GL_TEXTURE_WRAP_T, GLint( nv::sampler_wrap_to_enum( asampler.wrap_t ) ) ); 966 glTexParameteri( gl_type, GL_TEXTURE_WRAP_R, GLint( nv::sampler_wrap_to_enum( asampler.wrap_r ) ) ); 966 967 967 968 if ( is_depth ) -
trunk/src/lua/lua_state.cc
r511 r515 344 344 } 345 345 346 347 nv::string32 nv::lua::table_guard::get_string32( string_view element, string_view defval /*= string_view() */ ) 348 { 349 lua_getfield( m_state, -1, element.data() ); 350 size_t l = 0; 351 const char* str = nullptr; 352 if ( lua_type( m_state, -1 ) == LUA_TSTRING ) 353 { 354 str = lua_tolstring( m_state, -1, &l ); 355 } 356 else 357 { 358 l = defval.size(); 359 str = defval.data(); 360 } 361 string32 result( str, l ); 362 lua_pop( m_state, 1 ); 363 return result; 364 } 346 365 347 366 char lua::table_guard::get_char( string_view element, char defval /*= "" */ )
Note: See TracChangeset
for help on using the changeset viewer.