void btGImpactCollisionAlgorithm::convex_vs_convex_collision(
	const btCollisionObjectWrapper* body0Wrap,
	const btCollisionObjectWrapper* body1Wrap,
	const btCollisionShape* shape0,
	const btCollisionShape* shape1)
{
	m_resultOut->setShapeIdentifiersA(m_part0, m_triface0);
	m_resultOut->setShapeIdentifiersB(m_part1, m_triface1);

	btCollisionObjectWrapper ob0(body0Wrap, shape0, body0Wrap->getCollisionObject(), body0Wrap->getWorldTransform(), m_part0, m_triface0);
	btCollisionObjectWrapper ob1(body1Wrap, shape1, body1Wrap->getCollisionObject(), body1Wrap->getWorldTransform(), m_part1, m_triface1);
	checkConvexAlgorithm(&ob0, &ob1);
	m_convex_algorithm->processCollision(&ob0, &ob1, *m_dispatchInfo, m_resultOut);
}
Ejemplo n.º 2
0
void btGImpactCollisionAlgorithm::convex_vs_convex_collision(
	btDispatcher* dispatcher,
	const btCollider* body0,
	const btCollider* body1,
	const btCollisionShape* shape0,
	const btCollisionShape* shape1
)
{
	const btCollisionShape* tmpShape0 = body0->getCollisionShape();
	const btCollisionShape* tmpShape1 = body1->getCollisionShape();

	btCollider new0(body0, tmpShape0, body0->getCollisionObject(), body0->getWorldTransform());
	btCollider new1(body1, tmpShape1, body1->getCollisionObject(), body1->getWorldTransform());

	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);
	btCollisionProcessInfo processInfo(new0, new1, *m_dispatchInfo, m_resultOut, dispatcher);
	checkConvexAlgorithm(dispatcher, &new0, &new1);
	m_convex_algorithm->processCollision(processInfo);
}
void btGImpactCollisionAlgorithm::convex_vs_convex_collision(
					  btCollisionObject * body0,
					  btCollisionObject * body1,
					  btCollisionShape * shape0,
					  btCollisionShape * shape1)
{

	btCollisionShape* tmpShape0 = body0->getCollisionShape();
	btCollisionShape* tmpShape1 = body1->getCollisionShape();
	
	body0->internalSetTemporaryCollisionShape(shape0);
	body1->internalSetTemporaryCollisionShape(shape1);


	m_resultOut->setShapeIdentifiersA(m_part0,m_triface0);
	m_resultOut->setShapeIdentifiersB(m_part1,m_triface1);

	checkConvexAlgorithm(body0,body1);
	m_convex_algorithm->processCollision(body0,body1,*m_dispatchInfo,m_resultOut);

	body0->internalSetTemporaryCollisionShape(tmpShape0);
	body1->internalSetTemporaryCollisionShape(tmpShape1);

}