NewtonMesh

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonMesh

Postby MeltingPlastic » Mon Jul 09, 2018 6:48 pm

Hi Julio,

Code: Select all
dgCollisionInstance* dgMeshEffect::CreateCollisionTree(dgWorld* const world, dgInt32 shapeID)


Is commented out. Are there plans for re-enabling it? Or will it be phased out?

NewtonMesh generally seems like a good data structure for holding collision data before its converted into a NewtonCollision. I am hoping to use the same NewtonMesh to generate TreeCollisions as well as Compounds and Single Convex Hulls.
MeltingPlastic
 
Posts: 221
Joined: Fri Feb 07, 2014 11:30 pm

Re: NewtonMesh

Postby JernejL » Tue Jul 10, 2018 10:33 am

Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1492
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: NewtonMesh

Postby MeltingPlastic » Tue Jul 10, 2018 11:24 am

Yes - sorry for the confusion - NewtonCreateTreeCollisionFromMesh is the function I want to call yes. But that function calls CreateCollisionTree which is commented out and simply returns null in its definition:
Code: Select all
dgCollisionInstance* dgMeshEffect::CreateCollisionTree(dgWorld* const world, dgInt32 shapeID) const
{
dgAssert(0);
return NULL;
/*
   dgCollisionBVH* const collision = new  (GetAllocator()) dgCollisionBVH (world);

   collision->BeginBuild();

   dgInt32 mark = IncLRU();
   dgPolyhedra::Iterator iter (*this);
   for (iter.Begin(); iter; iter ++){
      dgEdge* const face = &(*iter);
      if ((face->m_mark != mark) && (face->m_incidentFace > 0)) {
         dgInt32 count = 0;
         dgVector polygon[256];
         dgEdge* ptr = face;
         do {
            polygon[count] = dgVector (m_points[ptr->m_incidentVertex]);
            polygon[count].m_w = dgFloat32 (0.0f);
            count ++;
            ptr->m_mark = mark;
            ptr = ptr->m_next;
         } while (ptr != face);
         collision->AddFace(count, &polygon[0].m_x, sizeof (dgVector), dgInt32 (m_attrib[face->m_userData].m_material));
      }
   }
   collision->EndBuild(0);

   dgCollisionInstance* const instance = world->CreateInstance(collision, shapeID, dgGetIdentityMatrix());
   collision->Release();
   return instance;
*/
}
MeltingPlastic
 
Posts: 221
Joined: Fri Feb 07, 2014 11:30 pm

Re: NewtonMesh

Postby Julio Jerez » Tue Jul 10, 2018 12:39 pm

I will try to re enable it with next commit.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonMesh

Postby JernejL » Thu Jul 12, 2018 1:21 am

I didn't realise this was disabled in current trunk, i rely on this functions too in order to use same shapes for dynamic or static map objects.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1492
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests