src/moveOutOfCode/Plane.js
function (matrix4x4) {
    let ismirror = matrix4x4.isMirroring()
        // get two vectors in the plane:
    let r = this.normal.randomNonParallelVector()
    let u = this.normal.cross(r)
    let v = this.normal.cross(u)
        // get 3 points in the plane:
    let point1 = this.normal.times(this.w)
    let point2 = point1.plus(u)
    let point3 = point1.plus(v)
        // transform the points:
    point1 = point1.multiply4x4(matrix4x4)
    point2 = point2.multiply4x4(matrix4x4)
    point3 = point3.multiply4x4(matrix4x4)
        // and create a new plane from the transformed points:
    let newplane = Plane.fromVector3Ds(point1, point2, point3)
    if (ismirror) {
            // the transform is mirroring
            // We should mirror the plane:
      newplane = newplane.flipped()
    }
    return newplane
  }
function (matrix4x4) {
    let ismirror = matrix4x4.isMirroring()
        // get two vectors in the plane:
    let r = this.normal.randomNonParallelVector()
    let u = this.normal.cross(r)
    let v = this.normal.cross(u)
        // get 3 points in the plane:
    let point1 = this.normal.times(this.w)
    let point2 = point1.plus(u)
    let point3 = point1.plus(v)
        // transform the points:
    point1 = point1.multiply4x4(matrix4x4)
    point2 = point2.multiply4x4(matrix4x4)
    point3 = point3.multiply4x4(matrix4x4)
        // and create a new plane from the transformed points:
    let newplane = Plane.fromVector3Ds(point1, point2, point3)
    if (ismirror) {
            // the transform is mirroring
            // We should mirror the plane:
      newplane = newplane.flipped()
    }
    return newplane
  }
function ( matrix4x4 ) { let ismirror = matrix4x4 . isMirroring ( ) // get two vectors in the plane: let r = this . normal . randomNonParallelVector ( ) let u = this . normal . cross ( r ) let v = this . normal . cross ( u ) // get 3 points in the plane: let point1 = this . normal . times ( this . w ) let point2 = point1 . plus ( u ) let point3 = point1 . plus ( v ) // transform the points: point1 = point1 . multiply4x4 ( matrix4x4 ) point2 = point2 . multiply4x4 ( matrix4x4 ) point3 = point3 . multiply4x4 ( matrix4x4 ) // and create a new plane from the transformed points: let newplane = Plane . fromVector3Ds ( point1 , point2 , point3 ) if ( ismirror ) { // the transform is mirroring // We should mirror the plane: newplane = newplane . flipped ( ) } return newplane }
CONVERTED TO V2
CONVERTED TO V2