Search found 6 matches

by Kir
Thu Dec 22, 2016 11:55 pm
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Re: Rotation of a body around custom point.

I finally figured out how to handle multiple fixtures (felt a bit oblivious) and tried that by creating a body with two shapes. I'll play around with the density to see what approach works better.
Thanks again for the help.
by Kir
Thu Dec 22, 2016 9:16 pm
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Re: Rotation of a body around custom point.

I just realized that there might have been some confusion, because I was talking about moving the center of mass and applying Force/Torque. I wanted to move the center of mass, because the "back" is much heavier than the front and the applyTorque() is needed, because the object is able to ...
by Kir
Thu Dec 22, 2016 8:05 am
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Re: Rotation of a body around custom point.

I should have been more precise. The center of mass is not exactly on the edge, but very close to it. Two fixtures like you said should work and it's what I'm currently trying. I just haven't got it to work yet, because I'm not completely sure how to add two fixtures to a body or I'm missing somethi...
by Kir
Thu Dec 22, 2016 7:33 am
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Re: Rotation of a body around custom point.

That's completely fine. All I want is the center of mass to be not in the center of the rectangle and let the physics simulation do its thing. I am actually trying to replicate a real life scenario.
by Kir
Thu Dec 22, 2016 6:51 am
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Re: Rotation of a body around custom point.

I'm aware of that, but I haven't found a way to do so. Is there a way to change the center of mass? I can get its center, but I haven't found a way to set it. Body:setMassData( x, y, mass, inertia ) seems like a function that would do so, since x and y are the center of mass positions, but picking a...
by Kir
Thu Dec 22, 2016 5:11 am
Forum: Support and Development
Topic: Rotation of a body around custom point.
Replies: 18
Views: 10216

Rotation of a body around custom point.

Hi, I couldn't find anything on this other than one solution that wasn't satisfying. I want to rotate a rectangle body, but not around its center. I want to rotate it around one of its short edges. A proposed solution here in the forum was changing something in the love.draw call for the rectangle/i...