Changeset 1335


Ignore:
Timestamp:
May 2, 2012, 8:10:33 PM (9 years ago)
Author:
sam
Message:

core: make WorldEntity rotation a quaternion.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/tank.h

    r1333 r1335  
    3232        WorldEntity::TickGame(seconds);
    3333
     34        m_rotation *= quat::rotate(seconds * 20.f, vec3(0, 1, 0));
    3435        m_angle += seconds * 50.f;
    3536    }
     
    4647        }
    4748
    48         mat4 model = mat4::translate(m_position);
    49 
     49        mat4 model = mat4::translate(m_position) * mat4(m_rotation);
    5050        m_body.Render(model);
    5151
  • trunk/src/worldentity.cpp

    r1310 r1335  
    2727{
    2828    m_position = vec3(0);
    29     m_rotation = vec3(0);
     29    m_rotation = quat(1);
    3030    m_velocity = vec3(0);
    3131    m_bbox[0] = m_bbox[1] = vec3(0);
  • trunk/src/worldentity.h

    r1310 r1335  
    2626public:
    2727    vec3 m_position;
    28     vec3 m_rotation;
    2928    vec3 m_velocity;
     29    quat m_rotation;
    3030    vec3 m_bbox[2];
    3131
Note: See TracChangeset for help on using the changeset viewer.