瀏覽代碼

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

Loading…
取消
儲存