Fix for jMEPhysics problem caused after 4640

Let me clarify first, this is a fix for jMEPhysics and not for jME2…



The incompatibility was sparked by Blaine’s very interesting patch for Spatial (which PhysicsCollisionGeometry subclasses) here.  blaine has reasonably stated his rationale and it looks to be a very smart patch ^^



The jMEPhysics repository is still under outside control, so we’re currently discussing whether to just add committers to the external category or to integrate it for jME 2.1



In any event, here’s the patch so everyone can get up and running :slight_smile:





Index: src/com/jmex/physics/PhysicsCollisionGeometry.java
===================================================================
--- src/com/jmex/physics/PhysicsCollisionGeometry.java   (revision 203)
+++ src/com/jmex/physics/PhysicsCollisionGeometry.java   (working copy)
@@ -153,17 +153,17 @@
     protected abstract void drawDebugShape( PhysicsNode physicsNode, Renderer renderer );
 
     @Override
-    public void findCollisions( Spatial scene, CollisionResults results ) {
+    public void findCollisions( Spatial scene, CollisionResults results, int requiredOnBits ) {
         // TODO: should this collide with other scenegraph objects?
     }
 
     @Override
-    public void findPick( Ray toTest, PickResults results ) {
+    public void findPick( Ray toTest, PickResults results, int requiredOnBits ) {
         // TODO: should this be pickable
     }
 
     @Override
-    public boolean hasCollision( Spatial scene, boolean checkTriangles ) {
+    public boolean hasCollision( Spatial scene, boolean checkTriangles, int requiredOnBits ) {
         // TODO: should this collide with other scenegraph objects?
         return false;
     }

Hi thanks so much!



I implemented these fixes and now physics works!



did this fix lose any functionality or are they hard fixes?

no functionality is lost, rather there is an extra parameter to the hasCollisions, findCollisions, and findPick methods which is described in detail in the thread linked above :slight_smile:

I can commit this in the next day or so.



Edit: nvm, I see you have access too, sbook. I'll defer to you, I'm quite busy.

nymon said:

I can commit this in the next day or so.

Edit: nvm, I see you have access too, sbook. I'll defer to you, I'm quite busy.


it's done already :)