Merge branch 'master' of https://github.com/erwincoumans/bullet3
This commit is contained in:
@@ -241,7 +241,11 @@ struct BulletMJCFImporterInternalData
|
|||||||
return buf;
|
return buf;
|
||||||
#else
|
#else
|
||||||
char row[1024];
|
char row[1024];
|
||||||
|
#ifdef G3_TINYXML2
|
||||||
|
sprintf(row,"unknown line, upgrade tinyxml2 version!");
|
||||||
|
#else
|
||||||
sprintf(row,"%d",e->GetLineNum());
|
sprintf(row,"%d",e->GetLineNum());
|
||||||
|
#endif
|
||||||
std::string str = m_sourceFileName.c_str() + std::string(":") + std::string(row);
|
std::string str = m_sourceFileName.c_str() + std::string(":") + std::string(row);
|
||||||
return str;
|
return str;
|
||||||
#endif
|
#endif
|
||||||
@@ -1491,8 +1495,12 @@ bool BulletMJCFImporter::parseMJCFString(const char* xmlText, MJCFErrorLogger* l
|
|||||||
xml_doc.Parse(xmlText);
|
xml_doc.Parse(xmlText);
|
||||||
if (xml_doc.Error())
|
if (xml_doc.Error())
|
||||||
{
|
{
|
||||||
|
#ifdef G3_TINYXML2
|
||||||
|
logger->reportError("xml reading error (upgrade tinyxml2 version!");
|
||||||
|
#else
|
||||||
logger->reportError(xml_doc.ErrorStr());
|
logger->reportError(xml_doc.ErrorStr());
|
||||||
xml_doc.ClearError();
|
xml_doc.ClearError();
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "UrdfParser.h"
|
#include "UrdfParser.h"
|
||||||
|
|
||||||
#include "../../ThirdPartyLibs/tinyxml2/tinyxml2.h"
|
#include "../../ThirdPartyLibs/tinyxml2/tinyxml2.h"
|
||||||
#include "urdfStringSplit.h"
|
#include "urdfStringSplit.h"
|
||||||
#include "urdfLexicalCast.h"
|
#include "urdfLexicalCast.h"
|
||||||
@@ -1504,8 +1503,12 @@ bool UrdfParser::loadUrdf(const char* urdfText, ErrorLogger* logger, bool forceF
|
|||||||
xml_doc.Parse(urdfText);
|
xml_doc.Parse(urdfText);
|
||||||
if (xml_doc.Error())
|
if (xml_doc.Error())
|
||||||
{
|
{
|
||||||
|
#ifdef G3_TINYXML2
|
||||||
|
logger->reportError("xml reading error");
|
||||||
|
#else
|
||||||
logger->reportError(xml_doc.ErrorStr());
|
logger->reportError(xml_doc.ErrorStr());
|
||||||
xml_doc.ClearError();
|
xml_doc.ClearError();
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1664,9 +1667,13 @@ bool UrdfParser::loadSDF(const char* sdfText, ErrorLogger* logger)
|
|||||||
xml_doc.Parse(sdfText);
|
xml_doc.Parse(sdfText);
|
||||||
if (xml_doc.Error())
|
if (xml_doc.Error())
|
||||||
{
|
{
|
||||||
|
#ifdef G3_TINYXML2
|
||||||
|
logger->reportError("xml reading error");
|
||||||
|
#else
|
||||||
logger->reportError(xml_doc.ErrorStr());
|
logger->reportError(xml_doc.ErrorStr());
|
||||||
xml_doc.ClearError();
|
xml_doc.ClearError();
|
||||||
return false;
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLElement *sdf_xml = xml_doc.FirstChildElement("sdf");
|
XMLElement *sdf_xml = xml_doc.FirstChildElement("sdf");
|
||||||
@@ -1847,8 +1854,12 @@ std::string UrdfParser::sourceFileLocation(XMLElement* e)
|
|||||||
return buf;
|
return buf;
|
||||||
#else
|
#else
|
||||||
char row[1024];
|
char row[1024];
|
||||||
|
#ifdef G3_TINYXML2
|
||||||
|
sprintf(row,"unknown line");
|
||||||
|
#else
|
||||||
sprintf(row,"%d",e->GetLineNum());
|
sprintf(row,"%d",e->GetLineNum());
|
||||||
std::string str = m_urdf2Model.m_sourceFile.c_str() + std::string(":") + std::string(row);
|
#endif
|
||||||
|
std::string str = m_urdf2Model.m_sourceFile.c_str() + std::string(":") + std::string(row);
|
||||||
return str;
|
return str;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,8 @@ void b3PosixThreadSupport::stopThreads()
|
|||||||
for(size_t t=0; t < size_t(m_activeThreadStatus.size()); ++t)
|
for(size_t t=0; t < size_t(m_activeThreadStatus.size()); ++t)
|
||||||
{
|
{
|
||||||
b3ThreadStatus& spuStatus = m_activeThreadStatus[t];
|
b3ThreadStatus& spuStatus = m_activeThreadStatus[t];
|
||||||
printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed);
|
|
||||||
|
// printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed);
|
||||||
|
|
||||||
spuStatus.m_userPtr = 0;
|
spuStatus.m_userPtr = 0;
|
||||||
checkPThreadFunction(sem_post(spuStatus.startSemaphore));
|
checkPThreadFunction(sem_post(spuStatus.startSemaphore));
|
||||||
|
|||||||
@@ -1618,7 +1618,7 @@ void GLInstancingRenderer::renderScene()
|
|||||||
{
|
{
|
||||||
|
|
||||||
renderSceneInternal(B3_CREATE_SHADOWMAP_RENDERMODE);
|
renderSceneInternal(B3_CREATE_SHADOWMAP_RENDERMODE);
|
||||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
|
||||||
|
|
||||||
if (m_planeReflectionShapeIndex>=0)
|
if (m_planeReflectionShapeIndex>=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -119,9 +119,9 @@ void Win32OpenGLWindow::closeWindow()
|
|||||||
void Win32OpenGLWindow::startRendering()
|
void Win32OpenGLWindow::startRendering()
|
||||||
{
|
{
|
||||||
pumpMessage();
|
pumpMessage();
|
||||||
//don't clear all 3 buffers because some AMD drivers are buggy
|
|
||||||
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
|
|
||||||
|
|
||||||
//glCullFace(GL_BACK);
|
//glCullFace(GL_BACK);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#include "PhysicsClientSharedMemory.h"
|
#include "PhysicsClientSharedMemory.h"
|
||||||
#include "PosixSharedMemory.h"
|
#include "PosixSharedMemory.h"
|
||||||
#include "Win32SharedMemory.h"
|
#include "Win32SharedMemory.h"
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
#include "LinearMath/btVector3.h"
|
#include "Bullet3Common/b3Vector3.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "Bullet3Common/b3HashMap.h"
|
||||||
#include "Bullet3Common/b3Logging.h"
|
#include "Bullet3Common/b3Logging.h"
|
||||||
#include "../Utils/b3ResourcePath.h"
|
#include "../Utils/b3ResourcePath.h"
|
||||||
#include "../../Extras/Serialize/BulletFileLoader/btBulletFile.h"
|
#include "../../Extras/Serialize/BulletFileLoader/btBulletFile.h"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
struct BodyJointInfoCache
|
struct BodyJointInfoCache
|
||||||
{
|
{
|
||||||
std::string m_baseName;
|
std::string m_baseName;
|
||||||
btAlignedObjectArray<b3JointInfo> m_jointInfo;
|
b3AlignedObjectArray<b3JointInfo> m_jointInfo;
|
||||||
std::string m_bodyName;
|
std::string m_bodyName;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -28,32 +28,32 @@ struct PhysicsClientSharedMemoryInternalData {
|
|||||||
bool m_ownsSharedMemory;
|
bool m_ownsSharedMemory;
|
||||||
SharedMemoryBlock* m_testBlock1;
|
SharedMemoryBlock* m_testBlock1;
|
||||||
|
|
||||||
btHashMap<btHashInt,BodyJointInfoCache*> m_bodyJointMap;
|
b3HashMap<b3HashInt,BodyJointInfoCache*> m_bodyJointMap;
|
||||||
btHashMap<btHashInt,b3UserConstraint> m_userConstraintInfoMap;
|
b3HashMap<b3HashInt,b3UserConstraint> m_userConstraintInfoMap;
|
||||||
|
|
||||||
btAlignedObjectArray<TmpFloat3> m_debugLinesFrom;
|
b3AlignedObjectArray<TmpFloat3> m_debugLinesFrom;
|
||||||
btAlignedObjectArray<TmpFloat3> m_debugLinesTo;
|
b3AlignedObjectArray<TmpFloat3> m_debugLinesTo;
|
||||||
btAlignedObjectArray<TmpFloat3> m_debugLinesColor;
|
b3AlignedObjectArray<TmpFloat3> m_debugLinesColor;
|
||||||
|
|
||||||
int m_cachedCameraPixelsWidth;
|
int m_cachedCameraPixelsWidth;
|
||||||
int m_cachedCameraPixelsHeight;
|
int m_cachedCameraPixelsHeight;
|
||||||
btAlignedObjectArray<unsigned char> m_cachedCameraPixelsRGBA;
|
b3AlignedObjectArray<unsigned char> m_cachedCameraPixelsRGBA;
|
||||||
btAlignedObjectArray<float> m_cachedCameraDepthBuffer;
|
b3AlignedObjectArray<float> m_cachedCameraDepthBuffer;
|
||||||
btAlignedObjectArray<int> m_cachedSegmentationMaskBuffer;
|
b3AlignedObjectArray<int> m_cachedSegmentationMaskBuffer;
|
||||||
|
|
||||||
btAlignedObjectArray<b3ContactPointData> m_cachedContactPoints;
|
b3AlignedObjectArray<b3ContactPointData> m_cachedContactPoints;
|
||||||
btAlignedObjectArray<b3OverlappingObject> m_cachedOverlappingObjects;
|
b3AlignedObjectArray<b3OverlappingObject> m_cachedOverlappingObjects;
|
||||||
btAlignedObjectArray<b3VisualShapeData> m_cachedVisualShapes;
|
b3AlignedObjectArray<b3VisualShapeData> m_cachedVisualShapes;
|
||||||
btAlignedObjectArray<b3CollisionShapeData> m_cachedCollisionShapes;
|
b3AlignedObjectArray<b3CollisionShapeData> m_cachedCollisionShapes;
|
||||||
|
|
||||||
btAlignedObjectArray<b3VRControllerEvent> m_cachedVREvents;
|
b3AlignedObjectArray<b3VRControllerEvent> m_cachedVREvents;
|
||||||
btAlignedObjectArray<b3KeyboardEvent> m_cachedKeyboardEvents;
|
b3AlignedObjectArray<b3KeyboardEvent> m_cachedKeyboardEvents;
|
||||||
btAlignedObjectArray<b3MouseEvent> m_cachedMouseEvents;
|
b3AlignedObjectArray<b3MouseEvent> m_cachedMouseEvents;
|
||||||
btAlignedObjectArray<double> m_cachedMassMatrix;
|
b3AlignedObjectArray<double> m_cachedMassMatrix;
|
||||||
btAlignedObjectArray<b3RayHitInfo> m_raycastHits;
|
b3AlignedObjectArray<b3RayHitInfo> m_raycastHits;
|
||||||
|
|
||||||
btAlignedObjectArray<int> m_bodyIdsRequestInfo;
|
b3AlignedObjectArray<int> m_bodyIdsRequestInfo;
|
||||||
btAlignedObjectArray<int> m_constraintIdsRequestInfo;
|
b3AlignedObjectArray<int> m_constraintIdsRequestInfo;
|
||||||
|
|
||||||
SharedMemoryStatus m_tempBackupServerStatus;
|
SharedMemoryStatus m_tempBackupServerStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -260,6 +260,8 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
unsigned int cachedSharedParam = eMotionIsInitialized;
|
||||||
|
|
||||||
args->m_cs->lock();
|
args->m_cs->lock();
|
||||||
args->m_cs->setSharedParam(0,eMotionIsInitialized);
|
args->m_cs->setSharedParam(0,eMotionIsInitialized);
|
||||||
args->m_cs->unlock();
|
args->m_cs->unlock();
|
||||||
@@ -269,6 +271,8 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
int numCmdSinceSleep1ms = 0;
|
int numCmdSinceSleep1ms = 0;
|
||||||
unsigned long long int prevTime = clock.getTimeMicroseconds();
|
unsigned long long int prevTime = clock.getTimeMicroseconds();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -468,7 +472,11 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
numCmdSinceSleep1ms++;
|
numCmdSinceSleep1ms++;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (args->m_cs->getSharedParam(0)!=eRequestTerminateMotion);
|
args->m_cs->lock();
|
||||||
|
cachedSharedParam = args->m_cs->getSharedParam(0);
|
||||||
|
args->m_cs->unlock();
|
||||||
|
|
||||||
|
} while (cachedSharedParam!=eRequestTerminateMotion);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
args->m_cs->lock();
|
args->m_cs->lock();
|
||||||
@@ -1749,7 +1757,7 @@ void PhysicsServerExample::initPhysics()
|
|||||||
|
|
||||||
|
|
||||||
m_isConnected = m_physicsServer.connectSharedMemory( m_guiHelper);
|
m_isConnected = m_physicsServer.connectSharedMemory( m_guiHelper);
|
||||||
|
|
||||||
|
|
||||||
for (int i=0;i<m_threadSupport->getNumTasks();i++)
|
for (int i=0;i<m_threadSupport->getNumTasks();i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include "Win32SharedMemory.h"
|
#include "Win32SharedMemory.h"
|
||||||
#include "Bullet3Common/b3Logging.h"
|
#include "Bullet3Common/b3Logging.h"
|
||||||
#include "Bullet3Common/b3Scalar.h"
|
#include "Bullet3Common/b3Scalar.h"
|
||||||
#include "LinearMath/btAlignedObjectArray.h"
|
#include "Bullet3Common/b3AlignedObjectArray.h"
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -29,7 +29,7 @@ struct Win32SharedMemorySegment
|
|||||||
struct Win32SharedMemoryInteralData
|
struct Win32SharedMemoryInteralData
|
||||||
{
|
{
|
||||||
|
|
||||||
btAlignedObjectArray<Win32SharedMemorySegment> m_segments;
|
b3AlignedObjectArray<Win32SharedMemorySegment> m_segments;
|
||||||
|
|
||||||
Win32SharedMemoryInteralData()
|
Win32SharedMemoryInteralData()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -937,6 +937,12 @@ static PyObject* pybullet_changeDynamicsInfo(PyObject* self, PyObject* args, PyO
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((contactStiffness>=0 && contactDamping <0)||(contactStiffness<0 && contactDamping >=0))
|
||||||
|
{
|
||||||
|
PyErr_SetString(SpamError, "Both contactStiffness and contactDamping needs to be set together.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
b3SharedMemoryCommandHandle command = b3InitChangeDynamicsInfo(sm);
|
b3SharedMemoryCommandHandle command = b3InitChangeDynamicsInfo(sm);
|
||||||
b3SharedMemoryStatusHandle statusHandle;
|
b3SharedMemoryStatusHandle statusHandle;
|
||||||
|
|||||||
@@ -528,6 +528,14 @@ protected:
|
|||||||
otherArray.copy(0, otherSize, m_data);
|
otherArray.copy(0, otherSize, m_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void removeAtIndex(int index)
|
||||||
|
{
|
||||||
|
if (index<size())
|
||||||
|
{
|
||||||
|
swap( index,size()-1);
|
||||||
|
pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //B3_OBJECT_ARRAY__
|
#endif //B3_OBJECT_ARRAY__
|
||||||
|
|||||||
Reference in New Issue
Block a user