Changeset 702


Ignore:
Timestamp:
Feb 28, 2011, 3:26:21 AM (10 years ago)
Author:
sam
Message:

The DebugQuad object now rotates with time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/debugquad.cpp

    r701 r702  
    3333private:
    3434    int initialised;
     35    float time;
    3536#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    3637    GLuint buflist[3];
     
    5152{
    5253    data->initialised = 0;
     54    data->time = 0.0f;
    5355}
    5456
     
    5658{
    5759    Entity::TickGame(deltams);
     60
     61    data->time += deltams;
    5862}
    5963
     
    129133    }
    130134
    131     static GLfloat const verts[6][2] =
    132     {
    133         { -0.9f,  0.9f }, {  0.9f,  0.9f }, { -0.9f, -0.9f },
    134         { -0.9f, -0.9f }, {  0.9f,  0.9f }, {  0.9f, -0.9f },
     135    float const st = sinf(0.0005f * data->time);
     136    float const ct = cosf(0.0005f * data->time);
     137
     138    GLfloat const verts[6][2] =
     139    {
     140        { -0.7f * (st + ct),  0.7f * (st - ct) },
     141        {  0.7f * (st - ct),  0.7f * (st + ct) },
     142        { -0.7f * (st - ct), -0.7f * (st + ct) },
     143
     144        { -0.7f * (st - ct), -0.7f * (st + ct) },
     145        {  0.7f * (st - ct),  0.7f * (st + ct) },
     146        {  0.7f * (st + ct), -0.7f * (st - ct) },
    135147    };
    136148
Note: See TracChangeset for help on using the changeset viewer.