Changeset 382 for trunk/src/formats
- Timestamp:
- 06/01/15 20:39:35 (10 years ago)
- Location:
- trunk/src/formats
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/formats/assimp_loader.cc
r380 r382 238 238 aiMesh* mesh = scene->mMeshes[mc]; 239 239 240 NV_LOG_NOTICE( "Mesh #", mc, " - ", st d::string(mesh->mName.data ) );240 NV_LOG_NOTICE( "Mesh #", mc, " - ", string_ref( (char*)mesh->mName.data ) ); 241 241 NV_LOG_NOTICE( " bones - ", mesh->mNumBones ); 242 242 NV_LOG_NOTICE( " uvs - ", mesh->mNumUVComponents[0] ); -
trunk/src/formats/obj_loader.cc
r376 r382 280 280 for ( nv::size_t a = 0; a < count; ++a ) 281 281 { 282 const vec3& n = m_data[a].normal;283 const vec3& t = tan1[a];284 if ( ! (t .x == 0.0f && t.y == 0.0f && t.z == 0.0f) )282 const vec3& nv = m_data[a].normal; 283 const vec3& tv = tan1[a]; 284 if ( ! (tv.x == 0.0f && tv.y == 0.0f && tv.z == 0.0f) ) 285 285 { 286 m_data[a].tangent = vec4( glm::normalize(t - n * glm::dot( n, t)), 0.0f );287 m_data[a].tangent[3] = (glm::dot(glm::cross(n , t), tan2[a]) < 0.0f) ? -1.0f : 1.0f;286 m_data[a].tangent = vec4( glm::normalize(tv - nv * glm::dot( nv, tv )), 0.0f ); 287 m_data[a].tangent[3] = (glm::dot(glm::cross(nv, tv), tan2[a]) < 0.0f) ? -1.0f : 1.0f; 288 288 } 289 289 }
Note: See TracChangeset
for help on using the changeset viewer.