Changeset 1741


Ignore:
Timestamp:
Aug 14, 2012, 6:03:52 PM (8 years ago)
Author:
Jnat
Message:
 
Location:
trunk/games/demo-jnat
Files:
2 edited

Legend:

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

    r1739 r1741  
    1717      : m_ready(false)
    1818    {
    19                 m_bodymesh.Compile("[sc#f20 afcb2 15 2 0.4]");
     19                m_bodymesh.Compile("[sc#f20 afcb2 15 2 0.4 ty7.5]");
    2020    }
    2121
  • trunk/games/demo-jnat/player.h

    r1740 r1741  
    3737        float updown = (float)(Input::GetButtonState(273 /*SDLK_UP*/) - Input::GetButtonState(274 /*SDLK_DOWN*/));
    3838        float rightleft = (float)(Input::GetButtonState(275 /*SDLK_RIGHT*/) - Input::GetButtonState(276 /*SDLK_LEFT*/));
     39                float lookX = 0.0f;
     40                float lookY = 0.0f;
    3941               
    4042                //float StickAngle = (float)m_stick->GetAxis(2);
     
    4850            rightleft += 1.f * m_stick->GetAxis(0);
    4951            updown += -1.f * m_stick->GetAxis(1);
     52                        lookX += 1.f * m_stick->GetAxis(2);
     53                        lookY += -1.f * m_stick->GetAxis(3);
    5054        }
    5155
     
    6367                if (rightleft * rightleft + updown * updown > 0.2f){
    6468                        m_velocity = vec3(rightleft,0,0);//120.f * m_rotation.transform(vec3(0, 0, 1));
    65                         vec3 deltapos = 200.f* seconds * m_velocity;
     69                        vec3 deltapos = 200.f* seconds * m_velocity; 
    6670
    6771                        m_position += deltapos;
    6872                }
    69                 m_bo->m_position = (m_position + vec3(0.0f,0.0f,10.0f) );
    70                 m_bo->m_rotation = lol::atan2(updown,rightleft);
     73                m_bo->m_position = (m_position + vec3(0.0f,5.0f,10.0f) );
     74
     75                float angle = lol::atan2(lookY,lookX);
     76                quat q = quat::rotate(angle,vec3(0,0,1));
     77                m_bo->m_rotation = q;
     78                q.printf();
    7179                //m_position += deltapos;
    7280
Note: See TracChangeset for help on using the changeset viewer.