Example #1
0
int main(int argc,char* argv[]) {

    RagdollDemo demoApp;

    demoApp.create_draw_file = false;
    keep_input_files = false;

    int i;
    for (i=1; i < argc; i++) {
        if (!strcmp(argv[i], "-d")) {
	    demoApp.create_draw_file = true;
	}
	else if (!strcmp(argv[i], "-k")) {
	    keep_input_files = true;
	}
    }

    demoApp.initPhysics();
#ifdef GRAPHICS
    demoApp.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
    return glutmain(argc, argv, 640, 640, "Bullet Physics Demo. http://bulletphysics.com",&demoApp);
#else
    while (1) {
	demoApp.clientMoveAndDisplay();
	i = i + 1;
    } 
#endif


}
Example #2
0
int main(int argc,char* argv[])
{
        RagdollDemo demoApp;

        demoApp.initPhysics();
		demoApp.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);

        return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",&demoApp);
}
Example #3
0
	virtual double computeError(const double* pVector)
	{
		RagdollDemo simulation;
		m_pNN->setWeights(pVector);
		simulation.SetPolicy(m_pNN);
		float height = 0;
		int i;
		for(i = 0; i < 240; i++)
		{
			simulation.advanceTime(1.0f / 60);
			height = std::max(height, simulation.getRagDoll(0)->getLowestPoint());
		}
		return -(double)height;
	}