I am new at using Jmonkey so i have a problem. When i load two models, one hand of a model goes into the other. What and how can i do to avoid this collision? Like when i load it for the first time i want if the models are colliding they should move a little to the side where they are not colliding.
Here is my code
Spatial plant = assetManager.loadModel(“try4/low.obj”);
plant.scale(10f);
plant.setLocalTranslation(new Vector3f(100,0,0));
BoundingVolume volume = plant.getWorldBound();
Vector3f extent = ((BoundingBox)volume).getExtent(null);
float q = (extent.x);
float w = (extent.y);
float e = (extent.z);
float a,b,c;
a = -100+q;
b = 0;
c = e+0.1f;
Quaternion roll = new Quaternion();
roll.fromAngleAxis(FastMath.PI/2, new Vector3f(0,1,0));
plant.setLocalRotation(roll);
rootNode.attachChild(plant);
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
Spatial plant2 = assetManager.loadModel("try3/Anakin.obj");
plant2.scale(18f);
plant2.setLocalTranslation(new Vector3f(100,0,0));
// RigidBodyControl r2= new RigidBodyControl(0.0f);
// plant2.addControl(r2);
// physics.getPhysicsSpace().add(r2);
Quaternion roll2 = new Quaternion();
roll2.fromAngleAxis(FastMath.PI*7/4, new Vector3f(0,1,0));
plant2.setLocalRotation(roll2);
rootNode.attachChild(plant2);
I know the i have fixed the coordinates of both the models to collide but i want to see if they collide one model should move to the side so they dont