UnsupportedCollisionException : Is it something normal?


When I try to check collision between two of my characters ( OtoMesh models ), an exception is thrown :


at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:479)

at com.jme3.scene.Mesh.collideWith(Mesh.java:512)

at com.jme3.scene.Geometry.collideWith(Geometry.java:260)

at com.jme3.scene.Node.collideWith(Node.java:512)

at com.didigame.acariaempire.scene.SceneCharacter.collideWith(SceneCharacter.java:1384)

at com.didigame.acariaempire.action.MoveAction.managePreparation(MoveAction.java:178)

at com.didigame.acariaempire.scene.SceneCharacter.managePreparation(SceneCharacter.java:775)

at com.didigame.acariaempire.ActionController.doScheduledActions(ActionController.java:350)

at com.didigame.acariaempire.ActionController.loopOnActions(ActionController.java:241)

at com.didigame.acariaempire.GameApplication.simpleUpdate(GameApplication.java:235)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:248)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:137)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:161)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Unknown Source)

Is it normal ?

If yes, how can I check that two of my characters are not colliding one which each other ?

Thanks in advance

What collisionshape you sue for your characters? For me this looks like it is sueing the one for only static meshes, but not exactly sure.

Here is where I add my physics control and my collision shape :



//Calculate collision shape
BoundingBox box = ((BoundingBox)model.getWorldBound());
float xHalfExtent = box.getXExtent();
float yHalfExtent = box.getYExtent();
float zHalfExtent = box.getZExtent();
float radius = Math.max(xHalfExtent, zHalfExtent);
//float height = yHalfExtent - radius;
float height = yHalfExtent;
CapsuleCollisionShape shape = new CapsuleCollisionShape( radius, height, 1);

//Create physics node
this.physicNode = new CharacterControl(shape, 0.01f );
//this.physicNode = new CharacterControl(shape, 0.01f );
this.model.addControl( physicNode );
this.physicNode.setMaxSlope( FastMath.PI / 2.0f );

Shoud I change my CollisionShape ?

You are mixing up physics and geometry based collision here. Geometry based collision throws these exceptions and yes, they are normal when you try and do unsupported collisions.


Geometry based collision : I can use something like collideWith( Ray ) for geomtry based collision, but can’t use it with custom Spatial ?

Physics collisions : Can I use my physicsNode to manually see if there is a collision with another physicsNode ?

Like a physicNode.getCollisionGroup().get[…] ?

You can sweep and do ray tests like in geometry based collision, read the manual and javadoc.