use of spacegraph.space3d.phys.collision.broad.CollisionAlgorithm in project narchy by automenta.
the class ConvexTriangleCallback method processTriangle.
@Override
public void processTriangle(v3[] triangle, int partId, int triangleIndex) {
// just for debugging purposes
// printf("triangle %d",m_triangleCount++);
// aabb filter is already applied!
ci.intersecter1 = intersecter;
Collidable ob = triBody;
if (convexBody.shape().isConvex()) {
tm.init(triangle[0], triangle[1], triangle[2]);
tm.setMargin(collisionMarginTriangle);
CollisionShape tmpShape = ob.shape();
ob.internalSetTemporaryCollisionShape(tm);
CollisionAlgorithm colAlgo = ci.intersecter1.findAlgorithm(convexBody, triBody, manifoldPtr);
// this should use the btDispatcher, so the actual registered algorithm is used
// btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody);
resultOut.setShapeIdentifiers(-1, -1, partId, triangleIndex);
// cvxcvxalgo.setShapeIdentifiers(-1,-1,partId,triangleIndex);
// cvxcvxalgo.processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut);
colAlgo.processCollision(convexBody, triBody, dispatchInfoPtr, resultOut);
// colAlgo.destroy();
Intersecter.freeCollisionAlgorithm(colAlgo);
ob.internalSetTemporaryCollisionShape(tmpShape);
}
}
Aggregations