re:重写校准
This commit is contained in:
parent
477c0d4079
commit
b91ed662ab
1 changed files with 2 additions and 2 deletions
|
@ -464,10 +464,10 @@ public class AnnihilatorEntity extends Entity implements GeoEntity, ICannonEntit
|
||||||
|
|
||||||
double angle = 0;
|
double angle = 0;
|
||||||
|
|
||||||
double roothorizontalDistance = new Vec3(passenger.getX() - BarrelRootPos.x , passenger.getEyeY() - BarrelRootPos.y, passenger.getZ() -BarrelRootPos.z).horizontalDistance();
|
double rootHorizontalDistance = new Vec3(passenger.getX() - BarrelRootPos.x , passenger.getEyeY() - BarrelRootPos.y, passenger.getZ() -BarrelRootPos.z).horizontalDistance();
|
||||||
|
|
||||||
if (lookDistance != 0) {
|
if (lookDistance != 0) {
|
||||||
angle = Math.atan(Mth.abs((float)(passenger.getEyeY() - BarrelRootPos.y)) / (lookDistance + roothorizontalDistance)) * Mth.RAD_TO_DEG;
|
angle = Math.atan(Mth.abs((float)(passenger.getEyeY() - BarrelRootPos.y)) / (lookDistance - rootHorizontalDistance)) * Mth.RAD_TO_DEG;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.entityData.set(OFFSET_ANGLE , (float)angle);
|
this.entityData.set(OFFSET_ANGLE , (float)angle);
|
||||||
|
|
Loading…
Add table
Reference in a new issue