地形适应一定要在地面上
This commit is contained in:
parent
770a150892
commit
d192fc9ef8
4 changed files with 5 additions and 6 deletions
|
@ -196,7 +196,6 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
|||
}
|
||||
|
||||
if (this.onGround()) {
|
||||
this.terrainCompat(2.7f, 2.7f);
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.8, 1, 0.8));
|
||||
} else {
|
||||
setZRot(getRoll() * (backInputDown ? 0.9f : 0.99f));
|
||||
|
@ -212,6 +211,7 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
|||
|
||||
releaseDecoy();
|
||||
lowHealthWarning();
|
||||
this.terrainCompat(2.7f, 2.7f);
|
||||
|
||||
this.refreshDimensions();
|
||||
}
|
||||
|
|
|
@ -142,7 +142,6 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
|
|||
this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0));
|
||||
|
||||
if (this.onGround()) {
|
||||
this.terrainCompat(2f, 3f);
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.2, 0.85, 0.2));
|
||||
} else if (isInWater()) {
|
||||
float f = (float) (0.75f - (0.04f * java.lang.Math.min(getSubmergedHeight(this), this.getBbHeight())) + 0.09f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90);
|
||||
|
@ -165,6 +164,7 @@ public class SpeedboatEntity extends ContainerMobileVehicleEntity implements Geo
|
|||
turretAngle(40, 40);
|
||||
lowHealthWarning();
|
||||
inertiaRotate(2);
|
||||
this.terrainCompat(2f, 3f);
|
||||
|
||||
this.refreshDimensions();
|
||||
}
|
||||
|
|
|
@ -121,10 +121,6 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
|
|||
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).scale((forward ? 0.24 : -0.24) * this.getDeltaMovement().length())));
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(f, f, f));
|
||||
|
||||
if (onGround()) {
|
||||
this.terrainCompat(1f, 1.2f);
|
||||
}
|
||||
|
||||
if (this.isInWater() && this.tickCount % 4 == 0) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6, 0.6, 0.6));
|
||||
if (lastTickSpeed > 0.4) {
|
||||
|
@ -132,6 +128,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
|
|||
}
|
||||
}
|
||||
|
||||
this.terrainCompat(1f, 1.2f);
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(0.0, 0.01, 0.0));
|
||||
this.refreshDimensions();
|
||||
}
|
||||
|
|
|
@ -230,6 +230,8 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
|
|||
|
||||
// 地形适应测试
|
||||
public void terrainCompat(float w, float l) {
|
||||
if (!onGround()) return;
|
||||
|
||||
Matrix4f transform = this.getWheelsTransform(1);
|
||||
|
||||
// 点位
|
||||
|
|
Loading…
Add table
Reference in a new issue