瀏覽代碼

Basketball game: fix

customisations
alemart 9 月之前
父節點
當前提交
df2ba098e4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      demos/basketball/src/entities/ball.js

+ 1
- 1
demos/basketball/src/entities/ball.js 查看文件

149
 
149
 
150
             if(position.x > 60) {
150
             if(position.x > 60) {
151
                 impostor.mass = 1; // enable gravity
151
                 impostor.mass = 1; // enable gravity
152
+                this._positionWhenThrown.copyFrom(mesh.absolutePosition);
152
                 this._state = 'throwing';
153
                 this._state = 'throwing';
153
             }
154
             }
154
         }
155
         }
209
             -magnitude * Math.cos(SHOOT_ANGLE)
210
             -magnitude * Math.cos(SHOOT_ANGLE)
210
         );
211
         );
211
 
212
 
212
-        this._positionWhenThrown.copyFrom(this._mesh.absolutePosition);
213
         this._mesh.physicsImpostor.applyImpulse(impulse, this._mesh.absolutePosition);
213
         this._mesh.physicsImpostor.applyImpulse(impulse, this._mesh.absolutePosition);
214
         this._state = 'thrown';
214
         this._state = 'thrown';
215
     }
215
     }

Loading…
取消
儲存