Hey, I’m having trouble getting my loop to run efficiently on slower computers.
I’ve made some speed improvements, but i’s still not fast enough. Could someone give me their 2 cents of how to speed it up?
// all verticles are vectors, *plane is a away3dlite plane
private function updateVerticles():void {
var __p:int = this.$planes.length;
for (var i : int = 0; i < __p; i++) {
var id:int = this.$planes*.id, pointingrid:Point = this.$planes*.pointInGrid;
this.$planes*.plane.vertices[0]=this.$verticles[id+pointingrid.y+this.$segX].x;
this.$planes*.plane.vertices[1]=this.$verticles[id+pointingrid.y+this.$segX].y;
this.$planes*.plane.vertices[3]=this.$verticles[id+pointingrid.y+this.$segX+1].x;
this.$planes*.plane.vertices[4]=this.$verticles[id+pointingrid.y+this.$segX+1].y;
this.$planes*.plane.vertices[6]=this.$verticles[id+pointingrid.y].x;
this.$planes*.plane.vertices[7]=this.$verticles[id+pointingrid.y].y;
this.$planes*.plane.vertices[9]=this.$verticles[id+pointingrid.y+1].x;
this.$planes*.plane.vertices[10]=this.$verticles[id+pointingrid.y+1].y;
this.$planes*.plane.material.dirty = true;
}
this.$view.render();
}