Ignore:
Timestamp:
07/31/15 20:25:22 (10 years ago)
Author:
epyon
Message:
  • math library work
  • glm only referenced in math/common.hh
  • still a lot work to do, but its WURF
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/mesh_creator.cc

    r430 r454  
    9595void nv::mesh_nodes_creator::transform( float scale, const mat3& r33 )
    9696{
    97         mat3 ri33 = glm::inverse( r33 );
     97        mat3 ri33 = math::inverse( r33 );
    9898        mat4 pre_transform ( scale * r33 );
    9999        mat4 post_transform( 1.f/scale * ri33 );
     
    150150                        {
    151151                                vec3& n = *reinterpret_cast<vec3*>( raw_data + vtx_size*i + n_offset );
    152                                 n = glm::normalize( normal_transform * n );
     152                                n = math::normalize( normal_transform * n );
    153153                        }
    154154                if ( t_offset != -1 )
     
    156156                        {
    157157                                vec4& t = *reinterpret_cast<vec4*>(raw_data + vtx_size*i + t_offset );
    158                                 t = vec4( glm::normalize( normal_transform * vec3(t) ), t[3] );
     158                                t = vec4( math::normalize( normal_transform * vec3(t) ), t[3] );
    159159                        }
    160160        }
     
    299299                        vec3 xyz2 = v2 - v1;
    300300
    301                         //vec3 normal = glm::cross( xyz1, xyz2 );
     301                        //vec3 normal = math::cross( xyz1, xyz2 );
    302302                        //
    303303                        //vtcs[ ti0 ].normal += normal;
     
    323323                if ( ! ( t.x == 0.0f && t.y == 0.0f && t.z == 0.0f ) )
    324324                {
    325                         tangents[i]    = vec4( glm::normalize(t - n * glm::dot( n, t )), 0.0f );
    326                         tangents[i][3] = (glm::dot(glm::cross(n, t), tangents2[i]) < 0.0f) ? -1.0f : 1.0f;
     325                        tangents[i]    = vec4( math::normalize(t - n * math::dot( n, t )), 0.0f );
     326                        tangents[i][3] = ( math::dot( math::cross(n, t), tangents2[i]) < 0.0f) ? -1.0f : 1.0f;
    327327                }
    328328        }
Note: See TracChangeset for help on using the changeset viewer.