Hi all! This is my first post in this forum, so please let me know if I'm doing something wrong.
I'm working on a prototype for a game that heavily relies on rope physics. Here is the first version in Processing:
(Hold down the lmb to attract the rope)
http://openprocessing.org/visuals/?visualID=36642
I'm pretty satisfied with this implementation for the most part. I'm just wondering how to make it follow the mouse more closely. Currently the first section of the rope is attached to the mouse with a mouseJoint, and playing with the spring's maxForce and damping hasn't really done much; it always lags a little behind the mouse's motions. I've also tried manually attaching the rope to the mouse with setXForm, but that just moves the first body the others don't react for some reason.
(A lot of the code is taken from Dan Shiffman's pbox2d tutorial)
Any help would be appreciated,
Thanks
EDIT: I also realized that collisions with this current implementation are broken; the distance joints pass right through other bodies. Is there any way to detect collisions for the distance joints themselves?
EDIT2: Replaced the link with an improved version of the sketch.
I'm working on a prototype for a game that heavily relies on rope physics. Here is the first version in Processing:
(Hold down the lmb to attract the rope)
http://openprocessing.org/visuals/?visualID=36642
I'm pretty satisfied with this implementation for the most part. I'm just wondering how to make it follow the mouse more closely. Currently the first section of the rope is attached to the mouse with a mouseJoint, and playing with the spring's maxForce and damping hasn't really done much; it always lags a little behind the mouse's motions. I've also tried manually attaching the rope to the mouse with setXForm, but that just moves the first body the others don't react for some reason.
(A lot of the code is taken from Dan Shiffman's pbox2d tutorial)
Any help would be appreciated,
Thanks
EDIT: I also realized that collisions with this current implementation are broken; the distance joints pass right through other bodies. Is there any way to detect collisions for the distance joints themselves?
EDIT2: Replaced the link with an improved version of the sketch.