Ignore:
Timestamp:
01/24/17 17:55:00 (8 years ago)
Author:
epyon
Message:
  • temporary_proxy implemented
  • table_guard now uses temporary_proxy as main read functionality
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/engine/ragdoll_manager.cc

    r524 r539  
    2626        NV_ASSERT_ALWAYS( m_world, "Physics world not setup in ragdoll_manager!" );
    2727        bool result = false;
    28         nv::string64 model_id = table.get_string64( "model" );
     28        nv::string64 model_id = table["model"].get_string64();
    2929        nv::resource< model > mr = m_model->get( model_id );
    3030        if ( !mr ) return false;
     
    6666        if ( auto bind_data = rbind.lock() )
    6767        {
    68                 data->id = table.get_string32( "id" );
     68                data->id = table["id"].get_string32();
    6969                int index = data->parts.size();
    7070                data->parts.emplace_back();
    7171                auto& part = data->parts.back();
    72                 part.name = table.get_string_hash_64( "name" );
    73                 part.bone_id = nv::uint32( bind_data->get_bone_list().resolve( table.get_string_hash_64( "bone" ) ) );
     72                part.name = table["name"].get_shash64();
     73                part.bone_id = nv::uint32( bind_data->get_bone_list().resolve( table["bone"].get_shash64() ) );
    7474                NV_ASSERT( part.bone_id < 256, "Bone ID not found!" );
    75                 float radius = table.get_float( "radius" );
     75                float radius = table["radius"].get_f32();
    7676                float length = 0.0f;
    7777                if ( table.has_field( "target" ) )
    7878                {
    7979                        const auto& of = bind_data->get_bone_transforms().m_offsets;
    80                         int target = bind_data->get_bone_list().resolve( table.get_string_hash_64( "target" ) );
     80                        int target = bind_data->get_bone_list().resolve( table["target"].get_shash64() );
    8181                        if ( target < 0 ) return false;
    8282                        length = math::distance( of[part.bone_id].get_position(), of[target].get_position() );
     
    8484                else
    8585                {
    86                         length = table.get_float( "length" );
     86                        length = table["length"].get_f32();
    8787                }
    8888                NV_ASSERT( radius > 0.0f && length > 0.0f, "Bad parameters!" );
    8989                part.shape      = m_world->create_capsule( radius, length );
    9090                part.parent_idx = pindex;
    91                 part.mass       = table.get_float( "mass", 1.0f );
     91                part.mass       = table["mass"].get_f32( 1.0f );
    9292                part.cone_twist = false;
    9393                // Joints
    9494                if ( pindex != -1 )
    9595                {
    96                         part.cone_twist = table.get_string_hash_64("joint") == shash64( "cone_twist"_ls );
    97                         part.limits     = table.get< vec3 >( "limits" );
     96                        part.cone_twist = table["joint"].get_shash64() == shash64( "cone_twist"_ls );
     97                        part.limits     = table["limits"].as< vec3 >();
    9898                }
    9999                uint32 child_count = table.get_size();
Note: See TracChangeset for help on using the changeset viewer.