I’ve been going through a lot of the different physics engines ( jiglib, alternativa3D physics ) and now awayPhysics. It looks very neat and the performance on the new version of away3D is amazing.
However i’ve written a small piece of code to test a simple “bounce” example. But for some reason my ball drops through the ground static plane that i set up ?
Anyone got any ideas ?
// PHYSICS WORLD SET UP
physicsWorld = AWPDynamicsWorld.getInstance();
physicsWorld.initWithDbvtBroadphase();
...
// GROUND SET UP
var ground:Mesh = new Mesh(new PlaneGeometry(500,500,1,1,false));
scene.addChild(ground);
ground.rotationX = 90;
var c_2D:Texture2DBase = new BitmapTexture(
(new texture_ground() as Bitmap).bitmapData
);
ground.material = new TextureMaterial(c_2D,true,true);
var ground_shape : AWPStaticPlaneShape = new AWPStaticPlaneShape(new Vector3D,0);
var ground_rigid : AWPRigidBody = new AWPRigidBody(ground_shape, ground, 0);
physicsWorld.addRigidBody(ground_rigid);
...
// BALL SET UP
var ball:Mesh = new Mesh(new SphereGeometry(BALL_RADIUS,16,12,true));
scene.addChild(ball);
var c_2D:Texture2DBase = new BitmapTexture(
(new texture_ball() as Bitmap).bitmapData
);
ball.material = new TextureMaterial(c_2D,true,false);
var ball_shape : AWPSphereShape = new AWPSphereShape(BALL_RADIUS);
ball_rigid = new AWPRigidBody(ball_shape, ball, 0.5);
physicsWorld.addRigidBody(ball_rigid);
ball_rigid.y = 300;
...
i really can’t see the issue :/