btSoftBody and btGImpactMeshShape

nicolasft
Posts: 1
Joined: Fri Dec 18, 2015 3:49 pm

btSoftBody and btGImpactMeshShape

Post by nicolasft »

Hi guys,
i'm using bullet-2.82-r2704 on iOS and i'm trying to get collision from a soft body created with this function:

Code: Select all

btSoftBodyHelpers::CreateFromConvexHull(*softWorldInfo, _hull->getPoints(), _hull->getNumPoints(), false);
and a non convex rigid body created with this other one:

Code: Select all

 _body = new btRigidBody(bodyMass, motionState, ((btGImpactMeshShape *)_shape), bodyInertia);
Now, is possible to have a collision between these objects? Because i had successful collision between my soft body and a rigid ground shape create like this:

Code: Select all

btCollisionShape* groundShape = new btBoxShape(btVector3(300,2.0,300));
btDefaultMotionState* groundState = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1), btVector3(0,0.0,0)));
groundRB = new btRigidBody(0, groundState, groundShape, btVector3(0,0,0));
My soft body have these configuration:

Code: Select all

    btSoftBody::Material* pm = _body->appendMaterial();
pm->m_kLST = 1.0f;
pm->m_kAST = 0.1f;
pm->m_kVST = 0.1f;
    
_body->m_cfg.collisions = btSoftBody::fCollision::CL_SS + btSoftBody::fCollision::CL_RS; //|= btSoftBody::fCollision::VF_SS; //
    
_body->generateClusters(20);
_body->randomizeConstraints();
_body->generateBendingConstraints(2);
_body->getCollisionShape()->setMargin(0.1);
    
_body->transform(transform);
_body->setTotalMass(mass, true);
_body->setUserPointer((__bridge void*)self);
Thank you