123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import { Material } from './Material.js';
- import { Vector3 } from '../math/Vector3.js';
- /**
- * parameters = {
- *
- * referencePosition: <float>,
- * nearDistance: <float>,
- * farDistance: <float>,
- *
- * map: new THREE.Texture( <Image> ),
- *
- * alphaMap: new THREE.Texture( <Image> ),
- *
- * displacementMap: new THREE.Texture( <Image> ),
- * displacementScale: <float>,
- * displacementBias: <float>
- *
- * }
- */
- class MeshDistanceMaterial extends Material {
- constructor( parameters ) {
- super();
- this.type = 'MeshDistanceMaterial';
- this.referencePosition = new Vector3();
- this.nearDistance = 1;
- this.farDistance = 1000;
- this.map = null;
- this.alphaMap = null;
- this.displacementMap = null;
- this.displacementScale = 1;
- this.displacementBias = 0;
- this.fog = false;
- this.setValues( parameters );
- }
- copy( source ) {
- super.copy( source );
- this.referencePosition.copy( source.referencePosition );
- this.nearDistance = source.nearDistance;
- this.farDistance = source.farDistance;
- this.map = source.map;
- this.alphaMap = source.alphaMap;
- this.displacementMap = source.displacementMap;
- this.displacementScale = source.displacementScale;
- this.displacementBias = source.displacementBias;
- return this;
- }
- }
- MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;
- export { MeshDistanceMaterial };
|