Help with joints,dragging a point

I have a chain
All points are:

physics.newJoint( “distance”, link[#link], link[#link -1], link[#link].x,link[#link].y, link[#link-1].x,link[#link-1].y )

1 is free,2 links to 1,3 links to 2,and so…

I want to do the following effect.

When a touch the screen i want to start to drag the first point or the last and the rest follow the direction.

I think there is a “touch joint” but how do i change the type?
is that the way? [import]uid: 113117 topic_id: 23654 reply_id: 323654[/import]

Yes, you should use a touch joint for this. You won’t be changing the type of joint between link 1 and 2 of your chain. Instead you must create a NEW joint (touch joint) between link 1 and the “destination point” which will be your finger touch location (it can be any X/Y coordinate in fact).

You can then specify various attributes of the new touch joint, for example, how fast it will retract, thus drawing the chain end to that new point. Just remember, a touch joint is a somewhat odd but very useful Box2D joint… it doesn’t really require 2 bodies joined as with most other joints; instead you have to imagine that your target coordinate is, in itself, one of the “bodies”, but instead of creating/tracking an actual physical body for the touch destination, you just specify the *target* coordinate.

See here…
http://developer.anscamobile.com/content/game-edition-physics-joints

Brent Sorrentino
Ignis Design [import]uid: 9747 topic_id: 23654 reply_id: 95081[/import]

Ok working, but the dragging is elastic, i have been playing with maxForce and frequency but no way to make it rigid…

Sometimes elasticity is a kick in the ass. :slight_smile:
My joints are “distance” with really high density to avoid elasticity…but they still have.
Which is the set up for joints to work like a rope not like a chewing gum?

[import]uid: 113117 topic_id: 23654 reply_id: 95112[/import]

A non-stretching joint would be “pivot”. You can also place rotational limits on these, so neither end can rotate beyond a certain angle from “center”.

If you don’t want the dragging to be elastic, for example, if you want the user to “grab” one end of the chain and drag it directly, then I suggest you make each end of the chain into a touch-sensitive object (but the other chain links are not, obviously). Then use a standard touch-phase function to drag the chain end(s) around.

Brent
[import]uid: 9747 topic_id: 23654 reply_id: 95177[/import]