Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-04-30 12:01:42
Hi Jezek,

Any news on jbullet porting ?
Is still there issues for 2.66 or you have started on 2.68 sync ?
2  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-04-15 09:18:02
With trove-2.0.3, I can't reproduce it so it was a trove bug.
thx for the help.
3  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-04-14 13:58:57
I've a pb when I try to remove rigidbodies from my dynamicworld (it's not systematic, and arryy index causing this exception change)

1  
2  
3  
4  
5  
6  
7  
8  
9  
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 13
        at gnu.trove.THashMap.removeAt(THashMap.java:414)
        at gnu.trove.THashMap.retainEntries(THashMap.java:315)
        at com.bulletphysics.util.HashUtil$TroveHashMapImpl.retainEntries(HashUtil.java:114)
        at com.bulletphysics.collision.broadphase.OverlappingPairCache.processAllOverlappingPairs(OverlappingPairCache.java:123)
        at com.bulletphysics.collision.broadphase.OverlappingPairCache.removeOverlappingPairsContainingProxy(OverlappingPairCache.java:127)
        at com.bulletphysics.collision.broadphase.SimpleBroadphase.destroyProxy(SimpleBroadphase.java:73)
        at com.bulletphysics.collision.dispatch.CollisionWorld.removeCollisionObject(CollisionWorld.java:164)
        at com.bulletphysics.dynamics.DiscreteDynamicsWorld.removeRigidBody(DiscreteDynamicsWorld.java:375)


Here is how I do (I only have box rigidbodies and HingeConstraint) :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
public void deleteWorld() {
     
      // Delete joints
     int numConstraints = dynamicsWorld.getNumConstraints();
      for (int i=0; i<numConstraints; i++) {
         TypedConstraint joints = dynamicsWorld.getConstraint(0);
         dynamicsWorld.removeConstraint(joints);
      }
     
      // Delete nodes   and RigidBodies
     for (Node node : sceneGraph) {
         if (node instanceof PhysicNode) {
            RigidBody body = ((PhysicNode)node).getCollisionObject();        
            dynamicsWorld.removeRigidBody(body);
            body.destroy();
         }
      }
      sceneGraph = new ArrayList<Node>();
     
      // Delete dynamicWorld      
     dynamicsWorld.destroy();
      dynamicsWorld = null;
     
   }
   


Any idea ?
4  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-04-08 16:17:44
ok, HingeConstraint fix should be commited.
5  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-04-08 11:01:52
Thank you Erwin.

Jezek, I have the same fixes available for jbullet.
With a mtn status or mtn diff I can see the changes. How I can commit safely just one file (I've have some other files I've changed for some test) ?


6  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-17 08:40:28
Hi

I inspect HingeConstraint code, and there is some things a bit weird (also present in "upstream" Bullet), if I remember well my maths (which are years behind me now ...)
So I' ve rewrite the constructor public HingeConstraint(RigidBody rbA, RigidBody rbB, Vector3f pivotInA, Vector3f pivotInB, Vector3f axisInA, Vector3f axisInB) and it seems ok :

Here is the original code :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
rbAFrame.origin.set(pivotInA);

// since no frame is given, assume this to be zero angle and just pick rb transform axis
Vector3f rbAxisA1 = stack.vectors.get();
rbA.getCenterOfMassTransform().basis.getColumn(0, rbAxisA1);

float projection = rbAxisA1.dot(axisInA);
if (projection > BulletGlobals.FLT_EPSILON) {
   rbAxisA1.scale(projection);
   rbAxisA1.sub(axisInA);
} else {
   rbA.getCenterOfMassTransform().basis.getColumn(1, rbAxisA1);
}

Vector3f rbAxisA2 = stack.vectors.get();
rbAxisA2.cross(rbAxisA1, axisInA);

rbAFrame.basis.setRow(0, rbAxisA1.x, rbAxisA2.x, axisInA.x);
rbAFrame.basis.setRow(1, rbAxisA1.y, rbAxisA2.y, axisInA.y);
rbAFrame.basis.setRow(2, rbAxisA1.z, rbAxisA2.z, axisInA.z);

Quat4f rotationArc = stack.quats.get(QuaternionUtil.shortestArcQuat(axisInA, axisInB));
Vector3f rbAxisB1 = stack.vectors.get(QuaternionUtil.quatRotate(rotationArc, rbAxisA1));
Vector3f rbAxisB2 = stack.vectors.get();
rbAxisB2.cross(rbAxisB1, axisInB);

rbBFrame.origin.set(pivotInB);
rbBFrame.basis.setRow(0, rbAxisB1.x, rbAxisB2.x, -axisInB.x);
rbBFrame.basis.setRow(1, rbAxisB1.y, rbAxisB2.y, -axisInB.y);
rbBFrame.basis.setRow(2, rbAxisB1.z, rbAxisB2.z, -axisInB.z);


And my code :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
rbAFrame.origin.set(pivotInA);    

Vector3f rbAxisA1 = stack.vectors.get();
Vector3f rbAxisA2 = stack.vectors.get();
Vector3f tmpVect = stack.vectors.get(axisInA);
rbA.getCenterOfMassTransform().basis.getColumn(0, rbAxisA1);

float projection = axisInA.dot(rbAxisA1);
if (Math.abs(projection) >= 1.0f - BulletGlobals.SIMD_EPSILON) {
            rbA.getCenterOfMassTransform().basis.getColumn(1, rbAxisA2);                                                        
            tmpVect.scale(axisInA.dot(rbAxisA2));
            rbAxisA2.sub(tmpVect);  
            rbAxisA1.cross(rbAxisA2, axisInA);                                                
} else {          
            tmpVect.scale(projection);
            rbAxisA1.sub(tmpVect);                            
            rbAxisA2.cross(axisInA, rbAxisA1);                  
}

rbAFrame.basis.setRow(0, rbAxisA1.x, rbAxisA2.x, axisInA.x);
rbAFrame.basis.setRow(1, rbAxisA1.y, rbAxisA2.y, axisInA.y);
rbAFrame.basis.setRow(2, rbAxisA1.z, rbAxisA2.z, axisInA.z);

Quat4f rotationArc = stack.quats.get(QuaternionUtil.shortestArcQuat(axisInA, axisInB));
Vector3f rbAxisB1 = stack.vectors.get(QuaternionUtil.quatRotate(rotationArc, rbAxisA1));
Vector3f rbAxisB2 = stack.vectors.get();

rbAxisB2.cross(axisInB, rbAxisB1);

rbBFrame.origin.set(pivotInB);
rbBFrame.basis.setRow(0, rbAxisB1.x, rbAxisB2.x, -axisInB.x);
rbBFrame.basis.setRow(1, rbAxisB1.y, rbAxisB2.y, -axisInB.y);
rbBFrame.basis.setRow(2, rbAxisB1.z, rbAxisB2.z, -axisInB.z);



Maybe I should also post on Bullet forum ?


7  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-14 12:05:28
I'm trying to debug :
In the first case which works, I get Tranforms for HingeContraints like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
rbAFrame
(1.0, 0.0, 0.0)
1.0, 0.0, 0.0
0.0, 1.0, 0.0
0.0, 0.0, 1.0

rbBFrame
(-1.0, 0.0, 0.0)
1.0, 0.0, -0.0
0.0, 1.0, -0.0
0.0, 0.0, -1.0


but the computed Tranforms from Vectors are like this :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
rbAFrame
(1.0, 0.0, 0.0)
0.0, 1.0, 0.0
1.0, 0.0, 0.0
0.0, 0.0, 1.0

rbBFrame
(-1.0, 0.0, 0.0)
0.0, 1.0, -0.0
1.0, 0.0, -0.0
0.0, 0.0, -1.0


8  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-14 08:24:43
I'm playing with HingeConstraint, and I have a issue :

There is two constructors to join bodies, one which takes Transform, and one where you specify Vectors ...
With the first one, hinge Limits and angularMotor work very well, but with the other constructor the physic explodes when it reaches limits !

Maybe I do something wrong, here is the 2 methods I use :

1  
2  
3  
4  
5  
6  
7  
8  
HingeConstraint hingeC;                
Transform localA = stack.transforms.get();
Transform localB = stack.transforms.get();
localA.setIdentity();
localA.origin.set(1.0f, 0.0f, 0.0f);                              
localB.setIdentity();                
localB.origin.set(-1.0f, 0.0f, 0.0f);                                          
hingeC = new HingeConstraint(bodies.get(1), bodies.get(2), localA, localB);


And my current issue :
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
HingeConstraint hingeC; 
Vector3f pivotInA = stack.vectors.get();
Vector3f pivotInB = stack.vectors.get();
Vector3f axisInA = stack.vectors.get();
Vector3f axisInB = stack.vectors.get();
pivotInA.set(1.0f, 0.0f, 0.0f);
pivotInB.set(-1.0f, 0.0f, 0.0f);
axisInA.set(0.0f, 0.0f, 1.0f);
axisInB.set(0.0f, 0.0f, 1.0f);                
hingeC = new HingeConstraint(bodies.get(1), bodies.get(2), pivotInA, pivotInB, axisInA, axisInB);


Jezek, I can send you a test if you want to check by yourself.
9  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-13 10:21:56
OK, thank you very much.
I've just found that the rotation matrix wasn't good, but i didn't go further.
10  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-12 15:40:22
I've check for these common bugs but I don't find what happens
I send you the files on your email.
11  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-12 14:22:30
It almost works, but I've a small bug : my joints are not correctly positionned.

As I discover the vecmath api, I don't know if my port is correct for the following line :

1  
localB = m_bodies[1+2*i]->getWorldTransform().inverse() * m_bodies[0]->getWorldTransform() * localA; 


in this :
1  
2  
3  
tmpTrans.inverse(bodies[1+2*i].getWorldTransform());
tmpTrans.mul(tmpTrans, bodies[0].getWorldTransform());
localB.mul(tmpTrans, localA);
12  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-12 08:54:55
Ok, I'll start with DynamicControlDemo  Wink
13  Game Development / Game Mechanics / Re: Java port of Bullet Physics Library on: 2008-03-12 08:33:25
Hi

I've just register to JGO because I'm searching a physic library in java and I've discover your porting effort.
I've played a bit with JBullet, and you have done a very good work so far.

Your last post answer partially my current question : have you a comparison between Bullet and JBullet for features ported or not ?

For my project I'll need motors, so I think I'll port DynamicControlDemo if you have not started with it ?

Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (32 views)
2014-07-18 06:55:21

Zero Volt (28 views)
2014-07-17 23:47:54

danieldean (24 views)
2014-07-17 23:41:23

MustardPeter (25 views)
2014-07-16 23:30:00

Cero (40 views)
2014-07-16 00:42:17

Riven (42 views)
2014-07-14 18:02:53

OpenGLShaders (29 views)
2014-07-14 16:23:47

Riven (29 views)
2014-07-14 11:51:35

quew8 (26 views)
2014-07-13 13:57:52

SHC (63 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!