Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbConfig.set_collisions() #424

Open
sdarpeng opened this issue Oct 21, 2023 · 0 comments
Open

sbConfig.set_collisions() #424

sdarpeng opened this issue Oct 21, 2023 · 0 comments

Comments

@sdarpeng
Copy link

                const softBodyHelpers = new Ammo.btSoftBodyHelpers();
                const clothCorner00 = new Ammo.btVector3( clothPos.x, clothPos.y + clothHeight, clothPos.z );
                const clothCorner01 = new Ammo.btVector3( clothPos.x, clothPos.y + clothHeight, clothPos.z - clothWidth );
                const clothCorner10 = new Ammo.btVector3( clothPos.x, clothPos.y, clothPos.z );
                const clothCorner11 = new Ammo.btVector3( clothPos.x, clothPos.y, clothPos.z - clothWidth );
                const clothSoftBody = softBodyHelpers.CreatePatch( physicsWorld.getWorldInfo(), clothCorner00, clothCorner01, clothCorner10, clothCorner11, clothNumSegmentsZ + 1, clothNumSegmentsY + 1, 0, true );
                const sbConfig = clothSoftBody.get_m_cfg();
                clothSoftBody.generateClusters(40,80);
                sbConfig.set_viterations( 10 );
                sbConfig.set_piterations( 20 );
                clothSoftBody.setTotalMass( 1, false );
                sbConfig.set_collisions(0x0001);

on the bullet src, I found the following options ot the set_collisions() like this.

        RVSmask    =    0x000f,    ///Rigid versus soft mask
        SDF_RS    =    0x0001,    ///SDF based rigid vs soft
        CL_RS    =    0x0002, ///Cluster vs convex rigid vs soft

        SVSmask    =    0x0030,    ///Rigid versus soft mask        
        VF_SS    =    0x0010,    ///Vertex vs face soft vs soft handling
        CL_SS    =    0x0020, ///Cluster vs cluster soft vs soft handling
        CL_SELF =    0x0040, ///Cluster soft body self collision
        /* presets    */ 
        Default    =    SDF_RS,

While I tried all the options, I found only default SDF_RS and CL_RS works, other option doesn't work. Do somebody know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant