@@ -19,6 +19,8 @@ function Points( geometry, material ) {
1919 this . geometry = geometry !== undefined ? geometry : new BufferGeometry ( ) ;
2020 this . material = material !== undefined ? material : new PointsMaterial ( { color : Math . random ( ) * 0xffffff } ) ;
2121
22+ this . updateMorphTargets ( ) ;
23+
2224}
2325
2426Points . prototype = Object . assign ( Object . create ( Object3D . prototype ) , {
@@ -136,6 +138,38 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
136138
137139 } ( ) ) ,
138140
141+ updateMorphTargets : function ( ) {
142+
143+ var geometry = this . geometry ;
144+ var m , ml , name ;
145+
146+ var morphAttributes = geometry . morphAttributes ;
147+ var keys = Object . keys ( morphAttributes ) ;
148+
149+ if ( keys . length > 0 ) {
150+
151+ var morphAttribute = morphAttributes [ keys [ 0 ] ] ;
152+
153+ if ( morphAttribute !== undefined ) {
154+
155+ this . morphTargetInfluences = [ ] ;
156+ this . morphTargetDictionary = { } ;
157+
158+ for ( m = 0 , ml = morphAttribute . length ; m < ml ; m ++ ) {
159+
160+ name = morphAttribute [ m ] . name || String ( m ) ;
161+
162+ this . morphTargetInfluences . push ( 0 ) ;
163+ this . morphTargetDictionary [ name ] = m ;
164+
165+ }
166+
167+ }
168+
169+ }
170+
171+ } ,
172+
139173 clone : function ( ) {
140174
141175 return new this . constructor ( this . geometry , this . material ) . copy ( this ) ;
@@ -144,5 +178,4 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
144178
145179} ) ;
146180
147-
148181export { Points } ;
0 commit comments