Changeset 1568


Ignore:
Timestamp:
Jul 3, 2012, 7:15:24 PM (7 years ago)
Author:
touky
Message:

BtPhysTest works !

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/games/ToukyDemo/ToukyDemo.cpp

    r1552 r1568  
    4848                          vec3(0.f, 0.f, 0.f),
    4949                          vec3(0, 0, -1));
    50     m_camera->SetRotation(quat::fromeuler_yxz(0.f, -30.f, 0.f));
    51     //m_camera->SetPerspective(120.f, 1280.f, 960.f, -1000.f, 1000.f);
     50    //m_camera->SetRotation(quat::fromeuler_yxz(0.f, -30.f, 0.f));
     51    m_camera->SetPerspective(120.f, 1280.f, 960.f, .1f, 1000.f);
    5252        m_camera->SetOrtho(1280.f / 6, 960.f / 6, -1000.f, 1000.f);
    5353    Ticker::Ref(m_camera);
  • trunk/test/BtPhysTest.cpp

    r1564 r1568  
    4646#define EXTRA_HEIGHT 1.f
    4747
    48 int gNumObjects = 8;
     48int gNumObjects = 16;
    4949
    5050BtPhysTest::BtPhysTest(bool editor)
     
    5454                          vec3(0.f, 0.f, 0.f),
    5555                          vec3(0, 0, -1));
    56     m_camera->SetRotation(quat::fromeuler_yxz(0.f, -30.f, 0.f));
     56    m_camera->SetRotation(quat::fromeuler_yxz(0.f, -40.f, 0.f));
    5757    m_camera->SetPerspective(90.f, 1280.f, 960.f, .1f, 1000.f);
    5858        //m_camera->SetOrtho(1280.f / 6, 960.f / 6, -1000.f, 1000.f);
     
    156156                                }
    157157
    158                                 btVector3 pos(col*2*CUBE_HALF_EXTENTS + (row2%2)*CUBE_HALF_EXTENTS,
     158                                btVector3 pos(col*2*CUBE_HALF_EXTENTS + (row2%2)*CUBE_HALF_EXTENTS, 20.0f +
    159159                                        row*2*CUBE_HALF_EXTENTS+CUBE_HALF_EXTENTS+EXTRA_HEIGHT,0);
    160160
     
    175175                                //using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
    176176
    177                                 btDefaultMotionState* myMotionState = new btDefaultMotionState(startTransform);
     177                                btDefaultMotionState* myMotionState = new btDefaultMotionState(trans);
    178178
    179179                                btRigidBody::btRigidBodyConstructionInfo cInfo(mass,myMotionState,shape,localInertia);
     
    244244                        rot = colObj->getWorldTransform().getBasis();
    245245                }
    246                 if (i == 2)
     246                if (i > 0)
    247247                {
    248248                        BarycenterLocation += m.v3.xyz;
     
    259259
    260260                m_camera->SetTarget(BarycenterLocation);
    261                 m_camera->SetPosition(BarycenterLocation + vec3(-50.0f, 50.0f, .0f));
     261                m_camera->SetPosition(BarycenterLocation + vec3(-10.0f, 10.0f, .0f));
    262262        }
    263263}
Note: See TracChangeset for help on using the changeset viewer.