Vertical Movement Formulas/zh: Difference between revisions
Content added Content deleted
(Created page with "在 1.9+,这个阈值变为 0.003。") |
(Created page with "*<math display="inline"> V\displaystyle _{Y,0}</math> 并没有被赋值,因为这无关紧要。按照惯例,第 0 tick 对应玩家跳跃前的初始速度。 *<math display="inline"> V\displaystyle _{Y,1}</math> 对应初始跳跃速度。每拥有一级跳跃提升这个值就增加 0.1。 *在 1.9 中跳跃高度略有提高,因为动量阈值被降低了(原来=1.249,现在=1.252)。 *终端速度为 -3.92 m/t *当...") |
||
Line 8: | Line 8: | ||
*<math>V\displaystyle _{Y,1} = 0.42</math> |
*<math>V\displaystyle _{Y,1} = 0.42</math> |
||
*<math>V\displaystyle _{Y,t} = \left (V_{Y,t-1} - \underset{ |
*<math>V\displaystyle _{Y,t} = \left (V_{Y,t-1} - \underset{重力}{0.08} \right ) \times \underset{阻力}{0.98}</math> |
||
Line 19: | Line 19: | ||
'''注意''' |
'''注意''' |
||
*<math display="inline"> V\displaystyle _{Y,0}</math> 并没有被赋值,因为这无关紧要。按照惯例,第 0 tick 对应玩家跳跃前的初始速度。 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
*<math display="inline"> V\displaystyle _{Y, |
*<math display="inline"> V\displaystyle _{Y,1}</math> 对应初始跳跃速度。每拥有一级[[Special:MyLanguage/Status Effects|跳跃提升]]这个值就增加 0.1。 |
||
*在 1.9 中跳跃高度略有提高,因为动量阈值被降低了(原来=1.249,现在=1.252)。 |
|||
*<math display="inline"> V\displaystyle _{Y,1}</math> corresponds to the initial jump motion. It is increased by 0.1 per level of [[Special:MyLanguage/Status Effects|Jump Boost]] |
|||
*终端速度为 -3.92 m/t |
|||
*Jump height is slightly higher in 1.9 due to the momentum threshold being reduced (old=1.249, new=1.252) |
|||
*当玩家与方块垂直碰撞时,垂直动量被取消,仅保留加速度。 |
|||
*Terminal velocity is -3.92 m/t |
|||
*When the player collides vertically with a block, vertical momentum is cancelled and only the acceleration is left. |
|||
</div> |
|||
Revision as of 15:03, 28 January 2022
跳跃公式
可以简单地计算出玩家在一次跳跃过程中的垂直速度:
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle V\displaystyle _{Y,1} = 0.42}
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle V\displaystyle _{Y,t} = \left (V_{Y,t-1} - \underset{重力}{0.08} \right ) \times \underset{阻力}{0.98}}
如果Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle \left | V\displaystyle _{Y,t} \right | < 0.005 }
,则Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle V\displaystyle _{Y,t}}
会被设为 0(该 tick 玩家的高度不会改变)。
在 1.9+,这个阈值变为 0.003。
注意
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle V\displaystyle _{Y,0}} 并没有被赋值,因为这无关紧要。按照惯例,第 0 tick 对应玩家跳跃前的初始速度。
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\textstyle V\displaystyle _{Y,1}} 对应初始跳跃速度。每拥有一级跳跃提升这个值就增加 0.1。
- 在 1.9 中跳跃高度略有提高,因为动量阈值被降低了(原来=1.249,现在=1.252)。
- 终端速度为 -3.92 m/t
- 当玩家与方块垂直碰撞时,垂直动量被取消,仅保留加速度。
Jump duration
- The duration of a jump is the number of ticks between jumping and landing.
- It also corresponds to the period of that jump's cycle when performed repeatedly.
- This notion is linked to the notion of Tiers.
Description Duration Flat Jump 12 t 3bc Jump 11 t +0.5 Jump 10 t +1 Jump 9 t 2.5bc Jump 6 t 2bc Jump 3 t 1.8125bc Jump 2 t
Source code
from EntityLivingBase
/* Code unrelated to vertical movement is cut out */ </div> <div lang="en" dir="ltr" class="mw-content-ltr"> protected float getJumpUpwardsMotion(){ return 0.42F; } </div> <div lang="en" dir="ltr" class="mw-content-ltr"> protected void jump() { this.motionY = this.getJumpUpwardsMotion(); if (this.isPotionActive(Potion.jump)) { this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F; } this.isAirBorne = true; } </div> <div lang="en" dir="ltr" class="mw-content-ltr"> public void moveEntityWithHeading(float strafe, float forward) { ... /* also moves the player horizontally */ </div> <div lang="en" dir="ltr" class="mw-content-ltr"> this.motionY -= 0.08; this.motionY *= 0.98; } </div> <div lang="en" dir="ltr" class="mw-content-ltr"> public void onLivingUpdate() { if (this.jumpTicks > 0) --this.jumpTicks; </div> <div lang="en" dir="ltr" class="mw-content-ltr"> if (Math.abs(this.motionY) < 0.005D) this.motionY = 0.0D; </div> <div lang="en" dir="ltr" class="mw-content-ltr"> if (this.isJumping) { ... /* different if in water or lava */ </div> <div lang="en" dir="ltr" class="mw-content-ltr"> if (this.onGround && this.jumpTicks == 0) { this.jump(); this.jumpTicks = 10; //activate autojump cooldown (0.5s) } } else { this.jumpTicks = 0; //reset autojump cooldown } </div> <div lang="en" dir="ltr" class="mw-content-ltr"> ... this.moveEntityWithHeading(this.moveStrafing, this.moveForward); }