Hi there!
I’m new using Away3D, so maybe I’m asking something stupid. I’m working on a 3D pool game, I’ve managed to load all the elements on my model, when I add an impulse to the white ball it moves wthout any problem… but when the ball reaches the first of the cloth’s shape edges (picture attached to the post) it’s affected by some kind of force that turns it aside from it’s path. When the ball reaches to the edges in the middle of the table, if it’s not moving fast, it loses it’s path completely and is headed directly towards the side holes… the same thing happens to the other balls.
I am using a AWPBvhTriangleMeshShape for the cloth (mesh imported from the 3D model)
material=new ColorMaterial(0x008000);
material.lightPicker=_lightPicker;
objectMesh=event.asset as Mesh;
objectMesh.material=material;
_view.scene.addChild(objectMesh);
objectShape = new AWPBvhTriangleMeshShape(objectMesh.geometry);
objectBody= new AWPRigidBody(objectShape, objectMesh, 0);
objectBody.friction=0.8;
objectBody.contactProcessingThreshold=0.1;
_physics.addRigidBody(objectBody);
And SphereShape for the balls (white ball mesh is a SphereGeometry created in code, and the rest of the balls’ meshes are imported from the model)
material=new ColorMaterial(0xffffff);
material.lightPicker=_lightPicker;
objectMesh=new Mesh(new SphereGeometry(1.30),material);
objectMesh.material=material;
_view.scene.addChild(objectMesh);
sphereShape = new AWPSphereShape(1.30);
whiteBall= new AWPRigidBody(sphereShape, objectMesh, 0.194);
whiteBall.friction=0.05;
whiteBall.restitution=0.95;
_physics.addRigidBody(whiteBall);
How can I avoid that behavior? I need the ball to be affected by friction the same way in all the table surface.
I’ll keep looking for a solution as I wait for your replies. Thank you in advance for your time and help!
NOTE: The model is imported from a 3DS file.