## NewtonMesh

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

### NewtonMesh

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

Help improving the Newton Game Dynamics WIKI

JernejL

Posts: 1521
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

### Re: NewtonMesh

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

I will try to re enable it with next commit.
Julio Jerez
Moderator

Posts: 11086
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

### Re: NewtonMesh

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

JernejL

Posts: 1521
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

### Who is online

Users browsing this forum: No registered users and 36 guests