forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSprite.js
More file actions
42 lines (25 loc) · 905 Bytes
/
Copy pathSprite.js
File metadata and controls
42 lines (25 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* @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;
};