home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / bobsleddin.swf / scripts / __Packages / Splines3d / Line.as < prev   
Encoding:
Text File  |  2007-09-28  |  581 b   |  29 lines

  1. class Splines3d.Line
  2. {
  3.    var p0;
  4.    var p1;
  5.    var spanX;
  6.    var spanY;
  7.    var spanZ;
  8.    function Line(p0, p1)
  9.    {
  10.       this.p0 = p0;
  11.       this.p1 = p1;
  12.       this.update();
  13.    }
  14.    function getPoint(index)
  15.    {
  16.       return new Vector(this.p0.x + this.spanX * index,this.p0.y + this.spanY * index,this.p0.z + this.spanZ * index);
  17.    }
  18.    function update()
  19.    {
  20.       this.spanX = this.p1.x - this.p0.x;
  21.       this.spanY = this.p1.y - this.p0.y;
  22.       this.spanZ = this.p1.z - this.p0.z;
  23.    }
  24.    function toString()
  25.    {
  26.       return "Line";
  27.    }
  28. }
  29.