Index: trunk/src/core/random.cc
===================================================================
--- trunk/src/core/random.cc	(revision 450)
+++ trunk/src/core/random.cc	(revision 451)
@@ -110,16 +110,16 @@
 nv::vec2 nv::random::precise_unit_vec2()
 {
-	float angle = frand( glm::pi<float>() * 2.f );
-	return vec2( glm::cos( angle ), glm::sin( angle ) );
+	f32 angle = frand( math::pi<f32>() * 2.f );
+	return vec2( math::cos( angle ), math::sin( angle ) );
 }
 
 nv::vec3 nv::random::precise_unit_vec3()
 {
-	float cos_theta = frange( -1.0f, 1.0f );
-	float sin_theta = glm::sqrt( 1.0f - cos_theta * cos_theta );
-	float phi       = frand( 2 * glm::pi<float>() );
+	f32 cos_theta = frange( -1.0f, 1.0f );
+	f32 sin_theta = math::sqrt( 1.0f - cos_theta * cos_theta );
+	f32 phi       = frand( 2 * math::pi<f32>() );
 	return vec3( 
-		sin_theta * glm::sin(phi),
-		sin_theta * glm::cos(phi),
+		sin_theta * math::sin(phi),
+		sin_theta * math::cos(phi),
 		cos_theta
 		);
@@ -128,29 +128,29 @@
 nv::vec2 nv::random::fast_disk_point()
 {
-	float r1 = frand();
-	float r2 = frand();
+	f32 r1 = frand();
+	f32 r2 = frand();
 	if ( r1 > r2 ) swap( r1, r2 );
-	float rf = 2*glm::pi<float>()*(r1/r2);
-	return vec2( r2*glm::cos( rf ), r2*glm::sin( rf ) );
+	f32 rf = 2* math::pi<f32>()*(r1/r2);
+	return vec2( r2*math::cos( rf ), r2*math::sin( rf ) );
 }
 
 nv::vec2 nv::random::precise_disk_point()
 {
-	float r = glm::sqrt( frand() );
-	float rangle = frand( glm::pi<float>() );
-	return vec2( r*glm::cos( rangle ), r*glm::sin( rangle ) );
+	f32 r = math::sqrt( frand() );
+	f32 rangle = frand( math::pi<f32>() );
+	return vec2( r*math::cos( rangle ), r*math::sin( rangle ) );
 }
 
 nv::vec3 nv::random::fast_sphere_point()
 {
-	float rad     = frand();
-	float pi      = glm::pi<float>();
-	float phi     = glm::asin( frange( -1.0f, 1.0f ) ) + pi*.5f;
-	float theta   = frange( 0.0f, 2 * glm::pi<float>() );
-	float sin_phi = glm::sin( phi );
+	f32 rad     = frand();
+	f32 pi      = math::pi<f32>();
+	f32 phi     = math::asin( frange( -1.0f, 1.0f ) ) + pi*.5f;
+	f32 theta   = frange( 0.0f, 2 * math::pi<f32>() );
+	f32 sin_phi = math::sin( phi );
 	return vec3( 
-		rad * glm::cos(theta) * sin_phi,
-		rad * glm::sin(theta) * sin_phi,
-		rad * glm::cos(phi)
+		rad * math::cos(theta) * sin_phi,
+		rad * math::sin(theta) * sin_phi,
+		rad * math::cos(phi)
 	);
 }
@@ -158,11 +158,11 @@
 nv::vec3 nv::random::precise_sphere_point()
 {
-	float radius = glm::pow( frand(), 1.f/3.f );
-	float cos_theta = frange( -1.0f, 1.0f );
-	float sin_theta = glm::sqrt( 1.0f - cos_theta * cos_theta );
-	float phi       = frange( 0.0f, 2 * glm::pi<float>() );
+	f32 radius = math::pow( frand(), 1.f/3.f );
+	f32 cos_theta = frange( -1.0f, 1.0f );
+	f32 sin_theta = math::sqrt( 1.0f - cos_theta * cos_theta );
+	f32 phi       = frange( 0.0f, 2 * math::pi<f32>() );
 	return vec3( 
-		radius * sin_theta * glm::sin(phi),
-		radius * sin_theta * glm::cos(phi),
+		radius * sin_theta * math::sin(phi),
+		radius * sin_theta * math::cos(phi),
 		radius * cos_theta
 		);
@@ -199,26 +199,26 @@
 }
 
-nv::vec2 nv::random::fast_hollow_disk_point( float iradius, float oradius )
-{
-	float idist2 = iradius * iradius;
-	float odist2 = oradius * oradius;
-	float rdist  = glm::sqrt( frange( idist2, odist2 ) );
+nv::vec2 nv::random::fast_hollow_disk_point( f32 iradius, f32 oradius )
+{
+	f32 idist2 = iradius * iradius;
+	f32 odist2 = oradius * oradius;
+	f32 rdist  = math::sqrt( frange( idist2, odist2 ) );
 	return rdist * precise_unit_vec2();
 }
 
-nv::vec2 nv::random::precise_hollow_disk_point( float iradius, float oradius )
+nv::vec2 nv::random::precise_hollow_disk_point( f32 iradius, f32 oradius )
 {
 	return fast_hollow_disk_point( iradius, oradius );
 }
 
-nv::vec3 nv::random::fast_hollow_sphere_point( float iradius, float oradius )
-{
-	float idist3 = iradius * iradius * iradius;
-	float odist3 = oradius * oradius * oradius;
-	float rdist  = glm::pow( frange( idist3, odist3 ), 1.f/3.f );
+nv::vec3 nv::random::fast_hollow_sphere_point( f32 iradius, f32 oradius )
+{
+	f32 idist3 = iradius * iradius * iradius;
+	f32 odist3 = oradius * oradius * oradius;
+	f32 rdist  = math::pow( frange( idist3, odist3 ), 1.f/3.f );
 	return rdist * precise_unit_vec3();
 }
 
-nv::vec3 nv::random::precise_hollow_sphere_point( float iradius, float oradius )
+nv::vec3 nv::random::precise_hollow_sphere_point( f32 iradius, f32 oradius )
 {
 	return fast_hollow_sphere_point( iradius, oradius );
@@ -232,10 +232,10 @@
 	vec2 opoint2    = opoint * opoint;
 	vec2 odir       = glm::normalize( opoint );
-	float odist2    = opoint2.x + opoint2.y;
-
-	float low    = iradii2.y * opoint2.x + iradii2.x * opoint2.y;
-	float idist2 = ((iradii2.x * iradii2.y) / low ) * odist2;
-
-	float rdist     = glm::sqrt( frange( idist2, odist2 ) );
+	f32 odist2    = opoint2.x + opoint2.y;
+
+	f32 low    = iradii2.y * opoint2.x + iradii2.x * opoint2.y;
+	f32 idist2 = ((iradii2.x * iradii2.y) / low ) * odist2;
+
+	f32 rdist     = math::sqrt( frange( idist2, odist2 ) );
 	return odir * rdist;	
 }
@@ -252,16 +252,16 @@
 	vec3 opoint2    = opoint * opoint;
 	vec3 odir       = glm::normalize( opoint );
-	float odist2    = opoint2.x + opoint2.y + opoint2.z;
-
-	float low    = 
+	f32 odist2    = opoint2.x + opoint2.y + opoint2.z;
+
+	f32 low    = 
 		iradii2.y * iradii2.z * opoint2.x + 
 		iradii2.x * iradii2.z * opoint2.y +
 		iradii2.x * iradii2.y * opoint2.z;
-	float idist2 = ((iradii2.x * iradii2.y * iradii2.z) / low ) * odist2;
-
-	float odist3 = odist2 * glm::sqrt( odist2 );
-	float idist3 = idist2 * glm::sqrt( idist2 );
-
-	float rdist     = glm::pow( frange( idist3, odist3 ), 1.f/3.f );
+	f32 idist2 = ((iradii2.x * iradii2.y * iradii2.z) / low ) * odist2;
+
+	f32 odist3 = odist2 * math::sqrt( odist2 );
+	f32 idist3 = idist2 * math::sqrt( idist2 );
+
+	f32 rdist     = math::pow( frange( idist3, odist3 ), 1.f/3.f );
 	return odir * rdist;	
 }
Index: trunk/src/engine/particle_engine.cc
===================================================================
--- trunk/src/engine/particle_engine.cc	(revision 450)
+++ trunk/src/engine/particle_engine.cc	(revision 451)
@@ -231,5 +231,5 @@
 	datap->plane_normal = normalize_safe( datap->plane_normal, vec3(0.0f,1.0f,0.0f) );
 	datap->bounce       = table->get<float>("bounce", 0.0f );
-	datap->distance     = -glm::dot( datap->plane_normal, datap->plane_point ) / glm::sqrt(glm::dot( datap->plane_normal, datap->plane_normal ) );
+	datap->distance     = -glm::dot( datap->plane_normal, datap->plane_point ) / math::sqrt(glm::dot( datap->plane_normal, datap->plane_normal ) );
 	return true;
 }
@@ -411,5 +411,5 @@
 				edata.dir          = glm::normalize( element.get<vec3>("direction", vec3(0,1,0) ) );
 				
-				edata.odir = glm::vec3( 0, 0, 1 );
+				edata.odir = vec3( 0, 0, 1 );
 				if ( edata.dir != vec3( 0, 1, 0 ) && edata.dir != vec3( 0, -1, 0 ) )
 					edata.odir = glm::normalize( glm::cross( edata.dir, vec3( 0, 1, 0 ) ) );		edata.cdir = glm::cross( edata.dir, edata.odir );
@@ -750,10 +750,10 @@
 					{
 						float emission_angle = glm::radians( edata.angle );
-						float cos_theta = r.frange( glm::cos( emission_angle ), 1.0f );
-						float sin_theta = glm::sqrt(1.0f - cos_theta * cos_theta );
-						float phi       = r.frange( 0.0f, 2*glm::pi<float>() );
+						float cos_theta = r.frange( math::cos( emission_angle ), 1.0f );
+						float sin_theta = math::sqrt(1.0f - cos_theta * cos_theta );
+						float phi       = r.frange( 0.0f, 2* math::pi<float>() );
 						pinfo.velocity  = orient * 
-							( edata.odir * ( glm::cos(phi) * sin_theta ) +
-							edata.cdir * ( glm::sin(phi)*sin_theta ) + 
+							( edata.odir * ( math::cos(phi) * sin_theta ) +
+							edata.cdir * ( math::sin(phi)*sin_theta ) +
 							edata.dir  * cos_theta );
 					}
Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 450)
+++ trunk/src/formats/assimp_loader.cc	(revision 451)
@@ -139,5 +139,5 @@
 			vec2 s = assimp_st_cast( mesh->mTextureCoords[0][i] );
 
-			glm::vec3 t_i = glm::normalize( t - n * glm::dot( n, t ) );
+			vec3 t_i = glm::normalize( t - n * glm::dot( n, t ) );
 			float det = ( glm::dot( glm::cross( n, t ), b ) );
 			det = ( det < 0.0f ? -1.0f : 1.0f );
@@ -440,6 +440,6 @@
 // 	if ( node->mNumScalingKeys > 0 )
 // 	{
-// 		nv::vec3 scale_vec0 = assimp_vec3_cast( node->mScalingKeys[0].mValue );
-// 		float scale_value   = glm::length( glm::abs( scale_vec0 - nv::vec3(1,1,1) ) );
+// 		vec3 scale_vec0 = assimp_vec3_cast( node->mScalingKeys[0].mValue );
+// 		float scale_value   = glm::length( math::abs( scale_vec0 - vec3(1,1,1) ) );
 // 		if ( node->mNumScalingKeys > 1 || scale_value > 0.001 ) 
 // 		{
Index: trunk/src/formats/md3_loader.cc
===================================================================
--- trunk/src/formats/md3_loader.cc	(revision 450)
+++ trunk/src/formats/md3_loader.cc	(revision 451)
@@ -240,5 +240,5 @@
 	if ( !s_normal_ready )
 	{
-		float pi      = glm::pi<float>();
+		float pi      = math::pi<float>();
 		float convert = (2 * pi) / 255.0f;
 		int n = 0;
@@ -246,11 +246,11 @@
 		{
 			float flat    = lat * convert;
-			float sin_lat = glm::sin( flat );
-			float cos_lat = glm::cos( flat );
+			float sin_lat = math::sin( flat );
+			float cos_lat = math::cos( flat );
 			for ( int lng = 0; lng < 256; ++lng, ++n )
 			{
 				float flng    = lng * convert;
-				float sin_lng = glm::sin( flng );
-				float cos_lng = glm::cos( flng );
+				float sin_lng = math::sin( flng );
+				float cos_lng = math::cos( flng );
 				s_normal_cache[n].x = cos_lat * sin_lng;
 //				s_normal_cache[n].y = sin_lat * sin_lng;
Index: trunk/src/gfx/keyframed_mesh.cc
===================================================================
--- trunk/src/gfx/keyframed_mesh.cc	(revision 450)
+++ trunk/src/gfx/keyframed_mesh.cc	(revision 451)
@@ -93,8 +93,8 @@
 			}
 		}
-		m_last_frame    = static_cast<uint32>( glm::floor( tick_time ) + anim->get_start() );
+		m_last_frame    = static_cast<uint32>( math::floor( tick_time ) + anim->get_start() );
 		m_next_frame    = m_last_frame + 1;
 		if ( m_next_frame > static_cast<uint32>( anim->get_end() ) ) m_next_frame = static_cast<uint32>( anim->get_start() );
-		m_interpolation = tick_time - glm::floor( tick_time );
+		m_interpolation = tick_time - math::floor( tick_time );
 	}
 }
Index: trunk/src/lua/lua_glm.cc
===================================================================
--- trunk/src/lua/lua_glm.cc	(revision 450)
+++ trunk/src/lua/lua_glm.cc	(revision 451)
@@ -56,5 +56,5 @@
 	static inline T unit() { return T( 1, 1, 1 ); }
 	static inline T construct( lua_State* L, int index ) {
-		typedef nv::tvec2<typename T::value_type> vec2;
+		typedef nv::math::tvec2<typename T::value_type> vec2;
 		if ( lua_type( L, index ) == LUA_TUSERDATA )
 		{
@@ -77,6 +77,6 @@
 	static inline T unit() { return T( 1, 1, 1, 1 ); }
 	static inline T construct( lua_State* L, int index ) {
-		typedef nv::tvec2<typename T::value_type> vec2;
-		typedef nv::tvec3<typename T::value_type> vec3;
+		typedef nv::math::tvec2<typename T::value_type> vec2;
+		typedef nv::math::tvec3<typename T::value_type> vec3;
 		if ( lua_type( L, index ) == LUA_TUSERDATA )
 		{
@@ -242,7 +242,7 @@
 	{
 		switch (len) {
-		case 2 : push_vec( L, nv::tvec2<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]] ) ); return 1;
-		case 3 : push_vec( L, nv::tvec3<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]] ) ); return 1;
-		case 4 : push_vec( L, nv::tvec4<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]], (*v)[nlua_swizzel_lookup[key[3]]] ) ); return 1;
+		case 2 : push_vec( L, nv::math::tvec2<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]] ) ); return 1;
+		case 3 : push_vec( L, nv::math::tvec3<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]] ) ); return 1;
+		case 4 : push_vec( L, nv::math::tvec4<typename T::value_type>( (*v)[nlua_swizzel_lookup[key[0]]], (*v)[nlua_swizzel_lookup[key[1]]], (*v)[nlua_swizzel_lookup[key[2]]], (*v)[nlua_swizzel_lookup[key[3]]] ) ); return 1;
 		default: break;
 		}
@@ -258,7 +258,7 @@
 int nlua_vec_newindex( lua_State* L )
 {
-	typedef nv::tvec2<typename T::value_type> vec2;
-	typedef nv::tvec3<typename T::value_type> vec3;
-	typedef nv::tvec4<typename T::value_type> vec4;
+	typedef nv::math::tvec2<typename T::value_type> vec2;
+	typedef nv::math::tvec3<typename T::value_type> vec3;
+	typedef nv::math::tvec4<typename T::value_type> vec4;
 
 	T* v = to_pvec<T>( L, 1 );
