I'm having an error like this in my stacktrace, how do I fix this?
Exception in thread "Thread-4" java.lang.NoSuchMethodError: com.bulletphysics.collision.broadphase.OverlappingPairCache.setInternalGhostPairCallback(Lcom/bulletphysics/collision/broadphase/OverlappingPairCallback;)V
at com.jmex.jbullet.PhysicsSpace.<init>(PhysicsSpace.java:204)
at com.jmex.jbullet.PhysicsSpace.<init>(PhysicsSjavascript:void(0);pace.java:159)
at com.jmex.jbullet.PhysicsSpace$1.<init>(PhysicsSpace.java:109)
at com.jmex.jbullet.PhysicsSpace.getPhysicsSpace(PhysicsSpace.java:109)
at trials.bulletTrial$1.run(bulletTrial.java:52)
at java.lang.Thread.run(Unknown Source)
here's my code...
package trials;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.util.prefs.Preferences;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import com.jme.input.FirstPersonHandler;
import com.jme.input.InputHandler;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;
import com.jme.scene.shape.Box;
import com.jme.system.DisplaySystem;
import com.jme.system.GameSettings;
import com.jme.system.PreferencesGameSettings;
import com.jmex.editors.swing.settings.GameSettingsPanel;
import com.jmex.game.state.FPSGameState;
import com.jmex.game.state.GameState;
import com.jmex.game.state.GameStateManager;
import com.jmex.jbullet.PhysicsSpace;
import com.jmex.jbullet.collision.shapes.CollisionShape;
import com.jmex.jbullet.nodes.PhysicsNode;
import canvas.standard.StandardCanvasGame;
public class bulletTrial extends JFrame{
StandardCanvasGame game;
Canvas gameCanvas;
private static GameSettings settings = null;
GameState physicsState;
public bulletTrial(){
setLayout(new BorderLayout());
game = new StandardCanvasGame(settings);
game.start();
new Thread(new Runnable()
{
public void run()
{
try
{
game.waitForSetup();
} catch (InterruptedException e)
{
e.printStackTrace();
}
final PhysicsSpace pSpace = PhysicsSpace.getPhysicsSpace();
physicsState = new FPSGameState(){
//InputHandler input;
Camera cam;
{
cam = DisplaySystem.getDisplaySystem().getRenderer().getCamera();
DisplaySystem.getDisplaySystem().getRenderer().setCamera(cam);
cam.setLocation(new Vector3f(0,10,50));
cam.lookAt(new Vector3f(0,1,0), Vector3f.ZERO);
cam.update();
Box box1 = new Box("box", new Vector3f(), 10, 1, 10);
PhysicsNode physicsBox = new PhysicsNode(box1,CollisionShape.ShapeTypes.BOX);
physicsBox.setLocalTranslation(new Vector3f(0,50,0));
rootNode.attachChild(physicsBox);
pSpace.add(physicsBox);
PhysicsNode node3=new PhysicsNode(new Box("physicsfloor",Vector3f.ZERO,100f,0.2f,100f),CollisionShape.ShapeTypes.MESH,0);
node3.setLocalTranslation(new Vector3f());
rootNode.attachChild(node3);
node3.updateRenderState();
pSpace.add(node3);
rootNode.updateRenderState();
};
public void update(float tpf){
//input.update(tpf);
pSpace.update(tpf);
cam.update();
rootNode.updateRenderState();
rootNode.updateGeometricState(tpf,true);
}
public void render(float tpf){
super.render(tpf);
DisplaySystem.getDisplaySystem().getRenderer().draw(rootNode);
}
};
GameStateManager.getInstance().attachChild(physicsState);
physicsState.setActive(true);
}
}).start();
getContentPane().add(getGCanvas(), BorderLayout.CENTER);
this.setSize(settings.getWidth(), settings.getHeight());
this.setTitle("StandardCanvasGame Test1");
this.addWindowListener(new java.awt.event.WindowAdapter()
{
@Override
public void windowClosing(java.awt.event.WindowEvent e)
{
game.destroy();
}
});
this.setLocationRelativeTo(null);
}
public Canvas getGCanvas(){
if (gameCanvas == null)
{
gameCanvas = game.getCanvas();
}
return gameCanvas;
}
public static void main(String[] args) throws InterruptedException
{
System.setProperty("jme.stats", "set");
settings = new PreferencesGameSettings(Preferences.userRoot(), true, "game-defaults.properties");
GameSettingsPanel.prompt(settings);
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
bulletTrial thisClass = new bulletTrial();
thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisClass.setVisible(true);
}
});
}
}