Marc wrote:Julio Jerez wrote:each body is bieng test against about 8 face of a hight filed,
That would not be a problem, but because the hightfirls is bigger that the AABB of the shape, the collision test is failing and resulting to a more expensive contact calculation that also fail buit waste lots of time.
Hmm, maybe then, it#s not actually your fault but mine. Instead for returning the 8 faces that lie instied the 2d x,y box of collideDesc->m_boxPX, I could as well check for the height of the triangle vertices and retrun only those that are within the collideDesc->m_boxPX[2] interval. I guess that'ld be a little bit more efficient than letting newton always calculate the bounding box around the returned triangles and do that test. I'll try that.
If you are going to do that, you might try the HightField shape, unless you have soem other reasons for using a custom one.
The build is has all those checks aready and planty of precomputes values.
Plus it also has a channel that tell the engine edge information for producing smother collision,
edge can be convex, flat or concave, with the user collision that channel is set to Convex all edges are treated as convex,
meaning they will be par of the collision, but if an edge is concave it can be removed from collision resolution, and if an edge is flat in can be replaced with the face normal.
this preduces moch high quality contact resolution by the solver.