I’m fairly new to 3D and the math that are used to calculate certain type of behaviors.
For example I’m trying to find a way to use applyImpulse with a force (first param) that will throw a sphere in the direction of a goal (a mesh) knowing that my camera is locked (using camera.target) on this goal.
I also want to be able to control the “power” of the impulse (don’t know what is the dedicated physics word). For that matter I use the time between space bar press and release to get a number that I will use as a multiplier when I will be able to calculate the force mentionned above.
Currently I think I know which data to start with (maybe camera.position and camera.getTarget()) but, as I’m really weak in math, I can’t figure out what to do with those data.
If someone has an idea or an hint to share that would be really helpful
I’m not sure it will help but here is the current state of my project of a basket ball minigame for which I want to implement the calculation explained above Babylon Template
My question in few words : How to calculate the force (first parameter of applyImpulse) in order to throw an object towards another ? ( and how to apply a variable “power” to the resulting vector )