void btSoftRigidDynamicsWorld::internalSingleStepSimulation(btScalar timeStep)
{
	// Let the solver grab the soft bodies and if necessary optimize for it
	m_softBodySolver->optimize(getSoftBodyArray());

	if (!m_softBodySolver->checkInitialized())
	{
		btAssert("Solver initialization failed\n");
	}

	btDiscreteDynamicsWorld::internalSingleStepSimulation(timeStep);

	///solve soft bodies constraints
	solveSoftBodiesConstraints(timeStep);

	//self collisions
	for (int i = 0; i < m_softBodies.size(); i++)
	{
		btSoftBody* psb = (btSoftBody*)m_softBodies[i];
		psb->defaultCollisionHandler(psb);
	}

	///update soft bodies
	m_softBodySolver->updateSoftBodies();

	// End solver-wise simulation step
	// ///////////////////////////////
}
Ejemplo n.º 2
0
void	btSoftRigidDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
{
	btDiscreteDynamicsWorld::internalSingleStepSimulation( timeStep );

	///solve soft bodies constraints
	solveSoftBodiesConstraints();

	///update soft bodies
	updateSoftBodies();

}
void	btSoftRigidDynamicsWorld::internalSingleStepSimulation( btScalar timeStep)
{
	btDiscreteDynamicsWorld::internalSingleStepSimulation( timeStep );

	///solve soft bodies constraints
	solveSoftBodiesConstraints();

	//self collisions
	for ( int i=0;i<m_softBodies.size();i++)
	{
		btSoftBody*	psb=(btSoftBody*)m_softBodies[i];
		psb->defaultCollisionHandler(psb);
	}

	///update soft bodies
	updateSoftBodies();

}