Skip to content

Instantly share code, notes, and snippets.

@FyiurAmron
Created January 18, 2018 02:10
Show Gist options
  • Save FyiurAmron/3fa2d6b55fd96e50a6cce93f5859f680 to your computer and use it in GitHub Desktop.
Save FyiurAmron/3fa2d6b55fd96e50a6cce93f5859f680 to your computer and use it in GitHub Desktop.
private void filterContactPoints( btCollisionObject bco, btCollisionShape bcs ) {
if ( bcs instanceof btTriangleShape ) {
HashSet<btPersistentManifold> manifolds = manifoldMap.get( bco );
for( btPersistentManifold bpm : manifolds ) {
if ( bpm.getNumContacts() == CONTACTS_TO_FILTER ) { // otherwise it's probably *not* an tri edge collision
bpm.removeContactPoint(
( bpm.getContactPoint( 0 ).getDistance() > bpm.getContactPoint( 1 ).getDistance() ) ? 0 : 1 );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment