Box2D Forums

It is currently Sat May 25, 2013 4:20 am

All times are UTC - 8 hours [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 261 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17, 18, 19 ... 27  Next
Author Message
 Post subject: Re: Box2D Java
PostPosted: Sat Aug 09, 2008 11:24 am 
Offline

Joined: Fri May 16, 2008 10:09 am
Posts: 337
Yeah the one remaining group of bugs in my program are a series of cases which occur in my dynamic breakage code which generates shapes that either have edges that are too short, or complex shapes which I believe mostly get handled correctly (just their area calculation becomes incorrect and could be a negative value), and there are possibly even more issues with it.

Problem is, I can hardly debug it because running box2d in debug mode causes a 10 to 100-fold decrease in performance and before I can reproduce any of these issues it slows down a LOT to the point where it is very difficult to do anything (sub 1 frame per second). One good thing is that I do use a fixed timestep so the behavior ought to be identical. I just gotta sit down one day and patiently smash things together when running in debug mode.


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Thu Oct 16, 2008 4:19 pm 
Offline

Joined: Tue Oct 14, 2008 11:27 pm
Posts: 14
Location: CA, USA
BTW. wouldn't it be a good idea to move discation to the sourceforge forums that came with the jBox2D project?


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Thu Oct 16, 2008 5:20 pm 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
I think it's better to stay here. Most questions are generic enough that it is experience with the engine that matters, rather than the specific language.
But JBox2D users, you really don't have to stick in this one thread. That would be a bit limiting.


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Fri Nov 14, 2008 1:19 am 
Offline

Joined: Thu Jul 03, 2008 7:58 am
Posts: 20
Location: Finland
Unless anybody objects, I suggest that the following classes and methods would be made public:
public class org.jbox2d.util.nonconvex.Triangle

For org.jbox2d.util.nonconvex.Polygon:
public boolean isCCW()
public Polygon add(Triangle t)

I'm using those for slightly customized convex decomposition code. With the edge chains I only use the decomposition results for rendering, so I modified the methods to ease the restrictions that are needed for Box2D usage. And yes, they're easy to change, but I don't see any reason why they couldn't be public, as they're utilities after all. :) Thanks!


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Fri Nov 14, 2008 10:40 am 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 803
mh114 wrote:
Unless anybody objects, I suggest that the following classes and methods would be made public:
public class org.jbox2d.util.nonconvex.Triangle

For org.jbox2d.util.nonconvex.Polygon:
public boolean isCCW()
public Polygon add(Triangle t)

I'm using those for slightly customized convex decomposition code. With the edge chains I only use the decomposition results for rendering, so I modified the methods to ease the restrictions that are needed for Box2D usage. And yes, they're easy to change, but I don't see any reason why they couldn't be public, as they're utilities after all. :) Thanks!

I have no problem with that, I'll put it into the next update.

Be aware, though, that the "add" method only merges the poly and triangle if they have two vertices that touch, and in particular it does not create a union; if I make it public, I may refactor it to change the name (and make sure the Javadoc is crystal clear on that point) so that there's no confusion.


Top
 Profile  
 
 Post subject: Ray casts
PostPosted: Tue Nov 18, 2008 4:28 am 
Offline

Joined: Mon Apr 28, 2008 3:07 am
Posts: 52
Hi everyone,
I'm just about to implement a laser weapon so I started scanning the forum about ray casting. Apart from the [AS3 contribution] by BorisTheBrave, the way described [here] seems to be the way to go.
Although the World.query(..) method is probably good enough for me already I was wondering if someone has already implemented Shape.TestSegment(...) in Java (of which currently only the out-commented signature can be found in the Java port svn repository).


Top
 Profile  
 
 Post subject: Re: Ray casts
PostPosted: Tue Nov 18, 2008 6:12 am 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 803
Boing wrote:
Hi everyone,
I'm just about to implement a laser weapon so I started scanning the forum about ray casting. Apart from the [AS3 contribution] by BorisTheBrave, the way described [here] seems to be the way to go.
Although the World.query(..) method is probably good enough for me already I was wondering if someone has already implemented Shape.TestSegment(...) in Java (of which currently only the out-commented signature can be found in the Java port svn repository).

Er...hehe. My bad.

I put those bits of code aside "for the moment" while updating to 2.0.1 because they're not entirely straightforward to translate (a float pointer is passed as a parameter to hold one of the results, so I have to create a RaycastResult holder class to do something similar in Java), and I completely and utterly forgot about going back to finish them up.

I'll try to do this before I do a full update with the things that have changed since 2.0.1, but it might be a couple weeks before I can get to it (I just took on a new contract this week so I'm pretty busy - gotta pay the bills once in a while!). I'll almost certainly port BorisTheBrave's raycasting contributions as well, since they make things very usable and quick.

That said, if anyone has already brought the code over, I'd happily include a patch, as long as it works.


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Tue Nov 18, 2008 6:17 am 
Offline

Joined: Mon Apr 28, 2008 3:07 am
Posts: 52
Sounds great - I'm really looking forward to trying out the stuff.
So long I wish you all the best for your other projects!


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Mon Dec 08, 2008 12:09 pm 
Offline

Joined: Mon Dec 08, 2008 12:05 pm
Posts: 3
Hi, i just started using your port for a little game I'm writing just for fun.
I'd like to help if i can, perhaps i can port that code for raycasting?


Top
 Profile  
 
 Post subject: Re: Box2D Java
PostPosted: Mon Dec 08, 2008 4:08 pm 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 803
freakypie wrote:
Hi, i just started using your port for a little game I'm writing just for fun.
I'd like to help if i can, perhaps i can port that code for raycasting?

If you'd like to give it a go, feel free - you'll need to implement the testSegment methods for the shapes as well, and figure out a decent approach to holding the results (the AS3 port probably does this the "right" way, though I haven't checked). I'm happy to take contributed code in, esp. since at the moment I have very little time to port myself (at least for the next few weeks).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 261 posts ]  Go to page Previous  1 ... 13, 14, 15, 16, 17, 18, 19 ... 27  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group