Skip to content

Commit

Permalink
using nd name space to v-hacd
Browse files Browse the repository at this point in the history
the modified version of v-hacd, does not use opencel, openmp or simd.
is in fact faster and generated better result that the current github version.

since the github is not accepting my contribution, I have to add a unique name space to the library so that is does no create linking conflict with othe engine using the same library.

`
  • Loading branch information
JulioJerez committed Feb 21, 2022
1 parent c5096ad commit 3b4c100
Show file tree
Hide file tree
Showing 30 changed files with 13,113 additions and 13,281 deletions.
14 changes: 7 additions & 7 deletions newton-4.00/applications/ndSandbox/ndDemoEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@ ndShapeInstance* ndDemoEntity::CreateCompoundFromMesh(bool lowDetail) const
p.m_z = points[i].m_z;
meshPoints.PushBack(p);
}
VHACD::IVHACD* const interfaceVHACD = VHACD::CreateVHACD();
nd::VHACD::IVHACD* const interfaceVHACD = nd::VHACD::CreateVHACD();

VHACD::IVHACD::Parameters paramsVHACD;
nd::VHACD::IVHACD::Parameters paramsVHACD;
paramsVHACD.m_concavityToVolumeWeigh = lowDetail ? 1.0f : 0.5f;
interfaceVHACD->Compute(&meshPoints[0].m_x, points.GetCount(),
(uint32_t*)&indices[0], indices.GetCount() / 3, paramsVHACD);
Expand All @@ -415,7 +415,7 @@ ndShapeInstance* ndDemoEntity::CreateCompoundFromMesh(bool lowDetail) const
ndArray<ndVector> convexMeshPoints;
for (ndInt32 i = 0; i < hullCount; ++i)
{
VHACD::IVHACD::ConvexHull ch;
nd::VHACD::IVHACD::ConvexHull ch;
interfaceVHACD->GetConvexHull(i, ch);
convexMeshPoints.SetCount(ch.m_nPoints);
for (ndInt32 j = 0; j < ndInt32(ch.m_nPoints); ++j)
Expand Down Expand Up @@ -536,18 +536,18 @@ ndShapeInstance* ndDemoEntity::CreateCollisionFromChildren() const
p.m_z = points[i].m_z;
meshPoints.PushBack(p);
}
VHACD::IVHACD* const interfaceVHACD = VHACD::CreateVHACD();
nd::VHACD::IVHACD* const interfaceVHACD = nd::VHACD::CreateVHACD();

VHACD::IVHACD::Parameters paramsVHACD;
paramsVHACD.m_concavityToVolumeWeigh = 1.0;
nd::VHACD::IVHACD::Parameters paramsVHACD;
//paramsVHACD.m_concavityToVolumeWeigh = 1.0;
interfaceVHACD->Compute(&meshPoints[0].m_x, points.GetCount(),
(uint32_t*)&indices[0], indices.GetCount() / 3, paramsVHACD);

ndInt32 hullCount = interfaceVHACD->GetNConvexHulls();
ndArray<ndVector> convexMeshPoints;
for (ndInt32 i = 0; i < hullCount; ++i)
{
VHACD::IVHACD::ConvexHull ch;
nd::VHACD::IVHACD::ConvexHull ch;
interfaceVHACD->GetConvexHull(i, ch);
convexMeshPoints.SetCount(ch.m_nPoints);
for (ndInt32 j = 0; j < ndInt32(ch.m_nPoints); ++j)
Expand Down
8 changes: 4 additions & 4 deletions newton-4.00/applications/ndSandbox/ndDemoEntityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ ndDemoEntityManager::ndDemoEntityManager ()
//m_showRaycastHit = true;
//m_showCenterOfMass = false;
//m_showNormalForces = true;
m_showContactPoints = true;
m_showJointDebugInfo = true;
m_showModelsDebugInfo = true;
//m_showContactPoints = true;
//m_showJointDebugInfo = true;
//m_showModelsDebugInfo = true;
//m_collisionDisplayMode = 2;
m_collisionDisplayMode = 3; // solid wire frame
//m_collisionDisplayMode = 3; // solid wire frame
//m_synchronousPhysicsUpdate = false;

Cleanup();
Expand Down
71 changes: 0 additions & 71 deletions newton-4.00/thirdParty/hacd/src/VHACD_Lib/cl/vhacdKernels.cl

This file was deleted.

Loading

0 comments on commit 3b4c100

Please sign in to comment.