Hello!
I would like to create a slingshot simulation using Box2D. I currently have everything in place up until the launch of the projectile. Here is an outline of what happens up until the projectile is launched:
The mouse button clicks down (hold) on the slingshot.
A projectile graphics object is created but no physics object is created.
The mouse is dragged backwards and the projectile follows.
The mouse button is released.
A body and shape is then created and connected to the projectile.
After the physics object is created it currently just drops to the ground. I want to use Hooke's Law to apply a force to the projectile based upon the distance it was dragged backwards. I have tried using the "ApplyForce" function to the body but I can't see any visible reaction to the force. Any ideas on how I should implement this? Thanks!
I would like to create a slingshot simulation using Box2D. I currently have everything in place up until the launch of the projectile. Here is an outline of what happens up until the projectile is launched:
The mouse button clicks down (hold) on the slingshot.
A projectile graphics object is created but no physics object is created.
The mouse is dragged backwards and the projectile follows.
The mouse button is released.
A body and shape is then created and connected to the projectile.
After the physics object is created it currently just drops to the ground. I want to use Hooke's Law to apply a force to the projectile based upon the distance it was dragged backwards. I have tried using the "ApplyForce" function to the body but I can't see any visible reaction to the force. Any ideas on how I should implement this? Thanks!