Skip to content

Instantly share code, notes, and snippets.

@kvakes
Created July 10, 2012 18:26
Show Gist options
  • Save kvakes/3085335 to your computer and use it in GitHub Desktop.
Save kvakes/3085335 to your computer and use it in GitHub Desktop.
RunnerPlayer.prototype.isOnTheGround = function() {
var from = this.getPosition(),
to = [from[0], from[1] - 1, from[2]];
var resultCallback = new Ammo.AllHitsRayResultCallback(from, to);
this.game.context.physics.dynamicsWorld.rayTest(from, to, resultCallback);
console.log(resultCallback.hasHit());
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment