# 球と床を表示し、球を落として動きを確認する最小のSceneYAML projectです。
# 床の見た目と球の見た目をmaterialsで分け、球だけに物理設定を付けています。
name: sphere-plane-project-app
version: 1

# 画面に表示する表面の色と、PBR反射の設定です。
materials:
  # 床は暗い青灰色の、落ち着いた色にします。
  - id: floor-material
    color: [0.22, 0.28, 0.38, 1.0]
    metallic: 0.0
    roughness: 0.42
    specular: 0.72
  # 球は落下を見やすくするため、オレンジ色にします。
  - id: ball-material
    color: [0.94, 0.30, 0.08, 1.0]
    metallic: 0.15
    roughness: 0.20
    specular: 1.0

# 作品全体で使う重力、時間刻み、衝突面の設定です。
physics:
  space:
    gravity: [0.0, -9.8, 0.0]
    fixedTimeStepMs: 8.3333333333
    maxSubSteps: 8
    solverIterations: 10
    maxBodies: 1
    defaultRestitution: 0.12
    defaultFriction: 0.48
    persistentSleep: true
    # 高さ0の無限平面を置き、床の上面で球を受け止めます。
    planes:
      - normal: [0.0, 1.0, 0.0]
        planeDistance: 0.0

# 画面へ置く物体の一覧です。床は表示用、球は表示と物理の両方に使います。
objects:
  # 厚さ0.3mの床です。中心を高さ-0.15mに置くため、上面が高さ0mになります。
  - id: floor
    shape: { type: box, size: [12.0, 0.3, 8.0] }
    transform: { position: [0.0, -0.15, 0.0] }
    material: floor-material
  # 高さ3.2mから落とす球です。physicsを付けたdynamic bodyとして動きます。
  - id: ball
    shape: { type: sphere, radius: 0.5 }
    transform: { position: [0.0, 3.2, 0.0] }
    material: ball-material
    physics:
      bodyType: dynamic
      mass: 1.0
      linearDamping: 0.04
      angularDamping: 0.06
      material: { restitution: 0.18, friction: 0.36 }

# PBR profile、環境光、画面サイズ、画面効果の設定です。
renderer:
  profile: studio
  width: 960
  height: 640
  clearColor: [0.012, 0.018, 0.028, 1.0]
  environment:
    preset: dark-studio
    resolution: { width: 128, height: 64 }
  dof: { enabled: false }
  pipeline:
    lighting:
      ambient: 0.0
      directionalIntensity: 1.05
      environmentIntensity: 0.42
    ssao: { radius: 12.0, strength: 1.15, samples: 8 }
    ssr: { intensity: 0.65, distance: 24.0, steps: 28 }
    toneMap: { exposure: 1.0 }
