- Timestamp:
- 07/30/15 20:49:02 (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/arcball.hh
r451 r453 50 50 vec3 vb = get_arcball_vector( nposition ); 51 51 52 m_angle = math::acos( glm::min( 1.0f, glm::dot( va, vb ) ) );52 m_angle = math::acos( glm::min( 1.0f, math::dot( va, vb ) ) ); 53 53 m_axis = glm::cross( va, vb ); 54 54 m_last = nposition; -
trunk/nv/interface/camera.hh
r451 r453 33 33 void set_perspective( f32 fov, f32 aspect, f32 near, f32 far ) 34 34 { 35 m_projection = math::perspective( glm::radians( fov ), aspect, near, far );35 m_projection = math::perspective( math::radians( fov ), aspect, near, far ); 36 36 } 37 37 void set_ortho( f32 left, f32 right, f32 bottom, f32 top, f32 near = -1.0f, f32 far = 1.0f ) -
trunk/nv/stl/math.hh
r451 r453 13 13 #include <nv/stl/math/common.hh> 14 14 #include <nv/stl/math/constants.hh> 15 #include <nv/stl/math/geometric.hh> 15 16 #include <nv/stl/math/matrix_transform.hh> 16 17 #include <nv/stl/math/cast.hh> -
trunk/nv/stl/math/common.hh
r451 r453 15 15 16 16 #include <nv/common.hh> 17 #include <nv/stl/type_traits/common.hh> 17 18 18 19 #if NV_COMPILER == NV_GNUC … … 44 45 using ::floor; 45 46 using ::ceil; 47 using ::round; 46 48 #if 0 47 49 template < typename T > using tvec2 = ::glm::detail::tvec2<T, glm::precision::highp>; … … 65 67 using glm::ctor; 66 68 } 69 70 template < typename T > 71 struct is_math_vector : false_type {}; 72 73 template < typename T > 74 struct is_math_matrix : false_type {}; 75 76 template < typename T > 77 struct is_math_quat : false_type {}; 78 79 template < typename T > 80 struct is_math_class : bool_constant< 81 is_math_vector< T >::value || 82 is_math_matrix< T >::value || 83 is_math_quat< T >::value 84 > {}; 85 86 template < typename T > struct is_math_vector< math::tvec2< T > > : true_type {}; 87 template < typename T > struct is_math_vector< math::tvec3< T > > : true_type {}; 88 template < typename T > struct is_math_vector< math::tvec4< T > > : true_type {}; 89 template < typename T > struct is_math_matrix< math::tmat2< T > > : true_type {}; 90 template < typename T > struct is_math_matrix< math::tmat3< T > > : true_type {}; 91 template < typename T > struct is_math_matrix< math::tmat4< T > > : true_type {}; 92 template < typename T > struct is_math_quat < math::tquat< T > > : true_type {}; 67 93 68 94 typedef math::tvec2<sint8> i8vec2; -
trunk/nv/stl/math/constants.hh
r451 r453 197 197 } 198 198 199 template < typename T > 200 constexpr T radians( T degrees ) 201 { 202 static_assert( is_floating_point<T>::value, "Type expected to be floating point!" ); 203 return degrees * static_cast<T>( 0.01745329251994329576923690768489 ); 204 } 205 206 template < typename T > 207 constexpr T degrees( T radians ) 208 { 209 static_assert( is_floating_point<T>::value, "Type expected to be floating point!" ); 210 return radians * static_cast<T>( 57.295779513082320876798154814105 ); 211 } 212 199 213 } 200 214 } -
trunk/src/engine/particle_engine.cc
r452 r453 749 749 if ( edata.angle > 0.0f ) 750 750 { 751 float emission_angle = glm::radians( edata.angle );751 float emission_angle = math::radians( edata.angle ); 752 752 float cos_theta = r.frange( math::cos( emission_angle ), 1.0f ); 753 753 float sin_theta = math::sqrt(1.0f - cos_theta * cos_theta ); -
trunk/src/rocket/rocket_interface.cc
r395 r453 273 273 nv::vertex_array m_va = m_context->create_vertex_array( rv, num_vertices, (unsigned*)indices, num_indices, nv::STATIC_DRAW ); 274 274 //if ( info ) m_device->set_uniform( m_program, "texsize", nv::vec2( info->size ) ); 275 m_state.set_model( glm::translate( glm::mat4(), nv::vec3( translation.x, translation.y, 0.0f ) ) );275 m_state.set_model( nv::math::translate( nv::mat4(), nv::vec3( translation.x, translation.y, 0.0f ) ) ); 276 276 m_context->draw( nv::TRIANGLES, m_rstate, m_state, m_program, m_va, num_indices ); 277 277 m_context->release( m_va ); -
trunk/src/sdl/sdl_audio.cc
r406 r453 75 75 if ( relative != vec3() ) 76 76 { 77 angle = glm::degrees( -glm::orientedAngle( m_forward, glm::normalize( relative ), m_up ) );77 angle = math::degrees( -glm::orientedAngle( m_forward, glm::normalize( relative ), m_up ) ); 78 78 distance = glm::clamp( 20.0f * glm::length( relative ), 0.0f, 255.0f ); 79 79 }
Note: See TracChangeset
for help on using the changeset viewer.