Skip to content

Commit

Permalink
before start making the thread pool a pass in parameters (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Oct 27, 2024
1 parent f99a75d commit cd4b4a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions newton-4.00/sdk/dCore/ndConvexHull2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions newton-4.00/sdk/dNewton/dModels/ndUrdfFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
21 changes: 13 additions & 8 deletions newton-4.00/sdk/dNewton/ndWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ndWorld::ndWorld()

ndWorld::~ndWorld()
{
DeleteDeferredObjects();
CleanUp();

delete m_scene;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -486,6 +481,16 @@ void ndWorld::ThreadFunction()
ndSharedPtr<ndBody> 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();
Expand Down
1 change: 1 addition & 0 deletions newton-4.00/sdk/dNewton/ndWorld.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class ndWorld: public ndClassAlloc

private:
void ThreadFunction();
void DeleteDeferredObjects();

protected:
D_NEWTON_API virtual void UpdateSkeletons();
Expand Down

0 comments on commit cd4b4a5

Please sign in to comment.