Search found 345 matches

by William
Sun Oct 15, 2017 6:42 am
Forum: General Discussion
Topic: Collision detection bug/inaccuracy?
Replies: 9
Views: 127

Re: Collision detection bug/inaccuracy?

Can u post the code that doesn't work please? Which sample did you start with? Does the sample work before you modify it? What version of the library are you using?

We can only speculate what is wrong right now.

William
by William
Fri Oct 13, 2017 8:17 pm
Forum: General Discussion
Topic: Mass to restrict motion in one direction
Replies: 2
Views: 35

Re: Mass to restrict motion in one direction

Would the direction of allowed motion change? If so, is the change of direction controlled by user input? I think a valid constraint (Joint) would be the most stable, but that is definitely more effort if made to fit your specific need. You could probably get away with just copying the PrismaticJoin...
by William
Fri Oct 13, 2017 7:54 pm
Forum: General Discussion
Topic: Collision detection bug/inaccuracy?
Replies: 9
Views: 127

Re: Collision detection bug/inaccuracy?

I understand you may be frustrated, but it's difficult for us to offer help without more information. Zoom is correct, we need some way to replicate and the best way to do so would be through a code sample. Have you tried to run any of the samples here? https://github.com/wnbittle/dyn4j/tree/master/...
by William
Thu Oct 12, 2017 9:00 am
Forum: General Discussion
Topic: Collision detection bug/inaccuracy?
Replies: 9
Views: 127

Re: Collision detection bug/inaccuracy?

How is the player body controlled?

Can you supply the sizes and coordinates for the shapes when they are overlapping like this?

William
by William
Sun Oct 08, 2017 10:23 pm
Forum: General Discussion
Topic: StepListener...how?
Replies: 3
Views: 45

Re: StepListener...how?

You are probably better off using the StepAdapter class so you don't have to implement all the methods. Here's a simple example: /// defined elsewhere public class MyStepListener extends StepAdapter { private final Body body; public MyStepListener(Body body) { this.body = body; } public void...
by William
Wed Oct 04, 2017 8:55 pm
Forum: General Discussion
Topic: Listener when a body position is updated by World
Replies: 2
Views: 99

Re: Listener when a body position is updated by World

Can you provide more details about what you would use the information for? The reason I ask is that the physics engine may update a body's position every frame, so having that level of knowledge may not be sufficient to achieve your goal. On a simple level, you could store the position of the body e...
by William
Wed Sep 20, 2017 8:24 am
Forum: General Discussion
Topic: How to setup circular game bounds?
Replies: 1
Views: 123

Re: How to setup circular game bounds?

One option is extending the AbstractBounds class and implementing the isOutside method. You are given a collidable, which will have a list of fixtures. You would iterate those fixtures and check if they are all outside the circle. This can be done in a number of ways, but the easiest might be to cre...
by William
Mon Aug 07, 2017 6:17 pm
Forum: General Discussion
Topic: Get mesh points from shape
Replies: 2
Views: 198

Re: Get mesh points from shape

It will depend on the shape: Shapes that implement Wound will have getVertices() and getNormals() methods: Link, Segment, Polygon, Rectangle, Triangle. The other shapes; Circle, Ellipse, HalfEllipse, and Slice have curved features so technically have an infinite number of vertices. Each one is store...
by William
Tue Jul 25, 2017 6:27 pm
Forum: General Discussion
Topic: Concave Shapes "impossible"?
Replies: 9
Views: 2206

Re: Concave Shapes "impossible"?

@Angelli I don't think the number of polygons was the issue, but rather the shape of the polygons. Thin shapes can cause problems with physics engines - I can explain more if anyone is interested. I think the take away from this thread should be: ⋅ Concave shapes *are* possible in dyn4j by...
by William
Mon Jul 24, 2017 2:03 pm
Forum: General Discussion
Topic: Issues with Multiple Joined Bodies
Replies: 3
Views: 237

Re: Issues with Multiple Joined Bodies

Yeah, it will be difficult to determine the problem without some code. From your videos it looked like the 'barrels' where fixed to the body. In that case, why not just add them as extra fixtures? Is this what you are trying to do? You could probably do this much better, it's just a quick example. p...

Go to advanced search