Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created November 24, 2022 05:20
Embed
What would you like to do?
function shoot () {
const ballInstance = bullet.createInstance("ballInstance");
ballInstance.position.copyFrom(reticle.getAbsolutePosition());
ballInstance.physicsImpostor = new BABYLON.PhysicsImpostor(ballInstance, BABYLON.PhysicsImpostor.SphereImpostor, { mass: 1, friction: 0.2, restitution: 0.2 });
ballInstance.applyImpulse(ray.direction.scale(impulseMagnitude), bullet.getAbsolutePosition().add(contactLocalRefPoint));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment