MeshBasicMaterial.js 1.5 KB
Newer Older
N
Nicolas Garcia Belmonte 已提交
1 2
/**
 * @author mr.doob / http://mrdoob.com/
3
 * @author alteredq / http://alteredqualia.com/
M
Mr.doob 已提交
4 5 6
 *
 * parameters = {
 *  color: <hex>,
7
 *  opacity: <float>,
8
 *  map: new THREE.Texture( <Image> ),
9
 *
10
 *  lightMap: new THREE.Texture( <Image> ),
11
 *
12
 *  envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),
13
 *  combine: THREE.Multiply,
14
 *  reflectivity: <float>,
15
 *  refractionRatio: <float>,
16
 *
17
 *  shading: THREE.SmoothShading,
M
Mr.doob 已提交
18
 *  blending: THREE.NormalBlending,
19
 *  depthTest: <bool>,
20
 *
M
Mr.doob 已提交
21
 *  wireframe: <boolean>,
22
 *  wireframeLinewidth: <float>,
23
 *
24 25
 *  vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
 *
26
 *  skinning: <bool>,
27
 *  morphTargets: <bool>,
28
 *
M
Mr.doob 已提交
29
 *  fog: <bool>
30
 * }
N
Nicolas Garcia Belmonte 已提交
31 32
 */

M
Mr.doob 已提交
33
THREE.MeshBasicMaterial = function ( parameters ) {
N
Nicolas Garcia Belmonte 已提交
34

M
Mr.doob 已提交
35
	THREE.Material.call( this );
36

M
Mr.doob 已提交
37
	this.color = new THREE.Color( 0xffffff ); // emissive
38

M
Mr.doob 已提交
39
	this.map = null;
40

M
Mr.doob 已提交
41
	this.lightMap = null;
42

M
Mr.doob 已提交
43 44 45 46
	this.envMap = null;
	this.combine = THREE.MultiplyOperation;
	this.reflectivity = 1;
	this.refractionRatio = 0.98;
47

M
Mr.doob 已提交
48
	this.fog = true;
49

M
Mr.doob 已提交
50
	this.shading = THREE.SmoothShading;
M
Mr.doob 已提交
51

M
Mr.doob 已提交
52 53 54 55
	this.wireframe = false;
	this.wireframeLinewidth = 1;
	this.wireframeLinecap = 'round';
	this.wireframeLinejoin = 'round';
M
Mr.doob 已提交
56

M
Mr.doob 已提交
57
	this.vertexColors = THREE.NoColors;
58

M
Mr.doob 已提交
59 60
	this.skinning = false;
	this.morphTargets = false;
M
Mr.doob 已提交
61

M
Mr.doob 已提交
62
	this.setParameters( parameters );
N
Nicolas Garcia Belmonte 已提交
63

M
Mr.doob 已提交
64
};
65

66
THREE.MeshBasicMaterial.prototype = Object.create( THREE.Material.prototype );
L
libra guest 已提交
67

M
Mr.doob 已提交
68 69 70
THREE.MeshBasicMaterial.prototype.clone = function () {

	return new THREE.MeshBasicMaterial( this );
L
libra guest 已提交
71 72

};