提交 e58553d1 编写于 作者: M Mr.doob

Renamed ParticleSystem to Points and ParticleSystemMaterial to PointsMaterial. See #4726.

上级 3c49906e
......@@ -15,7 +15,7 @@ THREE.Geometry = function () {
this.name = '';
this.vertices = [];
this.colors = []; // one-to-one vertex colors, used in ParticleSystem and Line
this.colors = []; // one-to-one vertex colors, used in Points and Line
this.faces = [];
......
......@@ -197,7 +197,7 @@ THREE.CurvePath.prototype.getBoundingBox = function () {
* Create Geometries Helpers
**************************************************************/
/// Generate geometry from path points (for Line or ParticleSystem objects)
/// Generate geometry from path points (for Line or Points objects)
THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) {
......
......@@ -88,7 +88,7 @@ THREE.DepthPassPlugin = function () {
if ( object.visible ) {
if ( ! ( object instanceof THREE.Mesh || object instanceof THREE.ParticleSystem ) || ! ( object.frustumCulled ) || _frustum.intersectsObject( object ) ) {
if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {
object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
......@@ -115,7 +115,7 @@ THREE.DepthPassPlugin = function () {
// todo: create proper depth material for particles
if ( object instanceof THREE.ParticleSystem && !object.customDepthMaterial ) continue;
if ( object instanceof THREE.Points && !object.customDepthMaterial ) continue;
objectMaterial = getObjectMaterial( object );
......
......@@ -241,7 +241,7 @@ THREE.ShadowMapPlugin = function () {
if ( object.visible && object.castShadow ) {
if ( ! ( object instanceof THREE.Mesh || object instanceof THREE.ParticleSystem ) || ! ( object.frustumCulled ) || _frustum.intersectsObject( object ) ) {
if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {
object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
......
......@@ -19,7 +19,7 @@
* }
*/
THREE.ParticleSystemMaterial = function ( parameters ) {
THREE.PointsMaterial = function ( parameters ) {
THREE.Material.call( this );
......@@ -38,11 +38,11 @@ THREE.ParticleSystemMaterial = function ( parameters ) {
};
THREE.ParticleSystemMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.PointsMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.ParticleSystemMaterial.prototype.clone = function () {
THREE.PointsMaterial.prototype.clone = function () {
var material = new THREE.ParticleSystemMaterial();
var material = new THREE.PointsSystemMaterial();
THREE.Material.prototype.clone.call( this, material );
......@@ -63,4 +63,9 @@ THREE.ParticleSystemMaterial.prototype.clone = function () {
// backwards compatibility
THREE.ParticleBasicMaterial = THREE.ParticleSystemMaterial;
THREE.ParticleSystemMaterial = function ( parameters ) {
console.warn( 'THREE.ParticleSystemMaterial has been DEPRECATED. Use THREE.PointsMaterial instead.' );
return new THREE.PointsMaterial( parameters );
}
\ No newline at end of file
......@@ -2,22 +2,22 @@
* @author alteredq / http://alteredqualia.com/
*/
THREE.ParticleSystem = function ( geometry, material ) {
THREE.Points = function ( geometry, material ) {
THREE.Object3D.call( this );
this.geometry = geometry !== undefined ? geometry : new THREE.Geometry();
this.material = material !== undefined ? material : new THREE.ParticleSystemMaterial( { color: Math.random() * 0xffffff } );
this.material = material !== undefined ? material : new THREE.PointsMaterial( { color: Math.random() * 0xffffff } );
this.sortParticles = false;
};
THREE.ParticleSystem.prototype = Object.create( THREE.Object3D.prototype );
THREE.Points.prototype = Object.create( THREE.Object3D.prototype );
THREE.ParticleSystem.prototype.clone = function ( object ) {
THREE.Points.prototype.clone = function ( object ) {
if ( object === undefined ) object = new THREE.ParticleSystem( this.geometry, this.material );
if ( object === undefined ) object = new THREE.Points( this.geometry, this.material );
object.sortParticles = this.sortParticles;
......@@ -26,3 +26,12 @@ THREE.ParticleSystem.prototype.clone = function ( object ) {
return object;
};
// Backwards compatibility
THREE.ParticleSystem = function ( geometry, material ) {
console.warn( 'THREE.ParticleSystem has been DEPRECATED. Use THREE.Points instead.' );
return new THREE.Points( geometry, material );
};
\ No newline at end of file
......@@ -441,8 +441,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_elemBox.min.set( v1.x - dist, v1.y - dist );
_elemBox.max.set( v1.x + dist, v1.y + dist );
if ( material instanceof THREE.SpriteMaterial ||
material instanceof THREE.ParticleSystemMaterial ) { // Backwards compatibility
if ( material instanceof THREE.SpriteMaterial ) {
var texture = material.map;
......@@ -494,7 +493,9 @@ THREE.CanvasRenderer = function ( parameters ) {
_context.fillRect( ox, oy, sx, sy );
_context.restore();
} else { // no texture
} else {
// no texture
setFillStyle( material.color.getStyle() );
......
......@@ -2674,7 +2674,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
} else if ( object instanceof THREE.ParticleSystem ) {
} else if ( object instanceof THREE.Points ) {
// render particles
......@@ -3006,7 +3006,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// render particles
} else if ( object instanceof THREE.ParticleSystem ) {
} else if ( object instanceof THREE.Points ) {
_gl.drawArrays( _gl.POINTS, 0, geometryGroup.__webglParticleCount );
......@@ -3762,7 +3762,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
} else if ( object instanceof THREE.ParticleSystem ) {
} else if ( object instanceof THREE.Points ) {
if ( ! geometry.__webglVertexBuffer ) {
......@@ -3803,7 +3803,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
} else if ( object instanceof THREE.Line ||
object instanceof THREE.ParticleSystem ) {
object instanceof THREE.Points ) {
geometry = object.geometry;
addBuffer( scene.__webglObjects, geometry, object );
......@@ -3927,7 +3927,7 @@ THREE.WebGLRenderer = function ( parameters ) {
material.attributes && clearCustomAttributes( material );
} else if ( object instanceof THREE.ParticleSystem ) {
} else if ( object instanceof THREE.Points ) {
material = getBufferMaterial( object, geometry );
......@@ -3977,7 +3977,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function removeObject( object, scene ) {
if ( object instanceof THREE.Mesh ||
object instanceof THREE.ParticleSystem ||
object instanceof THREE.Points ||
object instanceof THREE.Line ) {
removeInstances( scene.__webglObjects, object );
......@@ -4064,7 +4064,7 @@ THREE.WebGLRenderer = function ( parameters ) {
shaderID = 'dashed';
} else if ( material instanceof THREE.ParticleSystemMaterial ) {
} else if ( material instanceof THREE.PointsMaterial ) {
shaderID = 'particle_basic';
......@@ -4400,7 +4400,7 @@ THREE.WebGLRenderer = function ( parameters ) {
refreshUniformsLine( m_uniforms, material );
refreshUniformsDash( m_uniforms, material );
} else if ( material instanceof THREE.ParticleSystemMaterial ) {
} else if ( material instanceof THREE.PointsMaterial ) {
refreshUniformsParticle( m_uniforms, material );
......
......@@ -43,7 +43,7 @@
"src/materials/MeshDepthMaterial.js",
"src/materials/MeshNormalMaterial.js",
"src/materials/MeshFaceMaterial.js",
"src/materials/ParticleSystemMaterial.js",
"src/materials/PointsMaterial.js",
"src/materials/SpriteMaterial.js",
"src/materials/SpriteCanvasMaterial.js",
"src/textures/Texture.js",
......
......@@ -57,7 +57,7 @@
"src/materials/MeshDepthMaterial.js",
"src/materials/MeshNormalMaterial.js",
"src/materials/MeshFaceMaterial.js",
"src/materials/ParticleSystemMaterial.js",
"src/materials/PointsMaterial.js",
"src/materials/ShaderMaterial.js",
"src/materials/RawShaderMaterial.js",
"src/materials/SpriteMaterial.js",
......@@ -65,7 +65,7 @@
"src/textures/Texture.js",
"src/textures/CompressedTexture.js",
"src/textures/DataTexture.js",
"src/objects/ParticleSystem.js",
"src/objects/Points.js",
"src/objects/Line.js",
"src/objects/Mesh.js",
"src/objects/Bone.js",
......
......@@ -10,7 +10,6 @@
"src/math/Matrix4.js",
"src/math/Frustum.js",
"src/math/Math.js",
"src/math/Vertex.js",
"src/math/Spline.js",
"src/math/Box2.js",
"src/math/Box3.js",
......@@ -50,14 +49,14 @@
"src/materials/MeshDepthMaterial.js",
"src/materials/MeshNormalMaterial.js",
"src/materials/MeshFaceMaterial.js",
"src/materials/ParticleSystemMaterial.js",
"src/materials/PointsMaterial.js",
"src/materials/ShaderMaterial.js",
"src/materials/RawShaderMaterial.js",
"src/materials/SpriteMaterial.js",
"src/textures/Texture.js",
"src/textures/CompressedTexture.js",
"src/textures/DataTexture.js",
"src/objects/ParticleSystem.js",
"src/objects/Points.js",
"src/objects/Line.js",
"src/objects/Mesh.js",
"src/objects/Bone.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册