Files
three.js/src/materials/ParticleBasicMaterial.js
T
Mr.doob 5f0b6876e6 Optimised Minecraft AO demo (removing more unseen sides).
Made 0xffffff the default color on all materials (0xeeeeee was making the AO a bit darker).
2010-12-14 10:39:48 +00:00

42 lines
1017 B
JavaScript

/**
* @author mr.doob / http://mrdoob.com/
*
* parameters = {
* color: <hex>,
* map: new THREE.Texture( <Image> ),
* opacity: <float>,
* blending: THREE.NormalBlending
* }
*/
THREE.ParticleBasicMaterial = function ( parameters ) {
this.color = new THREE.Color( 0xffffff );
this.map = null;
this.opacity = 1;
this.blending = THREE.NormalBlending;
this.offset = new THREE.Vector2(); // TODO: expose to parameters
if ( parameters ) {
if ( parameters.color !== undefined ) this.color.setHex( parameters.color );
if ( parameters.map !== undefined ) this.map = parameters.map;
if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity;
if ( parameters.blending !== undefined ) this.blending = parameters.blending;
}
this.toString = function () {
return 'THREE.ParticleBasicMaterial (<br/>' +
'color: ' + this.color + '<br/>' +
'map: ' + this.map + '<br/>' +
'opacity: ' + this.opacity + '<br/>' +
'blending: ' + this.blending + '<br/>' +
')';
};
};