Created
August 3, 2020 13:35
-
-
Save BlueMagnificent/ec2687c17e8d08fd1cab2597333c6c66 to your computer and use it in GitHub Desktop.
Javascript 3D Physics Tut 3 Jump
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 jump(){ | |
cbContactPairResult.hasContact = false; | |
physicsWorld.contactPairTest(ball.userData.physicsBody, redTile.userData.physicsBody, cbContactPairResult); | |
if( !cbContactPairResult.hasContact ) return; | |
let jumpImpulse = new Ammo.btVector3( 0, 15, 0 ); | |
let physicsBody = ball.userData.physicsBody; | |
physicsBody.setLinearVelocity( jumpImpulse ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment