Collisions/zh: Difference between revisions

From Minecraft Parkour Wiki
Content added Content deleted
(Created page with "* 沿 Y 轴移动玩家。如果在向下移动时检测到垂直碰撞,则玩家现在被认定在地面上。 * 沿 X 轴移动玩家。 * 沿 Z 轴移动玩家。 * 如...")
(Created page with "== 垂直碰撞(Y) ==")
Line 35: Line 35:




== 垂直碰撞(Y) ==
<div lang="en" dir="ltr" class="mw-content-ltr">
== Vertical Collisions (Y)==
</div>


在水平移动之前处理垂直移动。由于这个:
<div lang="en" dir="ltr" class="mw-content-ltr">
Vertical movement is processed before horizontal movement. Due to this:
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">

Revision as of 08:31, 14 November 2021

Other languages:

Minecraft 的碰撞物理非常简单:游戏没有光线追踪碰撞,而是简单地沿每个轴顺序移动玩家。

在此提醒,Minecraft的物理更新速度为每秒 20 ticks。玩家的移动和碰撞每Tick更新一次。


碰撞箱

一个碰撞箱由一个或多个边界箱组成,边界箱是由最小和最大 X/Y/Z 坐标定义的简单长方体。

碰撞通常涉及一个实体和一个方块:方块和方块之间通常不会相互碰撞。

  • 玩家只有一个边界箱,尺寸为 0.6×1.8×0.6 m3。它们的位置(如F3所示)位于底部中心


注意:判定箱'是玩家可以点击的(例如攻击实体、按下按钮、打开门)。它不一定与碰撞框重叠。


碰撞顺序

每次更新玩家速度后,游戏会执行以下步骤来检查碰撞情况:

  • 沿 Y 轴移动玩家。如果在向下移动时检测到垂直碰撞,则玩家现在被认定在地面上。
  • 沿 X 轴移动玩家。
  • 沿 Z 轴移动玩家。
  • 如果玩家在地面上撞到一堵墙并且墙的高度小于0.6米,他们可以跨过墙。


垂直碰撞(Y)

在水平移动之前处理垂直移动。由于这个:

  • The player is able to jump one tick after running off a block. In particular, this is why headhitter timing works.
  • To land on a block, the player's bounding box must overlap its surface on the final tick of the jump.


When the player hits a floor or ceiling, their vertical speed is reset to 0.


Horizontal Collisions (X/Z)

Due to the X axis being processed before the Z axis, corner collisions don't behave the same depending on the direction.

This phenomenon is especially noticeable with more speed.

It's important to distinguish "X-facing" jumps from "Z-facing" ones:

  • 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.