first step in refactoring/cleaning up demos

This commit is contained in:
ejcoumans
2006-09-11 05:31:22 +00:00
parent a27c35ecaa
commit 43370aaa4f
33 changed files with 2449 additions and 7548 deletions

View File

@@ -22,22 +22,10 @@ subject to the following restrictions:
#include "SimdQuaternion.h"
#include "SimdTransform.h"
#include "GL_ShapeDrawer.h"
#ifdef WIN32 //needed for glut.h
#include <windows.h>
#endif
//think different
#if defined(__APPLE__) && !defined (VMDMESA)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
#include "GlutStuff.h"
#include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
#include "SimplexDemo.h"
#include "GlutStuff.h"
VoronoiSimplexSolver simplexSolver;
@@ -61,34 +49,26 @@ PolyhedralConvexShape* shapePtr[maxNumObjects];
int main(int argc,char** argv)
{
simplex.SetSimplexSolver(&simplexSolver);
SimplexDemo* demo = new SimplexDemo();
simplex.AddVertex(SimdPoint3(-2,0,-2));
simplex.AddVertex(SimdPoint3(2,0,-2));
simplex.AddVertex(SimdPoint3(0,0,2));
simplex.AddVertex(SimdPoint3(0,2,0));
shapePtr[0] = &simplex;
SimdTransform tr;
tr.setIdentity();
return glutmain(argc, argv,screenWidth,screenHeight,"SimplexDemo");
demo->initPhysics();
return glutmain(argc, argv,screenWidth,screenHeight,"SimplexDemo",demo);
}
//to be implemented by the demo
void clientMoveAndDisplay()
void SimplexDemo::clientMoveAndDisplay()
{
clientDisplay();
displayCallback();
}
void clientDisplay(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
void SimplexDemo::displayCallback()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_LIGHTING);
GL_ShapeDrawer::DrawCoordSystem();
@@ -121,26 +101,18 @@ void clientDisplay(void) {
glutSwapBuffers();
}
void clientResetScene()
void SimplexDemo::initPhysics()
{
}
simplex.SetSimplexSolver(&simplexSolver);
void clientSpecialKeyboard(int key, int x, int y)
{
defaultSpecialKeyboard(key,x,y);
}
simplex.AddVertex(SimdPoint3(-2,0,-2));
simplex.AddVertex(SimdPoint3(2,0,-2));
simplex.AddVertex(SimdPoint3(0,0,2));
simplex.AddVertex(SimdPoint3(0,2,0));
void clientKeyboard(unsigned char key, int x, int y)
{
defaultKeyboard(key, x, y);
}
shapePtr[0] = &simplex;
void clientMouseFunc(int button, int state, int x, int y)
{
}
void clientMotionFunc(int x,int y)
{
}
SimdTransform tr;
tr.setIdentity();
}