updated AllBulletDemo

This commit is contained in:
ejcoumans
2007-10-23 05:46:16 +00:00
parent aa28f8c223
commit ce0ce3b135
16 changed files with 97 additions and 159 deletions

View File

@@ -18,12 +18,19 @@ subject to the following restrictions:
#include "../CcdPhysicsDemo/CcdPhysicsDemo.h"
#include "../BspDemo/BspDemo.h"
#include "../BasicDemo/BasicDemo.h"
#include "../ConcaveDemo/ConcaveDemo.h"
#include "../ConvexDecompositionDemo/ConvexDecompositionDemo.h"
#include "../RagdollDemo/RagdollDemo.h"
btDemoEntry g_demoEntries[] =
{
{"RagdollDemo",RagdollDemo::Create},
{"ConvexDecomposition",ConvexDecompositionDemo::Create},
{"CcdPhysicsDemo", CcdPhysicsDemo::Create},
{"BasicDemo", BasicDemo::Create},
{"BspDemo", BspDemo::Create},
{"ConcaveDemo",ConcaveDemo::Create},
{0, 0}
};

View File

@@ -7,5 +7,7 @@ FrameWorkDemo AllBulletDemos :
../BspDemo/BspDemo.cpp
../BspDemo/BspConverter.cpp
../BspDemo/BspLoader.cpp
../ConcaveDemo/ConcavePhysicsDemo.cpp
../ConvexDecompositionDemo/ConvexDecompositionDemo.cpp
../RagdollDemo/RagdollDemo.cpp
;

View File

@@ -22,7 +22,6 @@
#include "LinearMath/btScalar.h"
#include "LinearMath/btMinMax.h"
#include "Render.h"
#include "DemoApplication.h"
#include "DemoEntries.h"
@@ -57,8 +56,6 @@ void Resize(int w, int h)
glLoadIdentity();
double ratio = (double)tw / (double)th;
gluOrtho2D(viewZoom * (viewX - ratio), viewZoom * (ratio + viewX),
viewZoom * (viewY - 0.1), viewZoom * (viewY + 1.9));
if (demo)
demo->reshape(w, h);
@@ -165,7 +162,7 @@ int main(int argc, char** argv)
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE |GLUT_DEPTH);
glutInitWindowSize(width, height);
mainWindow = glutCreateWindow("http://bulletphysics.com");
//glutSetOption (GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
@@ -180,6 +177,7 @@ int main(int argc, char** argv)
GLUI_Master.set_glutMouseFunc(Mouse);
glutMotionFunc(MouseMotion);
glui = GLUI_Master.create_glui_subwindow( mainWindow,
GLUI_SUBWINDOW_RIGHT );

View File

@@ -1,67 +0,0 @@
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#include "Render.h"
//#include "freeglut/gl/glut.h"
//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 <stdio.h>
#include <stdarg.h>
#include <string.h>
void DrawString(int x, int y, const char *string, ...)
{
char buffer[128];
va_list arg;
va_start(arg, string);
vsprintf(buffer, string, arg);
va_end(arg);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
int w = glutGet(GLUT_WINDOW_WIDTH);
int h = glutGet(GLUT_WINDOW_HEIGHT);
gluOrtho2D(0, w, h, 0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glColor3f(0.9f, 0.6f, 0.6f);
glRasterPos2i(x, y);
int length = (int)strlen(buffer);
for (int i = 0; i < length; ++i)
{
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer[i]);
}
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}

View File

@@ -1,32 +0,0 @@
/*
* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
#ifndef RENDER_H
#define RENDER_H
#include "LinearMath/btScalar.h"
struct Color
{
Color() { cx = 1.0f; cy = 1.0f; cz = 1.0f; }
Color(float x, float y, float z) { cx = x; cy = y; cz = z; }
float cx, cy, cz;
};
#endif