student-ar-org-papervision3d-core-culling-RectangleLineCuller.ax [swf] [flash] flex
*
author: Seb Lee-Delisle */ public class @ax-student-ar-org-papervision3d-core-culling-RectangleLineCuller implements ILineCuller { private var cullingRectangle : Rectangle; private var lineBoundsRect : Rectangle; // temporary rectangle to avoid object creation. private var rectIntersection : Rectangle; /** * @Author Seb Lee-Delisle * * @ax-student-ar-org-papervision3d-core-culling-RectangleLineCuller * * This Line Culler culls lines based upon whether they intersect the viewport rectangle. */ public function @ax-student-ar-org-papervision3d-core-culling-RectangleLineCuller(cullingRectangle:Rectangle = null):void { if(cullingRectangle){ this.cullingRectangle = cullingRectangle; } lineBoundsRect = new Rectangle(); rectIntersection = new Rectangle(); } public function testLine(line : Line3D) : Boolean { // if one or more of the points is behind the camera, then cull. if((!line.v0.vertex3DInstance.visible)||(!line.v1.vertex3DInstance.visible)) return false; var l0x : Number = line.v0.vertex3DInstance.x; var l0y : Number = line.v0.vertex3DInstance.y; var l1x : Number = line.v1.vertex3DInstance.x; var l1y : Number = line.v1.vertex3DInstance.y; // get the line bounds rect lineBoundsRect.width = Math.abs(l1x-l0x); lineBoundsRect.height = Math.abs(l1y-l0y); if(l0xrectIntersection.left) && (xcross rectIntersection.left) && (xcross rectIntersection.top) && (ycross rectIntersection.top) && (ycross
[]readme course(s) prefaceI 1 2II 3 4III 5 6 7IV 8 9 10V 11 12 afterthought(s)appendix reference(s) example(s)resource(s) _![]()
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.