Fixes for Linux compilation,
Thanks to Ole: http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=3590 Add option to select EPA or Minkowski sampling method in btDefaultCollisionConfiguration
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#define TaruVtxCount 43
|
#define TaruVtxCount 43
|
||||||
#define TaruIdxCount 132
|
#define TaruIdxCount 132
|
||||||
|
|
||||||
float TaruVtx[] = {
|
static float TaruVtx[] = {
|
||||||
1.08664f,-1.99237f,0.0f,
|
1.08664f,-1.99237f,0.0f,
|
||||||
0.768369f,-1.99237f,-0.768369f,
|
0.768369f,-1.99237f,-0.768369f,
|
||||||
1.28852f,1.34412e-007f,-1.28852f,
|
1.28852f,1.34412e-007f,-1.28852f,
|
||||||
@@ -47,7 +47,7 @@ float TaruVtx[] = {
|
|||||||
1.08664f,1.99237f,0.0f,
|
1.08664f,1.99237f,0.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float TaruNml[] = {
|
static float TaruNml[] = {
|
||||||
0.938103f,-0.346356f,0.0f,
|
0.938103f,-0.346356f,0.0f,
|
||||||
0.663339f,-0.346356f,-0.663339f,
|
0.663339f,-0.346356f,-0.663339f,
|
||||||
0.707107f,0.0f,-0.707107f,
|
0.707107f,0.0f,-0.707107f,
|
||||||
@@ -93,7 +93,7 @@ float TaruNml[] = {
|
|||||||
0.0f,1.0f,0.0f,
|
0.0f,1.0f,0.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
float TaruTex[] = {
|
static float TaruTex[] = {
|
||||||
0.75f,0.0f,
|
0.75f,0.0f,
|
||||||
0.875f,0.0f,
|
0.875f,0.0f,
|
||||||
0.875f,0.5f,
|
0.875f,0.5f,
|
||||||
@@ -139,7 +139,7 @@ float TaruTex[] = {
|
|||||||
0.5f,1.0f,
|
0.5f,1.0f,
|
||||||
};
|
};
|
||||||
|
|
||||||
unsigned short TaruIdx[] = {
|
static unsigned short TaruIdx[] = {
|
||||||
0,1,2,
|
0,1,2,
|
||||||
2,3,0,
|
2,3,0,
|
||||||
1,4,5,
|
1,4,5,
|
||||||
|
|||||||
@@ -431,8 +431,8 @@ void btGpuDemoDynamicsWorld::debugDrawConstraints(int selectedBatch, const float
|
|||||||
for(int i = 0; i < numConstraints; i++)
|
for(int i = 0; i < numConstraints; i++)
|
||||||
{
|
{
|
||||||
int indx = pBatchIds[i];
|
int indx = pBatchIds[i];
|
||||||
int idA = m_hIds[indx].x;
|
int idA = m_hIds[indx].x-1;
|
||||||
int idB = m_hIds[indx].y;
|
int idB = m_hIds[indx].y-1;
|
||||||
if((idA > 0) && (idB > 0))
|
if((idA > 0) && (idB > 0))
|
||||||
{
|
{
|
||||||
btCollisionObject* colObjA = m_collisionObjects[idA];
|
btCollisionObject* colObjA = m_collisionObjects[idA];
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "btGpuDemo2DSharedTypes.h"
|
#include "btGpuDemo2dSharedTypes.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ subject to the following restrictions:
|
|||||||
#include "GLDebugFont.h"
|
#include "GLDebugFont.h"
|
||||||
#include "GlutStuff.h"
|
#include "GlutStuff.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string.h> //for memset
|
||||||
|
|
||||||
extern unsigned char sFontData[];
|
extern unsigned char sFontData[];
|
||||||
static GLuint sTexture = -1;
|
static GLuint sTexture = -1;
|
||||||
|
|||||||
@@ -45,17 +45,17 @@ btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(const btDefault
|
|||||||
|
|
||||||
void* mem = btAlignedAlloc(sizeof(btVoronoiSimplexSolver),16);
|
void* mem = btAlignedAlloc(sizeof(btVoronoiSimplexSolver),16);
|
||||||
m_simplexSolver = new (mem)btVoronoiSimplexSolver();
|
m_simplexSolver = new (mem)btVoronoiSimplexSolver();
|
||||||
|
|
||||||
#define USE_EPA 1
|
|
||||||
#ifdef USE_EPA
|
|
||||||
mem = btAlignedAlloc(sizeof(btGjkEpaPenetrationDepthSolver),16);
|
|
||||||
m_pdSolver = new (mem)btGjkEpaPenetrationDepthSolver;
|
|
||||||
#else
|
|
||||||
mem = btAlignedAlloc(sizeof(btMinkowskiPenetrationDepthSolver),16);
|
|
||||||
m_pdSolver = new (mem)btMinkowskiPenetrationDepthSolver;
|
|
||||||
#endif//USE_EPA
|
|
||||||
|
|
||||||
|
|
||||||
|
if (constructionInfo.m_useEpaPenetrationAlgorithm)
|
||||||
|
{
|
||||||
|
mem = btAlignedAlloc(sizeof(btGjkEpaPenetrationDepthSolver),16);
|
||||||
|
m_pdSolver = new (mem)btGjkEpaPenetrationDepthSolver;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
mem = btAlignedAlloc(sizeof(btMinkowskiPenetrationDepthSolver),16);
|
||||||
|
m_pdSolver = new (mem)btMinkowskiPenetrationDepthSolver;
|
||||||
|
}
|
||||||
|
|
||||||
//default CreationFunctions, filling the m_doubleDispatch table
|
//default CreationFunctions, filling the m_doubleDispatch table
|
||||||
mem = btAlignedAlloc(sizeof(btConvexConvexAlgorithm::CreateFunc),16);
|
mem = btAlignedAlloc(sizeof(btConvexConvexAlgorithm::CreateFunc),16);
|
||||||
m_convexConvexCreateFunc = new(mem) btConvexConvexAlgorithm::CreateFunc(m_simplexSolver,m_pdSolver);
|
m_convexConvexCreateFunc = new(mem) btConvexConvexAlgorithm::CreateFunc(m_simplexSolver,m_pdSolver);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ struct btDefaultCollisionConstructionInfo
|
|||||||
int m_defaultMaxPersistentManifoldPoolSize;
|
int m_defaultMaxPersistentManifoldPoolSize;
|
||||||
int m_defaultMaxCollisionAlgorithmPoolSize;
|
int m_defaultMaxCollisionAlgorithmPoolSize;
|
||||||
int m_defaultStackAllocatorSize;
|
int m_defaultStackAllocatorSize;
|
||||||
|
int m_useEpaPenetrationAlgorithm;
|
||||||
|
|
||||||
btDefaultCollisionConstructionInfo()
|
btDefaultCollisionConstructionInfo()
|
||||||
:m_stackAlloc(0),
|
:m_stackAlloc(0),
|
||||||
@@ -35,7 +36,8 @@ struct btDefaultCollisionConstructionInfo
|
|||||||
m_collisionAlgorithmPool(0),
|
m_collisionAlgorithmPool(0),
|
||||||
m_defaultMaxPersistentManifoldPoolSize(4096),
|
m_defaultMaxPersistentManifoldPoolSize(4096),
|
||||||
m_defaultMaxCollisionAlgorithmPoolSize(4096),
|
m_defaultMaxCollisionAlgorithmPoolSize(4096),
|
||||||
m_defaultStackAllocatorSize(0)
|
m_defaultStackAllocatorSize(0),
|
||||||
|
m_useEpaPenetrationAlgorithm(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAxis(btVector3& axisInA = btVector3(0, 1, 0))
|
void setAxis(btVector3& axisInA)
|
||||||
{
|
{
|
||||||
btVector3 rbAxisA1, rbAxisA2;
|
btVector3 rbAxisA1, rbAxisA2;
|
||||||
btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
|
btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ subject to the following restrictions:
|
|||||||
#include "btGpu3DGridBroadphaseSharedDefs.h"
|
#include "btGpu3DGridBroadphaseSharedDefs.h"
|
||||||
|
|
||||||
#include "btGpu3DGridBroadphase.h"
|
#include "btGpu3DGridBroadphase.h"
|
||||||
#include <string> //for memset
|
#include <string.h> //for memset
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user