Changeset 398 for trunk/nv/core/transform.hh
- Timestamp:
- 06/13/15 11:20:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/core/transform.hh
r397 r398 26 26 void set_orientation( const quat& a_orientation ) { m_orientation = a_orientation; } 27 27 void set_orientation( float radians, const vec3& axis ) 28 { // use glm::radians if degrees!28 { // use math::radians if degrees! 29 29 m_orientation = glm::angleAxis( radians, axis ); 30 30 } … … 43 43 } 44 44 // void rotate( const vec3& axis, f32 angle ) 45 // { // use glm::radians if degrees!45 // { // use math::radians if degrees! 46 46 // quat temp( angle, axis ); 47 47 // m_orientation = temp * m_orientation; … … 54 54 mat4 extract() const 55 55 { 56 mat4 result = glm::mat4_cast( m_orientation );56 mat4 result = mat4_cast( m_orientation ); 57 57 result[3] = vec4( m_position, 1.0f ); 58 58 return result; … … 62 62 quat new_orient( glm::inverse( m_orientation ) ); 63 63 // TODO: simplify 64 return transform( - glm::mat3_cast(new_orient) * m_position, new_orient );64 return transform( -mat3_cast(new_orient) * m_position, new_orient ); 65 65 } 66 66 … … 100 100 return transform( 101 101 glm::mix ( a.get_position(), b.get_position(), value ), 102 glm::slerp( a.get_orientation(), b.get_orientation(), value ) 102 glm::slerp( a.get_orientation(), b.get_orientation(), value ) 103 103 ); 104 104 }
Note: See TracChangeset
for help on using the changeset viewer.