topical media & game development

talk show tell print

student-ar-org-papervision3d-core-geom-renderables-Line3D.ax

student-ar-org-papervision3d-core-geom-renderables-Line3D.ax [swf] [flash] flex


  package org.papervision3d.core.geom.renderables
  {
          
          
           
          import org.papervision3d.core.geom.Lines3D;
          import org.papervision3d.core.render.command.IRenderListItem;
          import org.papervision3d.core.render.command.RenderLine;
          import org.papervision3d.materials.special.LineMaterial;
  
          
@ax-student-ar-org-papervision3d-core-geom-renderables-Line3D is used by Lines3D to store and render the lines. See Lines3D for a full explanation. @Author Ralph Hauwert @Author Andy Zupko @Author Seb Lee-Delisle

  
  
          public class @ax-student-ar-org-papervision3d-core-geom-renderables-Line3D extends AbstractRenderable implements IRenderable
          {
                  
                  public var v0:Vertex3D;
                  public var v1:Vertex3D;
                  public var cV:Vertex3D;                
                  public var material:LineMaterial;
                  public var renderCommand:RenderLine;
                  public var size:Number;
                  

parameter: instance The containing Lines3D object
parameter: material The material for the line
parameter: size The line weight
parameter: vertex0 The start vertex
parameter: vertex1 The end vertex

                  
                  public function @ax-student-ar-org-papervision3d-core-geom-renderables-Line3D(instance:Lines3D, material:LineMaterial, size:Number, vertex0:Vertex3D, vertex1:Vertex3D)
                  {
                          this.size = size;
                          this.material = material;
                          this.v0 = vertex0;
                          this.v1 = vertex1;
                          this.cV = vertex1;
                          this.instance = instance;
                          this.renderCommand = new RenderLine(this);
                  }
                  
                  public function addControlVertex(cx:Number, cy:Number, cz:Number) :void
                  {
                          cV = new Vertex3D(cx,cy,cz);
                          
                          if(instance.geometry.vertices.indexOf(cV) == -1){
                                  instance.geometry.vertices.push(cV);
                          }                
                          
                  }
                  
                  
                  override public function getRenderListItem():IRenderListItem
                  {
                          return this.renderCommand;
                  }
                  
          }
  }


(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.