Bow ?

SniperBinaire

18-07-2010 17:32:31

Hi !
I'm making a scene situated 200 000 years ago, but i have a problem : How can I make a bow simulation ?
Is it possible with rigids bodies ?
Or must i use softbodies ?
Because i must use that for machinery like ballista, catapults or slingshots

So if you have some ideas to simulate that properly (and tweak the energy transmitted to the projectile)
It can be quite usefull

Kernle32DLL

18-07-2010 22:24:02

Without having much knowledge about NxOgre, I would say it should work simply by putting your projectile in the "throw-arm" of the catapult. If you apply force to the throw arm, it should "push" the projectile in the right direction, just like in real world. Kind of...

As for the bow, I think you could get away with locking the arrows rotation and bind it with a force bound joint to your bows string (build of joints as well). Now, all you have to do is drag the string, and let it go. The force joint should "break" if it reaches a certain limit (I would set it as low as possible).

I have to say tough that I don't know if NxOgre has force bound joints. If not, you must check when the arrow has reached the bows and, and detach it then.

betajaen

18-07-2010 22:37:20

I have to say tough that I don't know if NxOgre has force bound joints. If not, you must check when the arrow has reached the bows and, and detach it then.

It does, but I wouldn't do any of that. Remember in Physics engines you need to cheat a lot.

Just make it as simple as possible, it's an object fired from an angle. addForce or setLinearVelocity on the arrow would do it.

You could make the string from cloth, but I would rather just do a ManualObject Line strip; three points. At the top and bottom of the bow and where the end of the arrow is.

SniperBinaire

20-07-2010 12:58:49

So, ok for the string, but the main problem is the deformation of the bow, or the arm of my catapult

Thanks for ideas : put the arrow in my bow like in a machine, and then change his velocity to a given value and detach if at the same moment
Use of cloth is interesting, but i don't see why it is different of softbodies (if they are)

So the problem is how to deform th arm of my catapult or the very bow

You see ?

betajaen

20-07-2010 13:19:56

I would really try and avoid using anything complicated as that in the physics world. All it boils down to is a forces and velocity, which you can control directly via the addForce/setLinearVelocity to the projectile. Adding an extra layer of physics of strings or bending catapult arms is going to take hours of tweaking to get right.

Personally, I would put all of that in the animation part only (Bones, Manual Objects, perhaps even inflated cloth), but leave the actual firing of the projectile to very simple code.