1 | import { Material } from './Material.js';
|
2 | import { Vector3 } from '../math/Vector3.js';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | function MeshDistanceMaterial( parameters ) {
|
28 |
|
29 | Material.call( this );
|
30 |
|
31 | this.type = 'MeshDistanceMaterial';
|
32 |
|
33 | this.referencePosition = new Vector3();
|
34 | this.nearDistance = 1;
|
35 | this.farDistance = 1000;
|
36 |
|
37 | this.skinning = false;
|
38 | this.morphTargets = false;
|
39 |
|
40 | this.map = null;
|
41 |
|
42 | this.alphaMap = null;
|
43 |
|
44 | this.displacementMap = null;
|
45 | this.displacementScale = 1;
|
46 | this.displacementBias = 0;
|
47 |
|
48 | this.fog = false;
|
49 | this.lights = false;
|
50 |
|
51 | this.setValues( parameters );
|
52 |
|
53 | }
|
54 |
|
55 | MeshDistanceMaterial.prototype = Object.create( Material.prototype );
|
56 | MeshDistanceMaterial.prototype.constructor = MeshDistanceMaterial;
|
57 |
|
58 | MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;
|
59 |
|
60 | MeshDistanceMaterial.prototype.copy = function ( source ) {
|
61 |
|
62 | Material.prototype.copy.call( this, source );
|
63 |
|
64 | this.referencePosition.copy( source.referencePosition );
|
65 | this.nearDistance = source.nearDistance;
|
66 | this.farDistance = source.farDistance;
|
67 |
|
68 | this.skinning = source.skinning;
|
69 | this.morphTargets = source.morphTargets;
|
70 |
|
71 | this.map = source.map;
|
72 |
|
73 | this.alphaMap = source.alphaMap;
|
74 |
|
75 | this.displacementMap = source.displacementMap;
|
76 | this.displacementScale = source.displacementScale;
|
77 | this.displacementBias = source.displacementBias;
|
78 |
|
79 | return this;
|
80 |
|
81 | };
|
82 |
|
83 |
|
84 | export { MeshDistanceMaterial };
|