Collisions/ja: Difference between revisions
(Created page with "X方向がZ方向よりも先に処理されるため、壁の角での衝突判定は方向によって異なる。") |
(Created page with "「X方向」のジャンプと「Z方向」のジャンプの区別が重要:") |
||
Line 57: | Line 57: | ||
[[File:XZ collision.png|frameless|720x720px]] |
[[File:XZ collision.png|frameless|720x720px]] |
||
「X方向」のジャンプと「Z方向」のジャンプの区別が重要: |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
It's important to distinguish "X-facing" jumps from "Z-facing" ones: |
|||
</div> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
<div lang="en" dir="ltr" class="mw-content-ltr"> |
Revision as of 06:20, 21 May 2022
Minecraftの衝突判定は至ってシンプル: レイトレーシングによる衝突判定ではなく、単にプレイヤーを各座標軸に沿って順次移動させている。
注意点として、Minecraft内の物理演算の更新レートは毎秒20tickである。プレイヤーの動きと衝突の更新は1tickごとに行われる。
当たり判定
当たり判定は1つ以上のバウンディングボックスから成る。バウンディングボックスとはX/Y/Zそれぞれの座標の最小/最大値で定義されている、単純な直方体。
衝突判定は通常、エンティティとブロック両方が関係する: エンティティ同士/ブロック同士では通常は衝突判定は行われない。
- プレイヤーのバウンディングボックスは1つで、大きさは 0.6×1.8×0.6 m3。位置判定は底部中央(F3で確認できる)。
- ブロックの当たり判定はより複雑(リストを参照)。
注: 「ヒットボックス」はプレイヤーがクリック(エンティティへの攻撃/ボタンの使用/ドアの開閉など)できる範囲のこと。当たり判定と重なっているとは限らない。
衝突判定の順
毎tick、プレイヤーの速度の更新後、以下の手順で衝突判定が行われる:
- プレイヤーをY軸方向に動かす。下方移動中に垂直方向の当たり判定が検出された場合、プレイヤーは地面に接しているとみなされる。
- プレイヤーをX軸方向に動かす。
- プレイヤーをZ軸方向に動かす。
- プレイヤーが地面に接していて壁に衝突した場合、高さが0.6m以下なら壁に上れる。
垂直方向の衝突判定(Y)
垂直方向の動きは水平方向の動きよりも先に処理される。このため:
- ブロックの判定内から出た1tick後でもジャンプできる。ブロック縁からずらしができるのはこのため。
- ブロックに着地するには、ジャンプの最後のtickにプレイヤーのバウンディングボックスがそのブロックの表面と重なっている必要がある。
床か天井にぶつかると、垂直方向の速度は0になる。
水平方向の衝突判定(X/Z)
X方向がZ方向よりも先に処理されるため、壁の角での衝突判定は方向によって異なる。
この現象は、速度が大きい場合により顕著になる。
「X方向」のジャンプと「Z方向」のジャンプの区別が重要:
- X-facing refers to jumps that point towards East/West. The corner is difficult to avoid, and the player may have to start jumping further back than expected.
- Z-facing refers to jumps that point towards North/South. The corner is easier to avoid, and in particular it's possible to do a hh-timing from the front.
The axis of a jump can be checked with F3.
Players tend to find Z-facing neos more intuitive, but X-facing neos can actually be more lenient:
- Z-facing neos are very similar to linear jumps (assuming optimal movement). To convert a neo, simply add 1.2 to its distance and increase its tier by one. For example, a triple neo is equivalent to a "4.2+0.25" (which cannot be built, but this sort of comparison is useful for analysis)
- X-facing neos don't have a linear equivalent. Compared to Z-facing neos, they are "shifted" by 1 tick (wall collision begins and ends 1 tick earlier). This shift reduces the momentum, but makes it more efficient as the player typically has more speed at the end of a jump than at the start.
Some jumps are only possible when facing one axis or the other (for example, a 2bm triple neo is only possible X-facing)
1.14+
In 1.14, the collision physics were updated. The collision order now depends on the player's velocity:
- If the player has more Z speed than X speed (in absolute value), the collision order is Y-X-Z.
- Otherwise, the collision order is Y-Z-X.
In most cases, all collisions now resemble X-facing. Some jumps which involve cutting corners may be very different compared to pre-1.14.