Ignore:
Timestamp:
Apr 29, 2012, 11:55:32 PM (9 years ago)
Author:
sam
Message:

core: tick methods now use seconds, like any sane system.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/debug/quad.cpp

    r1228 r1310  
    9797        for (npoints = 0; npoints < SINE_SIZE && x <= 1.0f; npoints++)
    9898        {
    99             float y = 0.5f + 0.5f * lol_sin(x * 2.0f * M_PI + time * 5e-3f);
     99            float y = 0.5f + 0.5f * lol_sin(x * 2.0f * M_PI + time * 5.f);
    100100            points[npoints * 2] = aa.x + (bb.x - aa.x) * x;
    101101            points[npoints * 2 + 1] = aa.y + (bb.y - aa.y) * y;
    102102
    103             float dy = M_PI * lol_cos(x * 2.0f * M_PI + time * 5e-3f);
     103            float dy = M_PI * lol_cos(x * 2.0f * M_PI + time * 5.f);
    104104            float dx = SINE_SPACE / sqrtf(1.0f + dy * dy);
    105105            x += dx;
     
    120120{
    121121    data->initialised = 0;
    122     data->time = RandF(10000.0f);
     122    data->time = RandF(10.0f);
    123123
    124124    m_drawgroup = DRAWGROUP_HUD;
     
    143143}
    144144
    145 void DebugQuad::TickGame(float deltams)
     145void DebugQuad::TickGame(float seconds)
    146146{
    147     Entity::TickGame(deltams);
    148 
    149     data->time += deltams;
     147    Entity::TickGame(seconds);
     148
     149    data->time += seconds;
    150150}
    151151
    152 void DebugQuad::TickDraw(float deltams)
     152void DebugQuad::TickDraw(float seconds)
    153153{
    154     Entity::TickDraw(deltams);
     154    Entity::TickDraw(seconds);
    155155
    156156    if (!data->initialised && !IsDestroying())
     
    214214    GLfloat texcoords[12];
    215215    mat4 t1 = mat4::translate(0.5f, 0.5f, 0.0f)
    216             * mat4::rotate(0.0254f * data->time, 0.0f, 0.0f, 1.0f)
     216            * mat4::rotate(25.4f * data->time, 0.0f, 0.0f, 1.0f)
    217217            * mat4::translate(-0.5f, -0.5f, 0.0f);
    218218    for (int i = 0; i < 6; i++)
     
    225225    GLfloat colors[18];
    226226    mat4 t2 = mat4::translate(0.5f, 0.5f, 0.5f)
    227             * mat4::rotate(0.0154f * data->time, 0.0f, 0.0f, 1.0f)
    228             * mat4::rotate(0.0211f * data->time, 0.0f, 1.0f, 0.0f)
    229             * mat4::rotate(0.0267f * data->time, 1.0f, 0.0f, 0.0f)
     227            * mat4::rotate(15.4f * data->time, 0.0f, 0.0f, 1.0f)
     228            * mat4::rotate(21.1f * data->time, 0.0f, 1.0f, 0.0f)
     229            * mat4::rotate(26.7f * data->time, 1.0f, 0.0f, 0.0f)
    230230            * mat4::translate(-0.5f, -0.5f, 0.0f);
    231231    for (int i = 0; i < 6; i++)
Note: See TracChangeset for help on using the changeset viewer.