Ignore:
Timestamp:
Aug 15, 2012, 12:52:11 AM (8 years ago)
Author:
Jnat
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/games/demo-jnat/player.h

    r1742 r1743  
    6767                if (rightleft * rightleft + updown * updown > 0.2f){
    6868                        m_velocity = vec3(rightleft,0,0);//120.f * m_rotation.transform(vec3(0, 0, 1));
    69                         vec3 deltapos = 200.f* seconds * m_velocity;
     69                        vec3 deltapos = 200.f * seconds * m_velocity;
    7070
    7171                        m_position += deltapos;
    7272                }
    73                 m_bo->m_position = (m_position + vec3(0.0f,5.0f,10.0f) );
     73                m_bo->m_position = (m_position + vec3(0.0f,10.0f,10.0f) );
    7474
    75                 float angle = lol::atan2(-lookX,lookY);
    76                 quat q = quat::rotate(angle*( 180 / M_PI ),vec3(0.0f,0.0f,1.0f));
     75                float angle = lol::atan2(lookY,lookX);
     76                quat q;
     77                if (lookX * lookX + lookY * lookY > 0.2f){
     78                        q = quat::rotate(angle*( 180 / M_PI ),vec3(0.0f,0.0f,1.0f));
     79                }else{
     80                        q = quat::rotate(0,vec3(0.0f,0.0f,1.0f));
     81                }
    7782                m_bo->m_rotation = q;
    7883                //m_bo->m_rotation.printf();
Note: See TracChangeset for help on using the changeset viewer.