diff --git a/newton-4.00/sdk/dCore/ndConvexHull2d.h b/newton-4.00/sdk/dCore/ndConvexHull2d.h index 717264b88..8d251c77f 100644 --- a/newton-4.00/sdk/dCore/ndConvexHull2d.h +++ b/newton-4.00/sdk/dCore/ndConvexHull2d.h @@ -19,8 +19,8 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#ifndef __NDCONVEXHULL_2D_H__ -#define __NDG_CONVEXHULL_2D_H__ +#ifndef __ND_CONVEXHULL_2D_H__ +#define __ND_CONVEXHULL_2D_H__ #include "ndCoreStdafx.h" #include "ndVector.h" diff --git a/newton-4.00/sdk/dNewton/dModels/ndUrdfFile.cpp b/newton-4.00/sdk/dNewton/dModels/ndUrdfFile.cpp index 607446650..f61e418a3 100644 --- a/newton-4.00/sdk/dNewton/dModels/ndUrdfFile.cpp +++ b/newton-4.00/sdk/dNewton/dModels/ndUrdfFile.cpp @@ -1115,6 +1115,7 @@ ndJointBilateralConstraint* ndUrdfFile::ImportJoint(const nd::TiXmlNode* const j pivotMatrix = matrix * pivotMatrix; } + ndAssert(0); const nd::TiXmlElement* const newtonEx = (nd::TiXmlElement*)jointNode->FirstChild("newton"); if (newtonEx) { diff --git a/newton-4.00/sdk/dNewton/ndWorld.cpp b/newton-4.00/sdk/dNewton/ndWorld.cpp index 69de99e0a..e3efb4936 100644 --- a/newton-4.00/sdk/dNewton/ndWorld.cpp +++ b/newton-4.00/sdk/dNewton/ndWorld.cpp @@ -154,6 +154,7 @@ ndWorld::ndWorld() ndWorld::~ndWorld() { + DeleteDeferredObjects(); CleanUp(); delete m_scene; @@ -428,15 +429,9 @@ ndInt32 ndWorld::CompareJointByInvMass(const ndJointBilateralConstraint* const j return 0; } -void ndWorld::ThreadFunction() +void ndWorld::DeleteDeferredObjects() { - D_TRACKTIME(); - ndUnsigned64 timeAcc = ndGetTimeInMicroseconds(); - - m_inUpdate = true; - m_scene->Begin(); - - // clean up all batched deletd objects, before update + // clean up all batched deleted objects, before update while (m_deletedModels.GetCount()) { D_TRACKTIME(); @@ -486,6 +481,16 @@ void ndWorld::ThreadFunction() ndSharedPtr sharedBody(GetBody(body)); RemoveBody(sharedBody); } +} + +void ndWorld::ThreadFunction() +{ + D_TRACKTIME(); + ndUnsigned64 timeAcc = ndGetTimeInMicroseconds(); + + m_inUpdate = true; + m_scene->Begin(); + DeleteDeferredObjects(); //m_inUpdate = true; //m_scene->Begin(); diff --git a/newton-4.00/sdk/dNewton/ndWorld.h b/newton-4.00/sdk/dNewton/ndWorld.h index 615ea9c3c..32ac73c3d 100644 --- a/newton-4.00/sdk/dNewton/ndWorld.h +++ b/newton-4.00/sdk/dNewton/ndWorld.h @@ -122,6 +122,7 @@ class ndWorld: public ndClassAlloc private: void ThreadFunction(); + void DeleteDeferredObjects(); protected: D_NEWTON_API virtual void UpdateSkeletons();