FrustumVertex.js 331 B

123456789101112131415161718192021
  1. export default class FrustumVertex {
  2. constructor( x, y, z ) {
  3. this.x = x || 0;
  4. this.y = y || 0;
  5. this.z = z || 0;
  6. }
  7. fromLerp( v1, v2, amount ) {
  8. this.x = ( 1 - amount ) * v1.x + amount * v2.x;
  9. this.y = ( 1 - amount ) * v1.y + amount * v2.y;
  10. this.z = ( 1 - amount ) * v1.z + amount * v2.z;
  11. return this;
  12. }
  13. }