Merge pull request #475 from erwincoumans/master
fix some warnings, re-enable ground in URDF import example, fix COLLADA up axis issue in URDF collision element
This commit is contained in:
@@ -1224,7 +1224,7 @@ void bFile::resolvePointersMismatch()
|
|||||||
int p = 0;
|
int p = 0;
|
||||||
while (blockLen-- > 0)
|
while (blockLen-- > 0)
|
||||||
{
|
{
|
||||||
btPointerUid dp = {0};
|
btPointerUid dp = {{0}};
|
||||||
safeSwapPtr((char*)dp.m_uniqueIds, oldPtr);
|
safeSwapPtr((char*)dp.m_uniqueIds, oldPtr);
|
||||||
|
|
||||||
void **tptr = (void**)(newPtr + p * ptrMem);
|
void **tptr = (void**)(newPtr + p * ptrMem);
|
||||||
|
|||||||
@@ -742,7 +742,8 @@ btCollisionShape* convertURDFToCollisionShape(const UrdfCollision* collision, co
|
|||||||
|
|
||||||
//compensate upAxisTrans and unitMeterScaling here
|
//compensate upAxisTrans and unitMeterScaling here
|
||||||
btMatrix4x4 upAxisMat;
|
btMatrix4x4 upAxisMat;
|
||||||
upAxisMat.setPureRotation(upAxisTrans.getRotation());
|
upAxisMat.setIdentity();
|
||||||
|
//upAxisMat.setPureRotation(upAxisTrans.getRotation());
|
||||||
btMatrix4x4 unitMeterScalingMat;
|
btMatrix4x4 unitMeterScalingMat;
|
||||||
unitMeterScalingMat.setPureScaling(btVector3(unitMeterScaling,unitMeterScaling,unitMeterScaling));
|
unitMeterScalingMat.setPureScaling(btVector3(unitMeterScaling,unitMeterScaling,unitMeterScaling));
|
||||||
btMatrix4x4 worldMat = unitMeterScalingMat*instance->m_worldTransform*upAxisMat;
|
btMatrix4x4 worldMat = unitMeterScalingMat*instance->m_worldTransform*upAxisMat;
|
||||||
@@ -851,10 +852,8 @@ int BulletURDFImporter::convertLinkVisualShapes(int linkIndex, const char* pathP
|
|||||||
for (int v = 0; v < link->m_visualArray.size();v++)
|
for (int v = 0; v < link->m_visualArray.size();v++)
|
||||||
{
|
{
|
||||||
const UrdfVisual& vis = link->m_visualArray[v];
|
const UrdfVisual& vis = link->m_visualArray[v];
|
||||||
btTransform childTrans = vis.m_linkLocalFrame;
|
btTransform childTrans = vis.m_linkLocalFrame;
|
||||||
|
|
||||||
convertURDFToVisualShape(&vis, pathPrefix, inertialFrame.inverse()*childTrans, vertices, indices);
|
convertURDFToVisualShape(&vis, pathPrefix, inertialFrame.inverse()*childTrans, vertices, indices);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -909,8 +908,7 @@ int BulletURDFImporter::convertLinkVisualShapes(int linkIndex, const char* pathP
|
|||||||
btTransform childTrans = col.m_linkLocalFrame;
|
btTransform childTrans = col.m_linkLocalFrame;
|
||||||
|
|
||||||
compoundShape->addChildShape(localInertiaFrame.inverse()*childTrans,childShape);
|
compoundShape->addChildShape(localInertiaFrame.inverse()*childTrans,childShape);
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ void ImportUrdfSetup::initPhysics()
|
|||||||
{
|
{
|
||||||
|
|
||||||
int upAxis = 2;
|
int upAxis = 2;
|
||||||
m_guiHelper->setUpAxis(2);
|
m_guiHelper->setUpAxis(upAxis);
|
||||||
|
|
||||||
this->createEmptyDynamicsWorld();
|
this->createEmptyDynamicsWorld();
|
||||||
//m_dynamicsWorld->getSolverInfo().m_numIterations = 100;
|
//m_dynamicsWorld->getSolverInfo().m_numIterations = 100;
|
||||||
@@ -356,7 +356,7 @@ void ImportUrdfSetup::initPhysics()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool createGround=false;
|
bool createGround=true;
|
||||||
if (createGround)
|
if (createGround)
|
||||||
{
|
{
|
||||||
btVector3 groundHalfExtents(20,20,20);
|
btVector3 groundHalfExtents(20,20,20);
|
||||||
|
|||||||
@@ -1409,10 +1409,10 @@ void GLInstancingRenderer::renderSceneInternal(int renderMode)
|
|||||||
b3Matrix4x4Mul(depthProjectionMatrix,depthModelViewMatrix,depthMVP);
|
b3Matrix4x4Mul(depthProjectionMatrix,depthModelViewMatrix,depthMVP);
|
||||||
|
|
||||||
GLfloat biasMatrix[4][4]={
|
GLfloat biasMatrix[4][4]={
|
||||||
0.5, 0.0, 0.0, 0.0,
|
{ 0.5, 0.0, 0.0, 0.0 },
|
||||||
0.0, 0.5, 0.0, 0.0,
|
{ 0.0, 0.5, 0.0, 0.0 },
|
||||||
0.0, 0.0, 0.5, 0.0,
|
{ 0.0, 0.0, 0.5, 0.0 },
|
||||||
0.5, 0.5, 0.5, 1.0
|
{ 0.5, 0.5, 0.5, 1.0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
GLfloat depthBiasMVP[4][4];
|
GLfloat depthBiasMVP[4][4];
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ namespace Gwen
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Gwen::Rect m_rectClipRegion;
|
Gwen::Rect m_rectClipRegion;
|
||||||
ICacheToTexture* m_RTT;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ int gFindPairs =0;
|
|||||||
|
|
||||||
btHashedOverlappingPairCache::btHashedOverlappingPairCache():
|
btHashedOverlappingPairCache::btHashedOverlappingPairCache():
|
||||||
m_overlapFilterCallback(0),
|
m_overlapFilterCallback(0),
|
||||||
m_blockedForChanges(false),
|
|
||||||
m_ghostPairCallback(0)
|
m_ghostPairCallback(0)
|
||||||
{
|
{
|
||||||
int initialAllocatedSize= 2;
|
int initialAllocatedSize= 2;
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ class btHashedOverlappingPairCache : public btOverlappingPairCache
|
|||||||
{
|
{
|
||||||
btBroadphasePairArray m_overlappingPairArray;
|
btBroadphasePairArray m_overlappingPairArray;
|
||||||
btOverlapFilterCallback* m_overlapFilterCallback;
|
btOverlapFilterCallback* m_overlapFilterCallback;
|
||||||
bool m_blockedForChanges;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ subject to the following restrictions:
|
|||||||
|
|
||||||
btConvex2dConvex2dAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
|
btConvex2dConvex2dAlgorithm::CreateFunc::CreateFunc(btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver)
|
||||||
{
|
{
|
||||||
m_numPerturbationIterations = 0;
|
|
||||||
m_minimumPointsPerturbationThreshold = 3;
|
|
||||||
m_simplexSolver = simplexSolver;
|
m_simplexSolver = simplexSolver;
|
||||||
m_pdSolver = pdSolver;
|
m_pdSolver = pdSolver;
|
||||||
}
|
}
|
||||||
@@ -57,15 +55,13 @@ btConvex2dConvex2dAlgorithm::CreateFunc::~CreateFunc()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
btConvex2dConvex2dAlgorithm::btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int numPerturbationIterations, int minimumPointsPerturbationThreshold)
|
btConvex2dConvex2dAlgorithm::btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver,int /* numPerturbationIterations */, int /* minimumPointsPerturbationThreshold */)
|
||||||
: btActivatingCollisionAlgorithm(ci,body0Wrap,body1Wrap),
|
: btActivatingCollisionAlgorithm(ci,body0Wrap,body1Wrap),
|
||||||
m_simplexSolver(simplexSolver),
|
m_simplexSolver(simplexSolver),
|
||||||
m_pdSolver(pdSolver),
|
m_pdSolver(pdSolver),
|
||||||
m_ownManifold (false),
|
m_ownManifold (false),
|
||||||
m_manifoldPtr(mf),
|
m_manifoldPtr(mf),
|
||||||
m_lowLevelOfDetail(false),
|
m_lowLevelOfDetail(false)
|
||||||
m_numPerturbationIterations(numPerturbationIterations),
|
|
||||||
m_minimumPointsPerturbationThreshold(minimumPointsPerturbationThreshold)
|
|
||||||
{
|
{
|
||||||
(void)body0Wrap;
|
(void)body0Wrap;
|
||||||
(void)body1Wrap;
|
(void)body1Wrap;
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ class btConvex2dConvex2dAlgorithm : public btActivatingCollisionAlgorithm
|
|||||||
btPersistentManifold* m_manifoldPtr;
|
btPersistentManifold* m_manifoldPtr;
|
||||||
bool m_lowLevelOfDetail;
|
bool m_lowLevelOfDetail;
|
||||||
|
|
||||||
int m_numPerturbationIterations;
|
|
||||||
int m_minimumPointsPerturbationThreshold;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
|
btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ int gFindSimplePairs =0;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
btHashedSimplePairCache::btHashedSimplePairCache():
|
btHashedSimplePairCache::btHashedSimplePairCache() {
|
||||||
m_blockedForChanges(false)
|
|
||||||
{
|
|
||||||
int initialAllocatedSize= 2;
|
int initialAllocatedSize= 2;
|
||||||
m_overlappingPairArray.reserve(initialAllocatedSize);
|
m_overlappingPairArray.reserve(initialAllocatedSize);
|
||||||
growTables();
|
growTables();
|
||||||
|
|||||||
@@ -56,8 +56,6 @@ class btHashedSimplePairCache
|
|||||||
{
|
{
|
||||||
btSimplePairArray m_overlappingPairArray;
|
btSimplePairArray m_overlappingPairArray;
|
||||||
|
|
||||||
bool m_blockedForChanges;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,11 @@ ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape
|
|||||||
|
|
||||||
bool m_useQuantizedAabbCompression;
|
bool m_useQuantizedAabbCompression;
|
||||||
bool m_ownsBvh;
|
bool m_ownsBvh;
|
||||||
|
#ifdef __clang__
|
||||||
|
bool m_pad[11] __attribute__((unused));////need padding due to alignment
|
||||||
|
#else
|
||||||
bool m_pad[11];////need padding due to alignment
|
bool m_pad[11];////need padding due to alignment
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ subject to the following restrictions:
|
|||||||
#include "btConvexPolyhedron.h"
|
#include "btConvexPolyhedron.h"
|
||||||
#include "LinearMath/btHashMap.h"
|
#include "LinearMath/btHashMap.h"
|
||||||
|
|
||||||
|
|
||||||
btConvexPolyhedron::btConvexPolyhedron()
|
btConvexPolyhedron::btConvexPolyhedron()
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ btConvexPolyhedron::~btConvexPolyhedron()
|
|||||||
|
|
||||||
inline bool IsAlmostZero(const btVector3& v)
|
inline bool IsAlmostZero(const btVector3& v)
|
||||||
{
|
{
|
||||||
if(fabsf(v.x())>1e-6 || fabsf(v.y())>1e-6 || fabsf(v.z())>1e-6) return false;
|
if(btFabs(v.x())>1e-6 || btFabs(v.y())>1e-6 || btFabs(v.z())>1e-6) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ subject to the following restrictions:
|
|||||||
ATTRIBUTE_ALIGNED16(class) btMultimaterialTriangleMeshShape : public btBvhTriangleMeshShape
|
ATTRIBUTE_ALIGNED16(class) btMultimaterialTriangleMeshShape : public btBvhTriangleMeshShape
|
||||||
{
|
{
|
||||||
btAlignedObjectArray <btMaterial*> m_materialList;
|
btAlignedObjectArray <btMaterial*> m_materialList;
|
||||||
int ** m_triangleMaterials;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ public:
|
|||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
|
|
||||||
btScalar m_tau;
|
|
||||||
btScalar m_damping;
|
|
||||||
btVehicleRaycaster* m_vehicleRaycaster;
|
btVehicleRaycaster* m_vehicleRaycaster;
|
||||||
btScalar m_pitchControl;
|
btScalar m_pitchControl;
|
||||||
btScalar m_steeringValue;
|
btScalar m_steeringValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user