Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- code for the coockeis
- cube = new Mesh(new CubeGeometry(10,10,10), material);
- addChild(cube);
- //cube.
- cube.rotationX = 90;
- y = 200;
- z = 500;
- x = randomRange(265, -265);
- //var shape:AWPConeShape = new AWPConeShape(20, 5);
- var shape:AWPBoxShape = new AWPBoxShape(10,10,10);
- var body : AWPRigidBody = new AWPRigidBody(shape, this, .25);
- body.position = this.getPosition();
- body.ccdSweptSphereRadius = 0.5;
- body.ccdMotionThreshold = 1;
- Config.world.addRigidBody(body);
- //Code for Basket
- var planeSize:Number = 50;
- var poolThickness:Number = 5;
- var thickOffSet:Number = poolThickness / 2;
- var sizeOffset:Number = planeSize / 2;
- var tex:BitmapData = new BitmapData(512, 512, false, 0);
- tex.perlinNoise(25, 25, 8, 1, false, true, 7, true);
- tex.colorTransform(tex.rect, new ColorTransform(0.1, 0.1, 0.1, 1, 0, 0, 0, 0));
- var poolMaterial = new TextureMaterial(new BitmapTexture(tex));
- var bottom:Mesh = new Mesh(new CubeGeometry(planeSize-(poolThickness * 2), poolThickness, planeSize -( poolThickness * 2)), poolMaterial);
- bottom.y = thickOffSet-sizeOffset;
- addChild(bottom);
- var left:Mesh = new Mesh(new CubeGeometry(poolThickness, planeSize, planeSize), poolMaterial);
- left.x = thickOffSet-sizeOffset;
- addChild(left);
- var right:Mesh = new Mesh(new CubeGeometry(poolThickness, planeSize, planeSize), poolMaterial);
- right.x = sizeOffset - thickOffSet;
- addChild(right);
- var back:Mesh = new Mesh(new CubeGeometry(planeSize-(poolThickness * 2), planeSize, poolThickness), poolMaterial);
- back.z = sizeOffset-thickOffSet;
- addChild(back);
- var front:Mesh = new Mesh(new CubeGeometry(planeSize-(poolThickness * 2), planeSize, poolThickness), poolMaterial);
- front.z = thickOffSet-sizeOffset;
- addChild(front);
- var bottomShape : AWPBoxShape = new AWPBoxShape(planeSize-(poolThickness * 2), poolThickness, planeSize -( poolThickness * 2));
- var leftShape : AWPBoxShape = new AWPBoxShape(poolThickness, planeSize, planeSize);
- var rightShape : AWPBoxShape = new AWPBoxShape(poolThickness, planeSize, planeSize);
- var backShape : AWPBoxShape = new AWPBoxShape(planeSize-(poolThickness * 2), planeSize, poolThickness);
- var frontShape : AWPBoxShape = new AWPBoxShape(planeSize-(poolThickness * 2), planeSize, poolThickness);
- var chairShape : AWPCompoundShape = new AWPCompoundShape();
- chairShape.addChildShape(bottomShape, new Vector3D(bottom.x,bottom.y,bottom.z), new Vector3D());
- chairShape.addChildShape(leftShape, new Vector3D(left.x,left.y,left.z), new Vector3D());
- chairShape.addChildShape(rightShape, new Vector3D(right.x,right.y,right.z), new Vector3D());
- chairShape.addChildShape(backShape, new Vector3D(back.x,back.y,back.z), new Vector3D());
- chairShape.addChildShape(frontShape, new Vector3D(front.x,front.y,front.z), new Vector3D());
- body= new AWPRigidBody(chairShape, this,2000);
- body.friction = .9;
- body.ccdSweptSphereRadius = 0.5;
- body.ccdMotionThreshold = 1;
- body.position = this.getPosition();
- world.addRigidBody(body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement