Last active
August 3, 2020 16:04
-
-
Save BlueMagnificent/8cda69c726e9a9e6ebeafa8a3d6072a3 to your computer and use it in GitHub Desktop.
Javascript 3D Physics Tut 3 Setup Contact Pair Result Callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setupContactPairResultCallback(){ | |
cbContactPairResult = new Ammo.ConcreteContactResultCallback(); | |
cbContactPairResult.hasContact = false; | |
cbContactPairResult.addSingleResult = function(cp, colObj0Wrap, partId0, index0, colObj1Wrap, partId1, index1){ | |
let contactPoint = Ammo.wrapPointer( cp, Ammo.btManifoldPoint ); | |
const distance = contactPoint.getDistance(); | |
if( distance > 0 ) return; | |
this.hasContact = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment