UNPKG

1.05 kBJavaScriptView Raw
1import { Material } from './Material.js';
2import { Color } from '../math/Color.js';
3
4/**
5 * @author mrdoob / http://mrdoob.com/
6 * @author alteredq / http://alteredqualia.com/
7 *
8 * parameters = {
9 * color: <hex>,
10 * opacity: <float>,
11 * map: new THREE.Texture( <Image> ),
12 *
13 * size: <float>,
14 * sizeAttenuation: <bool>
15 * }
16 */
17
18function PointsMaterial( parameters ) {
19
20 Material.call( this );
21
22 this.type = 'PointsMaterial';
23
24 this.color = new Color( 0xffffff );
25
26 this.map = null;
27
28 this.size = 1;
29 this.sizeAttenuation = true;
30
31 this.lights = false;
32
33 this.setValues( parameters );
34
35}
36
37PointsMaterial.prototype = Object.create( Material.prototype );
38PointsMaterial.prototype.constructor = PointsMaterial;
39
40PointsMaterial.prototype.isPointsMaterial = true;
41
42PointsMaterial.prototype.copy = function ( source ) {
43
44 Material.prototype.copy.call( this, source );
45
46 this.color.copy( source.color );
47
48 this.map = source.map;
49
50 this.size = source.size;
51 this.sizeAttenuation = source.sizeAttenuation;
52
53 return this;
54
55};
56
57
58export { PointsMaterial };