Arrow flying simulation

Quote:
I'm making arrow from two bodies - rectangle with density=1 and circle with density=10, which are connected with revolute joint


Have you tryed with a compound shape instead two bodies connected??
Do you want to share the source, please? I need to make a similar arrow implementation like this.
Thanks
Yeah, I've attached simple project with this simulation. There is no need to have arrow-head since it's not affects to arrow's behavior.
While arrow is flying, it's rotation depends on linear velocity. After collision with walls you shouldn't control it's rotation manually, otherwise an arrow begins to jitter.

The project is written in Flex Builder, but it can easily be adjusted to Flash IDE.
Thanks, you rock!
island wrote:
Yeah, I've attached simple project with this simulation. There is no need to have arrow-head since it's not affects to arrow's behavior.
While arrow is flying, it's rotation depends on linear velocity. After collision with walls you shouldn't control it's rotation manually, otherwise an arrow begins to jitter.

The project is written in Flex Builder, but it can easily be adjusted to Flash IDE.


Can't be arsed to "adjust" it to Flash IDE but that sounds awfully hacky - i never like solutions that work in some cases and not in others - although I'm new in Box2D the most reasonably sounding solution to me would be 2 bodies (a head and ze feathers) linked with a ... i assume its the "Prismatic Joint" judging from the manual - and apply more linear damping to the feather objects - so that it falls slower not because of it's weight - but our simulated "air friction".

If someone already noted this solution than my appologies - I'm blind on one eye and the other one is made of glass......
NWoo: This would work, but it is still not physically accurate. The real feathers have different amount of air resistance when facing different directions, which would mean your arrow would feel more drag (i.e. travel in a less perfect parabola) than a real arrow. There might be a happy compromise, of course, but why bother. (Or you could use one of my Controllers which provides direction dependent damping).
Heh, perhaps - but I'm just trying to combat a solution of manually rotating the arrow depending on the general velocity Then stopping when it hits something.
But indeed, your controler solution seems much more fancy and I shall gladely give it a look myself!
Woah you did water - I was just thinking about where to get or how to make that effect - sweeeeeet - you rule dude 😀
Hey guys your arrows don't look prety good. I think I've got something better. I'm calculating angle between older and actual arrow position and after make arrow rotate to this angle. (sorry for my english I hope it is clear:) )
C++ code
Code:
GLfloat x = oldx -b2Body->GetPosition().x;
GLfloat y =oldy - b2Body->GetPosition().y;
GLfloat angle = atan((-y)/sqrt(x*x));
if (oldx < b2Body->GetPosition().x){
   angle-=PI;
   angle*=(-1);
}
b2Body->ApplyTorque((b2Body->GetAngle()-angle)/100);

oldx = b2Body->GetPosition().x;
oldy = b2Body->GetPosition().y;

Original thread: https://box2d.org/forum/viewtopic.php?t=1549