Index: trunk/src/engine/particle_engine.cc
===================================================================
--- trunk/src/engine/particle_engine.cc	(revision 453)
+++ trunk/src/engine/particle_engine.cc	(revision 454)
@@ -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 ) / math::sqrt(glm::dot( datap->plane_normal, datap->plane_normal ) );
+	datap->distance     = -math::dot( datap->plane_normal, datap->plane_point ) / math::sqrt( math::dot( datap->plane_normal, datap->plane_normal ) );
 	return true;
 }
@@ -242,12 +242,12 @@
 		particle& pt = p[i];
 		vec3 direction  = pt.velocity * factor;
-		if ( glm::dot( datap->plane_normal, pt.position + direction ) + datap->distance <= 0.0f )
+		if ( math::dot( datap->plane_normal, pt.position + direction ) + datap->distance <= 0.0f )
 		{
-			float val = glm::dot( datap->plane_normal, pt.position ) + datap->distance;
+			float val = math::dot( datap->plane_normal, pt.position ) + datap->distance;
 			if ( val > 0.0f )
 			{
-				vec3 part_dir = direction * ( -val / glm::dot( datap->plane_normal, direction ) );
+				vec3 part_dir = direction * ( -val / math::dot( datap->plane_normal, direction ) );
 				pt.position = pt.position + part_dir + ( part_dir - direction ) * datap->bounce;
-				pt.velocity = glm::reflect( pt.velocity, datap->plane_normal ) * datap->bounce;
+				pt.velocity = math::reflect( pt.velocity, datap->plane_normal ) * datap->bounce;
 			}
 		}
@@ -273,5 +273,5 @@
 	for ( uint32 i = 0; i < count; ++i )
 	{
-		p[i].color = glm::clamp( p[i].color + adjustment, 0.0f, 1.0f );
+		p[i].color = math::clamp( p[i].color + adjustment, 0.0f, 1.0f );
 	}
 }
@@ -296,5 +296,5 @@
 	for ( uint32 i = 0; i < count; ++i )
 	{
-		p[i].size = glm::max( p[i].size + adjustment, vec2() );
+		p[i].size = math::max( p[i].size + adjustment, vec2() );
 	}
 }
@@ -347,6 +347,6 @@
 	}
 
-	data.common_up  = glm::normalize( table.get<vec3>("common_up",  vec3(1,0,0) ) );
-	data.common_dir = glm::normalize( table.get<vec3>("common_dir", vec3(0,1,0) ) );
+	data.common_up  = math::normalize( table.get<vec3>("common_up",  vec3(1,0,0) ) );
+	data.common_dir = math::normalize( table.get<vec3>("common_dir", vec3(0,1,0) ) );
 
 	vec2 def_size        = table.get<vec2>("size", vec2(0.1,0.1) );
@@ -409,9 +409,10 @@
 
 				edata.rate         = element.get<float>("rate", 1.0f );
-				edata.dir          = glm::normalize( element.get<vec3>("direction", vec3(0,1,0) ) );
+				edata.dir          = math::normalize( element.get<vec3>("direction", vec3(0,1,0) ) );
 				
 				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 );
+					edata.odir = math::normalize( math::cross( edata.dir, vec3( 0, 1, 0 ) ) );
+				edata.cdir = math::cross( edata.dir, edata.odir );
 
 				data.emmiter_count++;
@@ -563,5 +564,5 @@
 		m_model_matrix = s.get_model();
 		m_camera_pos   = s.get_camera().get_position();
-		m_inv_view_dir = glm::normalize(-s.get_camera().get_direction());
+		m_inv_view_dir = math::normalize(-s.get_camera().get_direction());
 
 		update_emmiters( info, m_last_update );
@@ -636,29 +637,29 @@
 
 		vec3 view_dir( m_inv_view_dir );
-		if ( accurate_facing ) view_dir = glm::normalize( m_camera_pos - pdata.position );
+		if ( accurate_facing ) view_dir = math::normalize( m_camera_pos - pdata.position );
 
 		switch ( orientation )
 		{
 		case particle_orientation::POINT :
-			right   = glm::normalize( glm::cross( view_dir, vec3( 0, 1, 0 ) ) );
-			rot_mat = mat3( right, glm::cross( right, -view_dir ), -view_dir );
+			right   = math::normalize( math::cross( view_dir, vec3( 0, 1, 0 ) ) );
+			rot_mat = mat3( right, math::cross( right, -view_dir ), -view_dir );
 			break;
 		case particle_orientation::ORIENTED :
 			pdir    = normalize_safe( pdata.velocity, pdir );
-			right   = glm::normalize( glm::cross( pdir, view_dir ) );
-			rot_mat = mat3( right, pdir, glm::cross( pdir, right ) );
+			right   = math::normalize( math::cross( pdir, view_dir ) );
+			rot_mat = mat3( right, pdir, math::cross( pdir, right ) );
 			break;
 		case particle_orientation::ORIENTED_COMMON :
-			right   = glm::normalize( glm::cross( common_dir, view_dir ) );
-			rot_mat = mat3( right, common_dir, glm::cross( common_dir, right ) );
+			right   = math::normalize( math::cross( common_dir, view_dir ) );
+			rot_mat = mat3( right, common_dir, math::cross( common_dir, right ) );
 			break;
 		case particle_orientation::PERPENDICULAR :
 			pdir    = normalize_safe( pdata.velocity, pdir );
-			right   = glm::normalize( glm::cross( common_up, pdir ) );
-			rot_mat = mat3( right, common_up, glm::cross( common_up, right ) );
+			right   = math::normalize( math::cross( common_up, pdir ) );
+			rot_mat = mat3( right, common_up, math::cross( common_up, right ) );
 			break;
 		case particle_orientation::PERPENDICULAR_COMMON :
-			right   = glm::normalize( glm::cross( common_up, common_dir ) );
-			rot_mat = mat3( right, common_up, glm::cross( common_up, right ) );
+			right   = math::normalize( math::cross( common_up, common_dir ) );
+			rot_mat = mat3( right, common_up, math::cross( common_up, right ) );
 			break;
 		}
