Changeset 2901


Ignore:
Timestamp:
Sep 12, 2013, 4:19:01 PM (6 years ago)
Author:
touky
Message:

btphystest : small damp tweak.

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/btphystest.cpp

    r2894 r2901  
    6565    /* cat datas setup */
    6666    m_cat_texture = Tiler::Register("data/CatsSheet.png", ivec2(0), ivec2(0,1));
     67    m_fov_dp = .0f;
     68    m_loc_dp = .0f;
    6769#endif //CAT_MODE
    6870
     
    251253                    PhysicsObject* new_physobj = new PhysicsObject(m_simulation, 1000.f,
    252254                        vec3(-20.f, 15.f, -20.f) +
     255#if CAT_MODE
     256                        vec3(rand(4.f), rand(2.f), rand(4.f)) -
     257                        vec3(2.f       , 1.f      , 2.f) +
     258#endif //CAT_MODE
    253259                        vec3(8.f * (float)x, 8.f * (float)y, 8.f * (float)z));
    254260                    m_physobj_list.Push(new_physobj, ZERO_TIME);
     
    388394        loc_dp = ((m_cam_target == -1)?(.9f):(.5f));
    389395
    390     m_camera->SetFov(damp(m_camera->GetFov(), m_camera->GetFov() * fov_ratio * 1.1f, fov_dp, seconds));
    391     vec3 tmp = damp(m_camera->GetTarget(), new_target, loc_dp, seconds);
     396    m_fov_dp = damp(m_fov_dp, fov_dp, 0.08f, seconds);
     397    m_loc_dp = damp(m_loc_dp, loc_dp, 0.08f, seconds);
     398    m_camera->SetFov(damp(m_camera->GetFov(), m_camera->GetFov() * fov_ratio * 1.1f, m_fov_dp, seconds));
     399    vec3 tmp = damp(m_camera->GetTarget(), new_target, m_loc_dp, seconds);
    392400    m_camera->SetView((mat4::rotate(10.f * seconds, vec3(.0f, 1.f, .0f)) * vec4(m_camera->GetPosition(), 1.0f)).xyz,
    393401                      tmp, vec3(0, 1, 0));
  • trunk/test/btphystest.h

    r2894 r2901  
    7676    float                           m_target_timer;
    7777    int                             m_cam_target;
     78    float                           m_fov_dp;
     79    float                           m_loc_dp;
    7880};
    7981
Note: See TracChangeset for help on using the changeset viewer.