Changeset 398 for trunk/src/formats/md5_loader.cc
- Timestamp:
- 06/13/15 11:20:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/md5_loader.cc
r395 r398 31 31 } 32 32 33 static void unit_quat_w( glm::quat& quat )33 static void unit_quat_w( nv::quat& quat ) 34 34 { 35 35 float t = 1.0f - ( quat.x * quat.x ) - ( quat.y * quat.y ) - ( quat.z * quat.z ); … … 343 343 md5_vtx_pnt& vtc = vtcs[i]; 344 344 345 vtc.position = glm::vec3(0);346 vtc.normal = glm::vec3(0);347 vtc.tangent = glm::vec3(0);345 vtc.position = vec3(0); 346 vtc.normal = vec3(0); 347 vtc.tangent = vec3(0); 348 348 349 349 stable_sort( weights + start_weight, weights + start_weight + weight_count, [] ( const md5_weight& a, const md5_weight& b ) -> bool { return a.bias > b.bias; } ); … … 386 386 const mesh_node_data& joint = nodes[weight.joint_id]; 387 387 const transform tr = transform( joint.transform ).inverse(); 388 glm::vec3 rot_pos = tr.get_orientation() * weight.pos;388 vec3 rot_pos = tr.get_orientation() * weight.pos; 389 389 390 390 vtc.position += ( tr.get_position() + rot_pos ) * weight.bias; … … 404 404 uint32 ti2 = idata[ i * 3 + 2 ]; 405 405 406 glm::vec3 v1 = vtcs[ ti0 ].position;407 glm::vec3 v2 = vtcs[ ti1 ].position;408 glm::vec3 v3 = vtcs[ ti2 ].position;409 glm::vec3 xyz1 = v3 - v1;410 glm::vec3 xyz2 = v2 - v1;411 412 glm::vec3 normal = glm::cross( xyz1, xyz2 );406 vec3 v1 = vtcs[ ti0 ].position; 407 vec3 v2 = vtcs[ ti1 ].position; 408 vec3 v3 = vtcs[ ti2 ].position; 409 vec3 xyz1 = v3 - v1; 410 vec3 xyz2 = v2 - v1; 411 412 vec3 normal = glm::cross( xyz1, xyz2 ); 413 413 414 414 vtcs[ ti0 ].normal += normal; … … 436 436 md5_vtx_pntiw& vdata = vtx_data[i]; 437 437 438 glm::vec3 normal = glm::normalize( vtcs[i].normal );439 glm::vec3 tangent = glm::normalize( vtcs[i].tangent );438 vec3 normal = glm::normalize( vtcs[i].normal ); 439 vec3 tangent = glm::normalize( vtcs[i].tangent ); 440 440 vtcs[i].normal = normal; 441 441 vtcs[i].tangent = tangent; 442 442 443 443 vdata.position = vtcs[i].position; 444 vdata.normal = glm::vec3(0);445 vdata.tangent = glm::vec3(0);444 vdata.normal = vec3(0); 445 vdata.tangent = vec3(0); 446 446 447 447 for ( size_t j = 0; j < 4; ++j ) … … 484 484 transform ptr; 485 485 if ( pjoint.data->get_channel(0)->count > index ) ptr = ptv[ index ]; 486 glm::vec3 rot_pos = ptr.get_orientation() * pos;486 vec3 rot_pos = ptr.get_orientation() * pos; 487 487 488 488 pos = ptr.get_position() + rot_pos;
Note: See TracChangeset
for help on using the changeset viewer.