Search found 6 matches

by iimurpyh
Wed Feb 12, 2020 11:53 pm
Forum: Support and Development
Topic: Shape:getPoints() behaves weird with multiple fixtures/shapes in a body [SOLVED]
Replies: 2
Views: 1945

Re: Shape:getPoints() behaves weird with multiple fixtures/shapes in a body

Once you make the shape part of the second body, the first body is meaningless and needs to be destroyed. But you were using it for calculations during draw, which is why it didn't work for you. box1.body:destroy() box1.body = box2.body Adding that at the end of Weld(), it draws properly for me. Th...
by iimurpyh
Wed Feb 12, 2020 10:33 pm
Forum: Support and Development
Topic: Shape:getPoints() behaves weird with multiple fixtures/shapes in a body [SOLVED]
Replies: 2
Views: 1945

Shape:getPoints() behaves weird with multiple fixtures/shapes in a body [SOLVED]

This is somewhat related to my last two posts because it's about making two box2d bodies act like one, but this is a separate issue so I thought it deserved its own thread. Since there is no getPosition() function for shapes, I've had to get their x/y positions using the points provided by Fixture:g...
by iimurpyh
Mon Feb 10, 2020 9:48 pm
Forum: Support and Development
Topic: Fixture:GetBoundingBox gives irrational results [SOLVED]
Replies: 2
Views: 1711

Fixture:GetBoundingBox gives irrational results [SOLVED]

I'm using Fixture:GetBoundingBox to get the position of rectangular fixtures, but the results of GetBoundingBox are very inaccurate to the actual position of its bounding box. Here is the code I'm using to get fixture position: -- v is a table containing body, fixture, and shape tx, ty, bx, by = v.b...
by iimurpyh
Sat Feb 08, 2020 9:13 pm
Forum: Support and Development
Topic: How to avoid "springy-ness" with WeldJoints? [SOLVED]
Replies: 3
Views: 1945

Re: How to avoid "springy-ness" with WeldJoints?

To make them act as one body, make them actually one body (by attaching the fixture to a single body) or, if you won't move them at all, make them static. It seems like setting one object's body to the other object's causes the first to teleport to the second's center. How should I avoid this? Edit...
by iimurpyh
Wed Feb 05, 2020 10:29 pm
Forum: Support and Development
Topic: How to avoid "springy-ness" with WeldJoints? [SOLVED]
Replies: 3
Views: 1945

How to avoid "springy-ness" with WeldJoints? [SOLVED]

When making weldjoints between objects, they act very springy and not at all 'as one body,' like you'd expect welded joints to be. Here's a GIF to show what I mean: https://i.gyazo.com/dee346bc7b125107bf8c762ecda42306.gif I know this can be avoided with some combination of DampingRatio and Frequency...
by iimurpyh
Tue Feb 04, 2020 1:06 am
Forum: General
Topic: Any libs for collision detection that don't work like bump.lua?
Replies: 2
Views: 3495

Any libs for collision detection that don't work like bump.lua?

What I mean by title is a collision detection library that dosen't require every bounding box of everything in the scene to be defined beforehand. I'd perfer one where you can just call a single function with the coords/width/height/whatever of two shapes and get a bool for whether or not they're co...