n5ro / aframe-physics-system

Physics system for A-Frame VR, built on CANNON.js.
https://n5ro.github.io/aframe-physics-system/
MIT License
505 stars 136 forks source link

Getting the impulse force from a collision? (Ammo) #188

Open vtrykoz opened 3 years ago

vtrykoz commented 3 years ago

How to get collision impact force from a-frame using ammo.js driver? I'm trying to bind sound volume to collision force. And as I can see, currently collidestart and collideend only provides source and target entities, not much info about collision.

mackbjon commented 3 years ago

Assuming you're checking for collision on every tick, could you store velocity vector for objects on every tick and just calculate from momentum on tick before collision? Though there might be easier/more intuitive way to accomplish this.