merged most of the changes from the branch into trunk, except for COLLADA, libxml and glut glitches.

Still need to verify to make sure no unwanted renaming is introduced.
This commit is contained in:
ejcoumans
2006-09-27 20:43:51 +00:00
parent d1e9a885f3
commit eb23bb5c0c
263 changed files with 7528 additions and 6714 deletions

View File

@@ -16,12 +16,12 @@ subject to the following restrictions:
///
/// Convex Hull Distance Demo shows distance calculation between two convex hulls of points.
/// GJK with the VoronoiSimplexSolver is used.
/// GJK with the btVoronoiSimplexSolver is used.
///
#include "GL_Simplex1to4.h"
#include "LinearMath/SimdQuaternion.h"
#include "LinearMath/SimdTransform.h"
#include "LinearMath/btQuaternion.h"
#include "LinearMath/btTransform.h"
#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"
#include "BulletCollision/CollisionShapes/btConvexHullShape.h"
@@ -51,9 +51,9 @@ const int numObjects = 2;
GL_Simplex1to4 simplex;
PolyhedralConvexShape* shapePtr[maxNumObjects];
btPolyhedralConvexShape* shapePtr[maxNumObjects];
SimdTransform tr[numObjects];
btTransform tr[numObjects];
int screenWidth = 640.f;
int screenHeight = 480.f;
@@ -62,26 +62,26 @@ int main(int argc,char** argv)
{
clientResetScene();
SimdMatrix3x3 basisA;
btMatrix3x3 basisA;
basisA.setIdentity();
SimdMatrix3x3 basisB;
btMatrix3x3 basisB;
basisB.setIdentity();
tr[0].setBasis(basisA);
tr[1].setBasis(basisB);
SimdPoint3 points0[3]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1)};
SimdPoint3 points1[5]={SimdPoint3(1,0,0),SimdPoint3(0,1,0),SimdPoint3(0,0,1),SimdPoint3(0,0,-1),SimdPoint3(-1,-1,0)};
btPoint3 points0[3]={btPoint3(1,0,0),btPoint3(0,1,0),btPoint3(0,0,1)};
btPoint3 points1[5]={btPoint3(1,0,0),btPoint3(0,1,0),btPoint3(0,0,1),btPoint3(0,0,-1),btPoint3(-1,-1,0)};
ConvexHullShape hullA(points0,3);
ConvexHullShape hullB(points1,5);
btConvexHullShape hullA(points0,3);
btConvexHullShape hullB(points1,5);
shapePtr[0] = &hullA;
shapePtr[1] = &hullB;
SimdTransform tr;
btTransform tr;
tr.setIdentity();
@@ -97,8 +97,8 @@ void clientMoveAndDisplay()
}
static VoronoiSimplexSolver sGjkSimplexSolver;
SimplexSolverInterface& gGjkSimplexSolver = sGjkSimplexSolver;
static btVoronoiSimplexSolver sGjkSimplexSolver;
btSimplexSolverInterface& gGjkSimplexSolver = sGjkSimplexSolver;
@@ -112,13 +112,13 @@ void clientDisplay(void) {
float m[16];
int i;
GjkPairDetector convexConvex(shapePtr[0],shapePtr[1],&sGjkSimplexSolver,0);
btGjkPairDetector convexConvex(shapePtr[0],shapePtr[1],&sGjkSimplexSolver,0);
SimdVector3 seperatingAxis(0.00000000f,0.059727669f,0.29259586f);
btVector3 seperatingAxis(0.00000000f,0.059727669f,0.29259586f);
convexConvex.SetCachedSeperatingAxis(seperatingAxis);
PointCollector gjkOutput;
GjkPairDetector::ClosestPointInput input;
btPointCollector gjkOutput;
btGjkPairDetector::ClosestPointInput input;
input.m_transformA = tr[0];
input.m_transformB = tr[1];
@@ -126,7 +126,7 @@ void clientDisplay(void) {
if (gjkOutput.m_hasResult)
{
SimdVector3 endPt = gjkOutput.m_pointInWorld +
btVector3 endPt = gjkOutput.m_pointInWorld +
gjkOutput.m_normalOnBInWorld*gjkOutput.m_distance;
glBegin(GL_LINES);
@@ -142,26 +142,26 @@ void clientDisplay(void) {
tr[i].getOpenGLMatrix( m );
GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],SimdVector3(1,1,1),getDebugMode());
GL_ShapeDrawer::DrawOpenGL(m,shapePtr[i],btVector3(1,1,1),getDebugMode());
}
simplex.SetSimplexSolver(&sGjkSimplexSolver);
SimdPoint3 ybuf[4],pbuf[4],qbuf[4];
btPoint3 ybuf[4],pbuf[4],qbuf[4];
int numpoints = sGjkSimplexSolver.getSimplex(pbuf,qbuf,ybuf);
simplex.Reset();
for (i=0;i<numpoints;i++)
simplex.AddVertex(ybuf[i]);
SimdTransform ident;
btTransform ident;
ident.setIdentity();
ident.getOpenGLMatrix(m);
GL_ShapeDrawer::DrawOpenGL(m,&simplex,SimdVector3(1,1,1),getDebugMode());
GL_ShapeDrawer::DrawOpenGL(m,&simplex,btVector3(1,1,1),getDebugMode());
SimdQuaternion orn;
btQuaternion orn;
orn.setEuler(yaw,pitch,roll);
tr[0].setRotation(orn);
tr[1].setRotation(orn);
@@ -175,8 +175,8 @@ void clientDisplay(void) {
void clientResetScene()
{
tr[0].setOrigin(SimdVector3(0.0f,3.f,7.f));
tr[1].setOrigin(SimdVector3(0.0f,9.f,2.f));
tr[0].setOrigin(btVector3(0.0f,3.f,7.f));
tr[1].setOrigin(btVector3(0.0f,9.f,2.f));
}
void clientKeyboard(unsigned char key, int x, int y)