@@ -42,7 +42,7 @@ THREE.MD2Character = function () {
4242
4343 var loader = new THREE . MD2Loader ( ) ;
4444
45- loader . load ( config . baseUrl + config . body , function ( geo ) {
45+ loader . load ( config . baseUrl + config . body , function ( geo ) {
4646
4747 geo . computeBoundingBox ( ) ;
4848 scope . root . position . y = - scope . scale * geo . boundingBox . min . y ;
@@ -55,7 +55,7 @@ THREE.MD2Character = function () {
5555 scope . meshBody = mesh ;
5656
5757 scope . meshBody . clipOffset = 0 ;
58- scope . activeAnimationClipName = mesh . geometry . animations [ 0 ] . name ;
58+ scope . activeAnimationClipName = mesh . geometry . animations [ 0 ] . name ;
5959
6060 scope . mixer = new THREE . AnimationMixer ( mesh ) ;
6161
@@ -67,7 +67,7 @@ THREE.MD2Character = function () {
6767
6868 var generateCallback = function ( index , name ) {
6969
70- return function ( geo ) {
70+ return function ( geo ) {
7171
7272 var mesh = createPart ( geo , scope . skinsWeapon [ index ] ) ;
7373 mesh . scale . set ( scope . scale , scope . scale , scope . scale ) ;
@@ -82,7 +82,7 @@ THREE.MD2Character = function () {
8282
8383 checkLoadingComplete ( ) ;
8484
85- }
85+ } ;
8686
8787 } ;
8888
@@ -96,11 +96,14 @@ THREE.MD2Character = function () {
9696
9797 this . setPlaybackRate = function ( rate ) {
9898
99- if ( rate !== 0 ) {
99+ if ( rate !== 0 ) {
100+
100101 this . mixer . timeScale = 1 / rate ;
101- }
102- else {
102+
103+ } else {
104+
103105 this . mixer . timeScale = 0 ;
106+
104107 }
105108
106109 } ;
@@ -121,7 +124,7 @@ THREE.MD2Character = function () {
121124
122125 } ;
123126
124- this . setSkin = function ( index ) {
127+ this . setSkin = function ( index ) {
125128
126129 if ( this . meshBody && this . meshBody . material . wireframe === false ) {
127130
@@ -152,13 +155,16 @@ THREE.MD2Character = function () {
152155
153156 if ( this . meshBody ) {
154157
155- if ( this . meshBody . activeAction ) {
158+ if ( this . meshBody . activeAction ) {
159+
156160 this . meshBody . activeAction . stop ( ) ;
157161 this . meshBody . activeAction = null ;
162+
158163 }
159164
160165 var action = this . mixer . clipAction ( clipName , this . meshBody ) ;
161- if ( action ) {
166+
167+ if ( action ) {
162168
163169 this . meshBody . activeAction = action . play ( ) ;
164170
@@ -172,35 +178,34 @@ THREE.MD2Character = function () {
172178
173179 } ;
174180
175- this . syncWeaponAnimation = function ( ) {
181+ this . syncWeaponAnimation = function ( ) {
176182
177183 var clipName = scope . activeClipName ;
178184
179185 if ( scope . meshWeapon ) {
180186
181- if ( this . meshWeapon . activeAction ) {
187+ if ( this . meshWeapon . activeAction ) {
188+
182189 this . meshWeapon . activeAction . stop ( ) ;
183190 this . meshWeapon . activeAction = null ;
184- }
185191
186- var geometry = this . meshWeapon . geometry ,
187- animations = geometry . animations ;
192+ }
188193
189194 var action = this . mixer . clipAction ( clipName , this . meshWeapon ) ;
190- if ( action ) {
191195
192- this . meshWeapon . activeAction =
193- action . syncWith ( this . meshBody . activeAction ) . play ( ) ;
196+ if ( action ) {
197+
198+ this . meshWeapon . activeAction = action . syncWith ( this . meshBody . activeAction ) . play ( ) ;
194199
195200 }
196201
197202 }
198203
199- }
204+ } ;
200205
201206 this . update = function ( delta ) {
202207
203- if ( this . mixer ) this . mixer . update ( delta ) ;
208+ if ( this . mixer ) this . mixer . update ( delta ) ;
204209
205210 } ;
206211
0 commit comments