Skip to content

sbConfig.set_collisions() #424

@sdarpeng

Description

@sdarpeng
                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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions