瀏覽代碼

Basketball game: update ball

customisations
alemart 8 月之前
父節點
當前提交
ddda3e6e53
共有 3 個檔案被更改,包括 2 行新增1 行删除
  1. 二進制
      demos/basketball/assets/ball.blend
  2. 二進制
      demos/basketball/assets/ball.glb
  3. 2
    1
      demos/basketball/src/entities/ball.js

二進制
demos/basketball/assets/ball.blend 查看文件


二進制
demos/basketball/assets/ball.glb 查看文件


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

11
 import { GameEvent } from '../core/events.js';
11
 import { GameEvent } from '../core/events.js';
12
 
12
 
13
 /** Radius of the ball */
13
 /** Radius of the ball */
14
-const BALL_RADIUS = 0.27;
14
+const BALL_RADIUS = 0.275;
15
 
15
 
16
 /** Minimum distance for scoring 3 points */
16
 /** Minimum distance for scoring 3 points */
17
 const THREE_POINT_THRESHOLD = 6.0;
17
 const THREE_POINT_THRESHOLD = 6.0;
384
 
384
 
385
         // create the root node
385
         // create the root node
386
         const physicsRoot = BABYLON.MeshBuilder.CreateSphere('Ball', { diameter: 2 * r });
386
         const physicsRoot = BABYLON.MeshBuilder.CreateSphere('Ball', { diameter: 2 * r });
387
+        physicsRoot.isVisible = false;
387
         physicsRoot.addChild(mesh);
388
         physicsRoot.addChild(mesh);
388
 
389
 
389
         physicsRoot.physicsImpostor = new BABYLON.PhysicsImpostor(physicsRoot, BABYLON.PhysicsImpostor.SphereImpostor, {
390
         physicsRoot.physicsImpostor = new BABYLON.PhysicsImpostor(physicsRoot, BABYLON.PhysicsImpostor.SphereImpostor, {

Loading…
取消
儲存