| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- /**
- * @author mikael emtinger / http://gomo.se/
- * @author alteredq / http://alteredqualia.com/
- */
- THREE.Sprite = function ( material ) {
- THREE.Object3D.call( this );
- this.material = ( material !== undefined ) ? material : new THREE.SpriteMaterial();
- this.rotation3d = this.rotation;
- this.rotation = 0;
- };
- THREE.Sprite.prototype = Object.create( THREE.Object3D.prototype );
- /*
- * Custom update matrix
- */
- THREE.Sprite.prototype.updateMatrix = function () {
- this.rotation3d.set( 0, 0, this.rotation, this.rotation3d.order );
- this.quaternion.setFromEuler( this.rotation3d );
- this.matrix.compose( this.position, this.quaternion, this.scale );
- this.matrixWorldNeedsUpdate = true;
- };
- THREE.Sprite.prototype.clone = function ( object ) {
- if ( object === undefined ) object = new THREE.Sprite( this.material );
- THREE.Object3D.prototype.clone.call( this, object );
- return object;
- };
|