Hi all. Got some problem here. I’ve edited the exmaple from jiglib Away3DStackingTest.as. Trying to replace balls with cylinders. Got this code:
coinBody = new Vector.<JTriangleMesh>();
var cylinder:Cylinder;
for (var i:int = 0; i < 15; i++)
{
cylinder = new Cylinder(materia, 22, 22, 4);
view.scene.addChild(cylinder);
coinBody[i] = physics.createMesh(Mesh(cylinder),new Vector3D(),new Matrix3D(),10,10);
coinBody[i].moveTo(new Vector3D( -150 + Math.random() * 300, 250 + Math.random() * 50, -250 + Math.random() * 500));
coinBody[i].movable = true;
coinBody[i].mass = 10;
// coinBody[i].addWorldForce(new Vector3D(10, 10, 10, 2), new Vector3D(100, 0, 0, 0), true);
}
coinBody[0].mass = 10;
physics.getMesh(coinBody[0]).material=new ColorMaterial(0xff8888);
physics.getMesh(coinBody[0]).material.lights=[mylight];
boxBody = new Vector.<RigidBody>();
for (i = 0; i < 15; i++)
{
boxBody[i] = physics.createCube(materia, 50, 50, 50 );
boxBody[i].moveTo(new Vector3D( -150 + Math.random() * 300, 450 + Math.random() * 50, -250 + Math.random() * 500));
}
It draws my coins, but they just stay on the initial position. They dont fall, on the ground. Boxes hit them and bounce, so they init as bodies. But even with setting mass and movable they igonre gravity ^^.