Code Monkey home page Code Monkey logo

jbox2d's People

Contributors

dmurph avatar ewjordan avatar samskivert avatar

Watchers

 avatar

jbox2d's Issues

Problem when a dynamic body falls over a kinematic body moving down

What steps will reproduce the problem?
Testbed code below:

package org.jbox2d.testbed.tests;

import org.jbox2d.collision.shapes.PolygonShape;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.BodyType;
import org.jbox2d.testbed.framework.TestbedTest;

public class MovingPlatformTeste extends TestbedTest {

   @Override
   public void initTest(boolean argDeserialized) {
        setTitle("Moving Platform Test");

        getWorld().setGravity(new Vec2(0, -100));

        PolygonShape polygonShape = new PolygonShape();
        polygonShape.setAsBox(10, 1);

        BodyDef bodyDef = new BodyDef();
        bodyDef.type = BodyType.KINEMATIC;
        bodyDef.position.set(0, 20);
        bodyDef.allowSleep = false;
        Body body = getWorld().createBody(bodyDef);
        body.createFixture(polygonShape, 5.0f);
        body.setLinearVelocity(new Vec2 (0.0f, -10.0f));

        polygonShape = new PolygonShape ();
        polygonShape.setAsBox(1, 1);

        bodyDef = new BodyDef ();
        bodyDef.type = BodyType.DYNAMIC;
        bodyDef.position.set(0, 100);
        bodyDef.allowSleep = false;
        body = getWorld().createBody(bodyDef);
        body.createFixture(polygonShape, 5.0f);
   }

   @Override
   public String getTestName() {
      return "Moving Platform Test";
   }

}

What is the expected output? What do you see instead?
It is expected that the body falling actually collides with the other body, but 
it never happens.

What version of the product are you using? On what operating system?
Latest version on windows

Please provide any additional information below.
It is posted here also: 
http://www.box2d.org/forum/viewtopic.php?f=9&t=8440&p=36214#p36214

Original issue reported on code.google.com by [email protected] on 12 May 2012 at 1:26

minor bug in Convex Hull demo


In the ConvexHull example, the bounds are set as (8,8) to (-8,-8)
    Vec2 lowerBound = new Vec2(-8f, -8f);
    Vec2 upperBound = new Vec2(8f, 8f);

but then you feed it random numbers between 0 and 10 for X and Y axis. This 
results in substantial rectangular clipping on the top and right edge of the 
generated shape. I corrected the problem by changing the random number 
generator to (-8,8)

      float x = MathUtils.randomFloat(-8, 8);
      float y = MathUtils.randomFloat(-8, 8);

Version 2.2.1.1


Original issue reported on code.google.com by [email protected] on 2 May 2013 at 12:48

Collision not always detected correctly

What steps will reproduce the problem?
1. Execute attached code

What is the expected output?
Both boxes land on the polygon

What do you see instead?
One box warps through the polygon

What version of the product are you using?
jbox2d 2.1.2.1

On what operating system?
mac osx

Please provide any additional information below.
I already wrote in the forums 
(http://www.box2d.org/forum/viewtopic.php?f=9&t=8067) but this is probably a 
bug.

Original issue reported on code.google.com by max.trocha on 14 Jan 2012 at 12:22

Attachments:

serialization with protobuffers

Create world serialization with protocol buffers.

Why?
 * super small
 * super fast
 * java, c++, python compatible
 * extendable
 * great for network communications

Original issue reported on code.google.com by [email protected] on 13 Jul 2011 at 3:41

  • Merged into: #12

jbox2d-library-2.1.2 run in android sdk

What steps will reproduce the problem?
1.
2.
3.
ERROR/AndroidRuntime(748): java.lang.ExceptionInInitializerError
ERROR/AndroidRuntime(748): at 
org.jbox2d.pooling.WorldPool.<init>(WorldPool.java:72)
ERROR/AndroidRuntime(748): at org.jbox2d.dynamics.World.<init>(World.java:126)
...
ERROR/AndroidRuntime(748): Caused by: java.lang.NoClassDefFoundError: 
org.slf4j.impl.StaticLoggerBinder
ERROR/AndroidRuntime(748):     at 
org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
ERROR/AndroidRuntime(748):     at 
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
...


What is the expected output? What do you see instead?
Code no problem
Running in the androidSDK environment appeared above errors, whether not 
support androidSDK ah
The version can be run before,

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 21 Oct 2011 at 4:00

AABB.contains() inverted sense

When this code was optimized the sense of the returned boolean was inverted.  
The original implementation (commented out) matches the function-level 
comment's description, but the live implementation returns the inverse of this 
value.  Should swap all > for <= .

/**
   * Does this aabb contain the provided AABB.
   * 
   * @return
   */
  public final boolean contains(final AABB aabb) {
    /*
     * boolean result = true; result = result && lowerBound.x <= aabb.lowerBound.x; result = result
     * && lowerBound.y <= aabb.lowerBound.y; result = result && aabb.upperBound.x <= upperBound.x;
     * result = result && aabb.upperBound.y <= upperBound.y; return result;
     */
    // djm: faster putting all of them together, as if one is false we leave the logic
    // early
    return lowerBound.x > aabb.lowerBound.x && lowerBound.y > aabb.lowerBound.y
        && aabb.upperBound.x > upperBound.x && aabb.upperBound.y > upperBound.y;
  }

Original issue reported on code.google.com by [email protected] on 25 May 2013 at 11:08

Assertion errors aint no exceptions

I find that throughout the JBox2d code there are assertions used in placed 
where exceptions are the right thing to use, e.g.,
assert (2 <= count && count <= Settings.maxPolygonVertices);
This is especially odd if one does not enable assertions in the vm and code 
crashes.

Original issue reported on code.google.com by [email protected] on 3 Sep 2012 at 5:21

Make localAnchorA and localAnchorB not be final in RopeJointDef.

In jbox2d-library-2.2.1.1.jar, both localAnchorA and localAnchorB are final 
fields in RopeJointDef, so there is no way to set anchor points for a rope at 
all. This should be changed to non-final fields or allow some way to set them 
somehow. Right now they are filled with hardcoded values in RopeJointDef 
constructor.

Original issue reported on code.google.com by [email protected] on 23 Jul 2013 at 7:44

Missing sources (EdgeShape ChainShape) in distribution v2.1.2.2

1. ./collision/shapes/ChainShape.java
2. Missing from the 2.1.2.2 "all in one" distribution

I was previously using SVN trunk to build from sources. Due to reasons I do not 
wish to relive I reinstalled my dev env and decided to use the packaged 
distribution (v2.1.2.2)

It appears to be missing some files.

EdgeShape (r554) and ChainShape (r577) are a couple examples.

Might be others but those I spotted from compile errors.

[Alternative cause ??? even though the download <i>says</i> it is v2.1.2.2 it 
might be an earlier snapshot instead?]

P.S. - Browsed the Source::Tags and it looks like those files were not included 
in the built release.

Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 6:09

DistanceJoint bug

Possible bug, starting at line 243 of DistanceJoint.java:

{{{
        Vec2.crossToOut(b1.m_angularVelocity, r1, v1);
        Vec2.crossToOut(b2.m_angularVelocity, r2, v2);
        v1.set(b1.m_linearVelocity).addLocal(b1.m_linearVelocity);
        v2.set(b2.m_linearVelocity).addLocal(b2.m_linearVelocity);
}}}

v1 and v2 are getting clobbered in the third and fourth lines, I'm pretty sure 
we just need to get rid of the set() part.  Should be a simple fix, I just need 
to test it and make sure it works right.

Original issue reported on code.google.com by [email protected] on 19 Jul 2011 at 8:58

LineJoint motor appears to be broken

What steps will reproduce the problem?

The Java version of the program shows the broken behaviour. The C++ version 
shows the expected behaviour. Apparently, the WheelJoint in the C++ is just
the LineJoint renamed.

What is the expected output? What do you see instead?

The "unicycle" structure should drive to the left hand side of the screen as 
the joint motor causes the wheel to rotate.

What version of the product are you using? On what operating system?

jbox2d 2.1.2
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (ArchLinux-6.b24_1.11.1-3-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

box2d 2.2.1
Arch Linux x86_64

Please provide any additional information below.

See the attached programs.

Original issue reported on code.google.com by [email protected] on 5 Apr 2012 at 10:51

Attachments:

Merge GWT support upstream

Hi, I'm the maintainer of PlayN and PlayN's GWT-compatible JBox2D 
port/fork/whatever.

It turns out that there are really very few changes needed to make JBox2D 
GWT-compatible straight out of the box, and it would be great if I could get 
those changes merged upstream instead of maintaing a slightly tweaked fork. 
Then anyone who wanted to use JBox2D in a GWT app could just do it (PlayN or no 
PlayN).

I've attached two patches. One makes some minimal changes to JBox2D which would 
allow me to maintain some additional code (outside JBox2D) that would allow 
anyone to use JBox2D with GWT by simply depending on the JBox2D Maven artifact 
and my JBox2D-GWT Maven artifact. The second patch integrates the (small amount 
of) code that makes up the JBox2D-GWT Maven artifact so that someone could just 
use JBox2D with GWT directly without having to know about my extra cruft.

These diffs are against r647 which is the latest revision as of the submission 
of this issue.

The first patch (gwt-compat.patch) does two things:

1. It omits @Override on the clone() methods because GWT unfortunately does not 
define Object clone. This has no impact on JBox2D or any code that uses JBox2D.

2. Switches the three stack classes from using reflection to using a protected 
factory method to populate themselves. So instead of, for example:

  new OrderedStack<Vec2>(Vec2.class, argSize, argContSize)

you now do:

  new OrderedStack<Vec2>(argSize, argContSize) {
    protected Vec2 newInstance() { return new Vec2(); }
  };

This is slightly more verbose to the caller, but GWT does not support 
reflection and thus requires such an approach. I don't know if third-party code 
is likely to use these stack implementations. If so, this impacts that code and 
I can look into other ways to work around this GWT limitation.

The patch also eliminates the use of typed arrays internally in the stack 
classes (which were created by reflection). I assume this was done in the name 
of performance, but it is almost certainly shooting itself in the foot. Because 
the stack classes use generics, every time an object is retrieved from the 
array, the Java compiler will insert a cast, so there's no benefit to having 
the underlying array be, for example, a Vec2[] rather than an Object[], and to 
make matters worse, when you insert an object into a Vec2[] the JVM has to do a 
runtime check to ensure that the object in question is actually a Vec2, whereas 
when you insert into an Object[] it need not do that check. So using Vec2[] 
rather than Object[] is almost certainly slower.

The second patch (gwt-extras.patch) does a few different things:

1. It adds a GWT module file (org/jbox2d/JBox2D.gwt.xml). This is a metadata 
file needed by GWT.

2. It adds some "super source" which is a mechanism GWT uses to provide 
specialized code that's only used in the JavaScript version of the app. This is 
in src/main/java/org/jbox2d/gwtemul and contains three files:

src/main/java/org/jbox2d/gwtemul/java/lang/StrictMath.java
src/main/java/org/jbox2d/gwtemul/org/jbox2d/common/PlatformMathUtils.java
src/main/java/org/jbox2d/gwtemul/org/jbox2d/common/Timer.java

StrictMath is not available in JavaScript, so this emulates that with normal 
math. Timer uses System.nanoTime, which is not available in JavaScript, so the 
super-source version just uses JavaScript's Date.now method. PlatformMathUtils 
works around one use of floatToIntBits and intToFloatBits in MathUtils, neither 
of which are supported in JavaScript.

MathUtils extends PlatformMathUtils and PlatformMathUtils contains just the 
fastPow method, so that GWT can override it. I could override MathUtils, but 
I'd have to copy everything in MathUtils into the super source version, which 
means that bug fixes have to happen in two places which is no good. Hopefully 
this small bit of code-weirding is not too unpalatable.

That's pretty much it. Let me know if you need any more details or would rather 
I changed things in different ways. I'm happy to keep the GWT-specific stuff up 
to date and make sure things continue to compile and work in GWT land and 
submit future patches if/when needed.

Thanks!

Original issue reported on code.google.com by [email protected] on 26 Mar 2013 at 7:59

Attachments:

E/AndroidRuntime(1254): java.lang.NoClassDefFoundError: org.jbox2d.common.Vec2

What steps will reproduce the problem?
when i try to init a new Vec2 in a Constructor:
Vec2 gravity = new Vec2(0, 10f);  



What is the expected output? What do you see instead?

my expected output is to darw something on surfaceView,but it cause a runtime 
error

What version of the product are you using? On what operating system?
i am using jbox2d-2.1.2.2 and i add 
"jbox2d-library-2.1.2.2-jar-with-dependencies.jar"into my build path,my code 
can pass the build.
i an using fedora16 X86_64 OS.

Please provide any additional information below.
my code is like this:
this is a Constructor:
public MySurfaceView(Context context) {
        super(context);
        this.setKeepScreenOn(true);
        sfh = this.getHolder();
        sfh.addCallback(this);
        paint = new Paint();
        paint.setAntiAlias(true);
        setFocusable(true);
        gravity=new Vec2(0, 10);        
        world = new World(gravity, true);
    }

and i use it in a activity:setContentView(new MySurfaceView(this));


Original issue reported on code.google.com by [email protected] on 21 Oct 2012 at 8:59

Create stretchable edge shape or polygon

When creating any sort of deformable object like a blob, rope, or bridge, it 
would be very useful to have some sort of deformable shape (or body?) so that 
it's more difficult for things to penetrate inside the object (see the blob 
test for an example, the idea would be to have a shape that could connect the 
vertices and keep things out, which is tricky to do with rigid bodies).

While fully deformable objects are very messy to implement, it might be 
feasible to add something like a stretchable edge shape, which is free to 
stretch along its perimeter if pulled apart or pushed together by joints.

This is low priority, as it's a feature that doesn't exist in Box2d proper, but 
I'll take a look at it and see if it would be too difficult to implement.  The 
main concern I have is that all of the bits of the solver assume that the 
anchor points are fixed, and this would not be the case; this would also 
probably need to be implemented by sub-typing Body rather than Shape, because 
most of the places where impulses are applied don't actually touch the shapes, 
but work purely with bodies after determining where on the body the impulses 
are going to be applied.

On the bright side, the refactorings necessary to make this possible *might* 
simplify parts of the engine a good bit - there's still a lot of stuff that's 
directly inlined in the code, when it really could be factored out (for 
instance, tons of code in most of the joint subclasses is repeated all over the 
place, and really boils down to simple things like "apply an impulse at this 
point" or "find the relative velocity of two local points").

Will see, though, this could be pretty tough...

Original issue reported on code.google.com by [email protected] on 19 Jul 2011 at 8:55

Error in ConstantVolumeJoint

What steps will reproduce the problem?
1.Try the BlobJoint demo

What version of the product are you using?
2.2.1.2

Please provide any additional information below.
In the ConstantVolumeJoint class:
In the getBodyArea function:
Replace:
    float area = 0.0f;
    for (int i = 0; i < bodies.length - 1; ++i) {
By:
    float area = 0.0f;
    for (int i = 0; i < bodies.length; ++i) {

Original issue reported on code.google.com by cortobass on 27 May 2013 at 6:37

Clean up old code

Now that we're again coming close to stability relative to Box2d, we should 
consider starting to either prune or integrate old code from the codebase.  

The jbox2d directory is the old Sourceforge version of the code, and can 
probably be removed altogether and the updating directory can probably be 
pulled up a level so that it's clearer that it's the current version.

There are only a few pieces of functionality in the old directory that are 
missing in the current one, like the convex decomposition (which I may be able 
to clean up and get working again in the new code), the SPH code (which doesn't 
work at all, sadly), and the Blob utilities (which are kinda weird, and 
probably don't belong in the main tree), so I don't think we'd be losing much.

Original issue reported on code.google.com by [email protected] on 9 Jul 2011 at 10:46

Testbed .jar in Downloads section not working

When I do java -jar jbox2d-testbed-2.1.2,

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/jbox2d/pooling/arrays/IntArray
    at org.jbox2d.testbed.framework.DebugDrawJ2D.<clinit>(DebugDrawJ2D.java:131)
    at org.jbox2d.testbed.framework.TestPanel.<init>(TestPanel.java:68)
    at org.jbox2d.testbed.framework.TestbedMain.<init>(TestbedMain.java:71)
    at org.jbox2d.testbed.framework.TestbedMain.main(TestbedMain.java:136)
Caused by: java.lang.ClassNotFoundException: org.jbox2d.pooling.arrays.IntArray
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 4 more

Everything works fine when I build from source, so I'm pretty sure this is a 
packaging problem, and the wrong branch for the library files is packaged into 
this jar. Verify this, though, runnable .jars often cause me problems on my 
Mac...

Original issue reported on code.google.com by [email protected] on 19 Jul 2011 at 6:13

Buged raycast test in "Dynamic Tree" test in Testbed

What steps will reproduce the problem?
1. Run Testbed
2. Switch to "Dynamic Tree" test
3. Press 'a' to start automatic mode
4. Notice raycast not working as intended

What is the expected output? What do you see instead?

Raycast test is not working as intended - hit is only reported if it happen 
closer to start point then last hit. 

What version of the product are you using? On what operating system?

Replicable on both "jbox2d-testbed-2.1.2-alpha-v2.jar" release from download or 
latest version of SVN. System: Windows XP SP3, java 1.6.0_15.

Please provide any additional information below.

In class "org.jbox2d.testbed.tests.DynamicTreeTest" attribute 
"m_rayCastInput.maxFraction" is being overwritten in "RayCast()" method:
- line 354:
    RayCastInput input = m_rayCastInput;
- line 375:
    input.maxFraction = output.fraction;
This result in "m_rayCastInput.maxFraction" becoming smaller over time and I 
think this is not intended.

Fast fix is to create new RayCastInput object at line 354:
    RayCastInput input = new RayCastInput();
    input.set(m_rayCastInput);

Original issue reported on code.google.com by [email protected] on 12 Jun 2011 at 1:46

experimenting with body/fixture/shape in-engine editing

I'd really like to experiment with in-engine body/fixture/shape/joint changes, 
where you could change a polygon's points or a circle's radius without 
removing/adding from the engine.

This would probably consist of:
1. marking the object as 'dirty' or 'updated'
2. world checks for new contacts on the object
3. ????
4. PROFIT!!!!

Original issue reported on code.google.com by [email protected] on 21 Jul 2011 at 4:05

Inaccurate physics

What steps will reproduce the problem?

Run the varying restitution demo using the source and testbed from: 

svn http://jbox2d.googlecode.com/svn/tags/jbox2d-2.1.2.0/

Tried different settings including 10, 20, 50, 100 iterations for position and 
velocity. all tried at 60 Hz, 100 Hz and 150 Hz.

What is the expected output? What do you see instead?
Expect the circle with restitution 1.0f to bounce back to its original height.
See the circle bouncing higher and gaining energy over time.

What version of the product are you using? On what operating system?
2.1.2, using Windows7, ran in eclipse. with Java 6.

Please provide any additional information below.
Also tried the JAR, got the same result.


Original issue reported on code.google.com by [email protected] on 4 Aug 2011 at 1:44

Make

I have a very simple but very important request:
Have the basic math classes "Vec2", "Mat22" and "XForm" implement the 
java.io.Serializable interface.

This makes objects of these classes serializable which is a necessity for 
things like savegames or network transfer.

It's as simple as adding the "implements" statement and comes with zero side 
effects.

Original issue reported on code.google.com by [email protected] on 19 May 2011 at 2:17

Download contains .svn files and __MACOSX

I love this library!

Minor issue: jbox2d-2.2.1.1.zip contains files that should not be there. The 
.svn files will interfere other existing SVN checkouts.

Please do an SVN export before release.

Thanks!

Original issue reported on code.google.com by [email protected] on 3 Oct 2013 at 12:14

Create easily runnable testbed distribution

We should try to create binaries for Windows, OS X, and (maybe) Linux so that 
people can just download and run the program with a double click.  On many 
computers .jars are not double-click runnable, so we might want to consider 
something like launch4j: http://launch4j.sourceforge.net/

Original issue reported on code.google.com by [email protected] on 9 Jul 2011 at 10:59

Fixed some repeated allocations in 2.1.2

In Islands.java there is an erroneous >= that should be a >.

There is also a repeated allocation in World.java.

I have attached a patch file with the fix.

With the fix I get no allocations in the trace, even when running for a long 
period.

It does seem that 2.1.2 is a bit slower, my FPS drops from 20 to 12 when using 
the 2.1.2 as opposed to the 2.0.1.

Original issue reported on code.google.com by [email protected] on 7 Feb 2011 at 10:13

Attachments:

Regarding jar file

What steps will reproduce the problem?
1.NA
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

Well , 
sorry for posting this in issues.

Can somebody please provide the link for JAR file to include in android project 
, from the downloads page all jar files links are tagged as deprecated.
and i was not able to find jar file in featured downloads.



Original issue reported on code.google.com by [email protected] on 16 Jul 2012 at 7:12

adding different graphics support to testbed

J2D drawing is super slow.  perhaps we can abstract out the rending component 
of the testbed and have a JOGL renderer.  We can throw the jar dependencies in 
there, and leave it up to the user to provide the native libs if they want this 
rendering.  after all, it's the testbed, no one should have it as a dependency 
except for experimentation.

Original issue reported on code.google.com by [email protected] on 21 Jul 2011 at 9:07

Raycast problem

What steps will reproduce the problem?
1. In the updating code, perform a raycast.
2.
3.

What is the expected output? What do you see instead?
Raycast should work, random failures happen.

What version of the product are you using? On what operating system?


Please provide any additional information below.
Fix:
in AABB class in collision package change method
public final void getExtentsToOut(final Vec2 out) {
        out.x = (upperBound.x - lowerBound.x) * .5f;
        out.x = (upperBound.y - lowerBound.y) * .5f;
    }
to
public final void getExtentsToOut(final Vec2 out) {
        out.x = (upperBound.x - lowerBound.x) * .5f;
        out.y = (upperBound.y - lowerBound.y) * .5f;
    }

Original issue reported on code.google.com by [email protected] on 27 Apr 2011 at 9:35

Flesh out QuickStart wiki

We need to better document the steps to get started using JBox2D in its current 
form - it's not entirely clear how to get the testbed running if you just check 
out the project with no other knowledge.  If you just try to import the project 
into Eclipse, for example, it's not obvious whether or not to use the updating 
directory or the jbox2d directory, and it's a bit tricky to set up the project 
by hand to get it to compile the testbed.

Currently the lowest friction approach seems to be to use Maven (the log4j 
dependency is handled easiest through Maven), so we should explain how to get 
the testbed running using Maven from:

1) Eclipse (I added this to the wiki already, though it needs to be checked)
2) Netbeans
3) IntelliJ IDEA (this one is almost trivial, it Just Worked for me when I 
tried to open the project directory and let it do its Maven thing, and I had to 
do zero configuration)
4) Command line (? - maybe this is not something we should support...)

We should ideally test all of these on from-scratch new installations, and keep 
them up to date with each release.

We may also want to include info or an example explaining how to use JBox2D 
within an external project, though for the most part people shouldn't have 
trouble with this (just drop in the .jar).

Original issue reported on code.google.com by [email protected] on 9 Jul 2011 at 10:38

Body.createShape() is missing.

The PolygonShape documentation says, "Create using Body.createShape(ShapeDef), 
not the ructor here."  That method simply does not exist.  CircleShape has a 
similar comment.

Original issue reported on code.google.com by [email protected] on 21 Feb 2012 at 1:22

Add Builders for Joints and shapes

As discussed before (http://box2d.org/forum/viewtopic.php?f=9&t=8417) the 
Builder pattern can simplify Object creation and create a fluent user interface.

I'm using builders for creating Shapes in JBox2D and I'd like to contribute 
them as discussed (See attached file). Sorry this took so long...

Original issue reported on code.google.com by [email protected] on 15 Aug 2012 at 12:22

Attachments:

AssertionError while setting a body inactive.

What steps will reproduce the problem?
1. Run attached code with enabled assertions!

What is the expected output? What do you see instead?

Expecting no errors. Getting:

Exception in thread "main" java.lang.AssertionError
    at org.jbox2d.collision.broadphase.DynamicTree.destroyProxy(DynamicTree.java:115)
    at org.jbox2d.collision.broadphase.BroadPhase.destroyProxy(BroadPhase.java:104)
    at org.jbox2d.dynamics.Fixture.destroyProxy(Fixture.java:314)
    at org.jbox2d.dynamics.Body.setActive(Body.java:993)
    at matt.jbox2D.AssertionErrorReproductionForSetActive.main(AssertionErrorReproductionForSetActive.java:26)

What version of the product are you using? On what operating system?

jbox2d-library-2.1.2.2.jar
On Windows 7 x64
With JDK 1.7.0_02

Please provide any additional information below.

If seems that this problem occurs randomly when massively 
activating/deactivating bodies. I have not found a pattern yet.

Original issue reported on code.google.com by [email protected] on 8 Apr 2012 at 12:38

Attachments:

Create test from world/JSON export

See http://code.google.com/p/box2d/issues/detail?id=207 and 
http://code.google.com/p/box2d/issues/detail?id=166

We should follow Box2d on this, and enable either exporting of a world directly 
to testbed code or (better?) to a JSON format (ideally whichever one gets 
integrated into the C++ version).

Original issue reported on code.google.com by [email protected] on 9 Jul 2011 at 10:49

Implement Bayazit Polygon Decomposition Algorithm

This might get shot down quickly, seeing as jbox2d only aims to be a direct 
port of the C library called box2d. However, it would still be cool to see the 
Bayazit algorithm implemented right into the project. I.e. when you pass in a 
polygon into a fixturedef, it would take the necessary steps to check whether 
not the polygon needs to be decomposed. This would allow the infamous >5 vertex 
and/or concave polygon to be used.

I am currently doing this already in my game. It works beautifully (unless my 
polygon is more granular than the epsilon value, of course). There is no 
clipping like Bayazit clipping, and triangulation (what people usually use) is 
an expensive/laggy/unoptimized solution.

Original issue reported on code.google.com by [email protected] on 5 May 2013 at 10:52

Shut down Sourceforge page

We should effectively shut down http://sourceforge.net/projects/jbox2d/, 
putting up a message that informs people that the new home is at Google Code.

Probably best to leave up the repo, though, so that the SVN history is 
maintained.

We should also make sure to update jbox2d.org to point only to the Google repo.

Original issue reported on code.google.com by [email protected] on 9 Jul 2011 at 10:41

Wrong reallocating in TOISolver

What steps will reproduce the problem?
many contacts at the same time

Problem:
jbox2d 2.1.2
package org.jbox2d.dynamics.contacts
class TOISolver
method initialize(Contact[] contacts, int count, Body toiBody)

Sometimes i got an array index out of bounds exception at line 99: 
TOIConstraint constraint = m_constraints[i];

The problem is wrong reallocating:

if(m_count >= m_constraints.length){
    TOIConstraint[] old = m_constraints;
    m_constraints = new TOIConstraint[old.length*2];
    System.arraycopy(old, 0, m_constraints, 0, old.length);
    for(int i=old.length; i<m_constraints.length; i++){
        m_constraints[i] = new TOIConstraint();
    }
}

Exception occurs in the case m_count > old.length*2. This should work:

while(m_count >= m_constraints.length){
    TOIConstraint[] old = m_constraints;
    m_constraints = new TOIConstraint[old.length*2];
    System.arraycopy(old, 0, m_constraints, 0, old.length);
    for(int i=old.length; i<m_constraints.length; i++){
        m_constraints[i] = new TOIConstraint();
    }
}

Have a nice Day

Original issue reported on code.google.com by [email protected] on 31 Jul 2011 at 7:51

CCD problem

What steps will reproduce the problem?

1. Open LiquidTest.java
2. Comment out lines 323 through 332 (remove everything in the 
step(TestbedSettings) method except the call to the superclass step)
3. Run the test
4. Shoot a bomb through the falling group of particles

What is the expected output? What do you see instead?

Expected: bomb shoots through the particles at a roughly constant speed
Actual: bomb slows to a complete stop when it hits the group of particles, and 
then shoots off at its original velocity when it finally gets clear of them

I haven't had a chance yet to verify whether similar things happen in the C++ 
version, but I will soon - this used to happen with one of the old versions of 
the CCD algorithm, so I'm not sure whether it's a JBox2d bug or a general 
limitation of the algorithm.

Original issue reported on code.google.com by [email protected] on 10 Jul 2011 at 4:49

Enhancement Request (and Patch) - customize restitution mixing

It would be useful for me to be able to customize the way that the restitution 
constants are mixed between two colliding bodies.  I noted a TODO to similar 
effect in Settings.java and so created a patch for your consideration.

The attached patch would seem to allow this type of customization (as well as 
the same for friction since it was very similar).

Original issue reported on code.google.com by [email protected] on 20 Apr 2012 at 8:13

Attachments:

PolygonShape.set doesnt copy vertices

What version of the product are you using? On what operating system?
2.1.2 alpha

Please provide any additional information below.
File: PolygonShape.java
Method: void set(final Vec2[] vertices, final int count)
Line: 174

It should be "m_vertices[i].set(vertices[i])" instead of "m_vertices[i] = 
vertices[i]" to make an hard copy. Otherwise the vertices could be changed 
outside of this class. 

Original issue reported on code.google.com by [email protected] on 19 May 2011 at 5:34

GearJoint & WheelJoint in trunk/ do not compile

What steps will reproduce the problem?
Check out trunk, mvn eclipse:eclipse, import jbox2d-library.

What is the expected output? What do you see instead?
no compilation errors


What version of the product are you using? On what operating system?
latest trunk, 3.16.2012


Please provide any additional information below.
Compilation errors in form of a nasty pastebin link http://pastebin.com/F1TNtJGZ

Original issue reported on code.google.com by badlogicgames on 16 Mar 2012 at 6:01

ConstantVolumeJoint warm-starting blowup when frequencyHz set to 0

In BlobTest4.java, change line 120 to cvjd.frequencyHz = 0.0f;

The resulting test shows a blowup problem if warm-starting is enabled, but 
works fine if it's not.  This is a regression from before the major update, so 
perhaps something about the way warm-starting is calculated needs to be changed 
since the engine changes?

I'll take a look into this, see if I can figure out what's wrong.

Original issue reported on code.google.com by [email protected] on 19 Jul 2011 at 8:25

body.setGravityScale?

What steps will reproduce the problem?
1. Implementing some new functions from Box2d

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Nov 2012 at 1:41

Simulation is not deterministic

What steps will reproduce the problem?

1. Start TestBed
2. Choose any enough complicated test (dominos is good for this)
3. Observe simulation result (for example how domion blocks felt on the ground)
4. Restart simulation (or TestBed) and repeat step 3


What is the expected output? What do you see instead?

Every simulation should be exactly the same (as long as initial condition are 
the same). For example in dominos test block should always fall on ground in 
the same way.


What version of the product are you using? On what operating system?

Replicable on both "jbox2d-testbed-2.1.2-alpha-v2.jar" release from download or 
latest version of SVN. System: Windows XP SP3, java 1.6.0_15.


Please provide any additional information below.

Problem is caused by use of "Random" in dynamic tree.
Class "org.jbox2d.collision.broadphase.DynamicTree":
- line 68:
    private final Random rand = new Random();
- line 401, method "allocateNode()":
    node.key = rand.nextInt();

Adding constant seed to random generator is enough to fix problem and make 
simulation deterministic. But I find it strange to use random numbers there - 
setting "node.key" to constant value seems to work well. I also checked 
original Box2D code and random number are not used there (at least not in 
dynamic tree).

Original issue reported on code.google.com by [email protected] on 12 Jun 2011 at 12:07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.