mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-09-15 14:54:28 +00:00
add tree updates in predict motion.
This commit is contained in:
@@ -183,7 +183,7 @@ void FreeFall::initPhysics()
|
||||
}
|
||||
// create a static rigid box as the ground
|
||||
{
|
||||
btBoxShape* groundShape = createBoxShape(btVector3(btScalar(5.), btScalar(5.), btScalar(0.5)));
|
||||
btBoxShape* groundShape = createBoxShape(btVector3(btScalar(3.), btScalar(3.), btScalar(0.1)));
|
||||
m_collisionShapes.push_back(groundShape);
|
||||
|
||||
btTransform groundTransform;
|
||||
|
||||
@@ -26,6 +26,8 @@ void btReducedSoftBodySolver::predictMotion(btScalar solverdt)
|
||||
|
||||
// predict new mesh location
|
||||
predictReduceDeformableMotion(solverdt);
|
||||
|
||||
//TODO: check if there is anything missed from btDeformableBodySolver::predictDeformableMotion
|
||||
}
|
||||
|
||||
void btReducedSoftBodySolver::predictReduceDeformableMotion(btScalar solverdt)
|
||||
@@ -76,6 +78,13 @@ void btReducedSoftBodySolver::predictReduceDeformableMotion(btScalar solverdt)
|
||||
// update bounding box
|
||||
rsb->updateBounds();
|
||||
|
||||
// update tree
|
||||
rsb->updateNodeTree(true, true);
|
||||
if (!rsb->m_fdbvt.empty())
|
||||
{
|
||||
rsb->updateFaceTree(true, true);
|
||||
}
|
||||
|
||||
// std::cout << "bounds\n";
|
||||
// std::cout << rsb->m_bounds[0][0] << '\t' << rsb->m_bounds[0][1] << '\t' << rsb->m_bounds[0][2] << '\n';
|
||||
// std::cout << rsb->m_bounds[1][0] << '\t' << rsb->m_bounds[1][1] << '\t' << rsb->m_bounds[1][2] << '\n';
|
||||
|
||||
Reference in New Issue
Block a user