Page 1 of 1

### Soccer net and ball emulation problems

Posted: Tue Nov 24, 2020 10:32 pm
Hi:
I'm writing a soccer game use bullet now. But when write the goal net, I met some strange problem, Hope somebody can help me.
1. I use btMultiBody to simulate the ball, not btRigidBody, because I need use rolling friction. btRigidBody with rolling friction will not roll in straight line on a plane. Ball mass : 0.265, Ball radius : (0.221/2.0);
2. I make a test goal net for 2 meter X 2 meter, resolution 5 X 5, four corner fixed. code below:

const btScalar s=2;
m_ActorBaseInfo.pSoftBody = btSoftBodyHelpers::CreatePatch( *m_pGameParam->pSoftBodyWorldInfo,
btVector3(-s,2,+s),
btVector3(+s,2,+s),
btVector3(-s,2,-s),
btVector3(+s,2,-s),
5,5,//9,9,//31,31,
1+2+4+8,
true);
btSoftBody::Material* pm=m_ActorBaseInfo.pSoftBody->appendMaterial();
pm->m_kLST = 0.1;
pm->m_kAST = 0.1;
pm->m_kVST = 0.1;
pm->m_flags -= btSoftBody::fMaterial::DebugDraw;
m_ActorBaseInfo.pSoftBody->m_cfg.kDP = 0.2;
m_ActorBaseInfo.pSoftBody->m_cfg.kDF = 1;
m_ActorBaseInfo.pSoftBody->m_cfg.kSRHR_CL = 1;
m_ActorBaseInfo.pSoftBody->m_cfg.kSR_SPLT_CL = 0;
m_ActorBaseInfo.pSoftBody->m_cfg.collisions = btSoftBody::fCollision::CL_SS+btSoftBody::fCollision::CL_RS;
m_ActorBaseInfo.pSoftBody->generateBendingConstraints(2,pm);

m_ActorBaseInfo.pSoftBody->getCollisionShape()->setMargin(0.05);
m_ActorBaseInfo.pSoftBody->setTotalMass(1);
m_ActorBaseInfo.pSoftBody->setSpringStiffness(0.1);

m_ActorBaseInfo.pSoftBody->generateClusters(0);