Page 1 of 1

Soccer net and ball emulation problems

Posted: Tue Nov 24, 2020 10:32 pm
by touchtao
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,
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;



When I drop the ball above the net, the ball will not hold the ball, the ball will still fall on the ground. This is different with the result I use brRigidBody to simulate the ball. If I use the btRigidBody to simulate the ball , the goal net will hold the ball. Is something wrong with my code ?
3. When I use deformable-softbody to simulate the goal net, the net will hold the ball when ball fall above. But the FPS is very low, need too much CPU. So I just want to use the cluster softbody to simulate the net.

So the final question is : How to setup the softbody to simulate the goal net to hold the ball, with btMultiBody to simulate the ball, Cluster based softbody to simulate the net.
Please somebody to help me, thank you very much.