private function extrudeWall (wallArr:Array):void {
mergeTool = new Merge(false,true);
_finalWallMesh = new Mesh();
var wallNum = wallArr.length;
for (var i:uint =0;i<wallNum; i++ ){
var path:Vector.<Vector3D> = new Vector.<Vector3D >([new Vector3D(),new Vector3D()]);
path[0]= wallArr[i][0];
path[1]= wallArr[i][1];
var wallExtrude = new LinearExtrude(wallMaterial, path, LinearExtrude.Y_AXIS, 30, 1, false, 3,1,null, false,false, "", false);
_finalWallMeshArr.push (Mesh(wallExtrude));
//wallContainer.addChild(wallExtrude);
}
_finalWallMesh= mergeTool.applyToMeshes(Mesh(_finalWallMeshArr.shift()), _finalWallMeshArr);
_finalWallMesh.material= wallMaterial;
wallContainer.addChild(_finalWallMesh);
}
I was very confused why after the merge to one mesh , my scene get much more PLOYs and runs very slow than before ?