I would like to know if it is possible (and it really should be :p) to add force on an object when clicking on it, with this force beeing relative to the camera. Actually, i got in my scene a snooker and i would like it to be a bit interractive. I’ve managed so far to make every balls dynamics, i can click on the cue ball to make it go in the x direction to hit other balls, but the problem is that since i only use logic boxes i can’t hit the cue ball to make it go the direction i’m looking at.
The snooker is not the main element in my scene, i’d only like to make this possible to make the scene more friendly. I think i’ll have to make this with some python but the fact is that i don’t know how to do this. So after beeing doing some vain research i come here to ask if someone can help me.
I assume you want the balls rolling around. You should use rigid body rather than dynamic ;).
Anyway, you are right that you need python. Hereis a quick and dirty demo:
You can also check other demos. There was a very old one in 2.42 BulletPhysics…something
or
you can look at the first person shooter demos. They use impulses too.
This demo has a glitch in applying the forces. But I have no time to check that right now.
The API says applyImpulse uses world coordinates for the point of impact. That is not true it uses local coordinates. So the point must be converted first.
Thank u very much for your quick and detailed answer I’ll check this soon and will give you feedback.
You’r right for the rigid body, i’ve actually used the rigid body but meant dynamic in the idea that balls are dynamic ; the opposite of static