Fixed joint

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Araqiel
Citizen
Posts: 54
Joined: Sat Oct 30, 2010 7:33 pm

Fixed joint

Post by Araqiel »

Is there a way to create a joint where the two attached bodies can't move at all relative to each other?

I suppose I could hack it by trying to supply 0,0 for the axis of a prismatic joint, or combining a prismatic joint with a distance joint... but neither of these are very elegant.

The most rigidity I can get, the better. I may just end up making a work-around...
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Fixed joint

Post by Ryne »

I'm sure Taehl might be able to help you, or you could try looking at his code I guess. He's been working on a game based around plant growth. It works with joints, similar to what you're looking for.

http://love2d.org/forums/viewtopic.php?f=5&t=2244
@rynesaur
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Fixed joint

Post by Robin »

@Ryne: I don't think those plants use physics…
Araqiel wrote:Is there a way to create a joint where the two attached bodies can't move at all relative to each other?

I suppose I could hack it by trying to supply 0,0 for the axis of a prismatic joint, or combining a prismatic joint with a distance joint... but neither of these are very elegant.
Or a PrismaticJoint and a RevoluteJoint? They are each other's complement, so I think it is less hackish than the other ways, albeit far from elegant.
Last edited by Robin on Sat Dec 18, 2010 8:56 am, edited 1 time in total.
Help us help you: attach a .love.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Fixed joint

Post by Taehl »

Nope, my plants are physics-less. At about 200 pieces per plant, Box2D probably wouldn't be able to keep up, anyway.

As far as a physics-based solution for that... Hm. Well, I haven't used the physics engine much, but couldn't you just attach both of the objects to a rectangle which is invisible and doesn't collide with anything?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Fixed joint

Post by Robin »

Taehl wrote:As far as a physics-based solution for that... Hm. Well, I haven't used the physics engine much, but couldn't you just attach both of the objects to a rectangle which is invisible and doesn't collide with anything?
Then the problem remains, doesn't it?
Instead of object a <-> object b, you suggest doing object a <-> rectangle <-> object b, where "<->" is a way of jointing together two things without allowing any —

Wait. Wait a minute.

Araqiel: two attached bodies you say? Do they have to split apart at one point? If not, why not use a single body? You can attach more than one shape to a body, IIRC.
Help us help you: attach a .love.
Araqiel
Citizen
Posts: 54
Joined: Sat Oct 30, 2010 7:33 pm

Re: Fixed joint

Post by Araqiel »

Yeah, I finally decided that it'd work to use one body and multiple collision shapes. When they need to split, just break that piece off into its own body.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], keharriso and 78 guests