修复载具乘客位置,修复各种火炮问题
This commit is contained in:
parent
2a47ddab36
commit
395ee785eb
7 changed files with 101 additions and 96 deletions
|
@ -440,9 +440,8 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
|
||||||
Matrix4f transform = getVehicleTransform(1);
|
Matrix4f transform = getVehicleTransform(1);
|
||||||
|
|
||||||
float x = 0.6f;
|
float x = 0.6f;
|
||||||
float y = 1.2f - 1.45f;
|
float y = -0.85f;
|
||||||
float z = 1f;
|
float z = 1f;
|
||||||
y += (float) passenger.getVehicleAttachmentPoint(this).y;
|
|
||||||
|
|
||||||
int i = this.getOrderedPassengers().indexOf(passenger);
|
int i = this.getOrderedPassengers().indexOf(passenger);
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,14 @@ import net.neoforged.neoforge.event.EventHooks;
|
||||||
import net.neoforged.neoforge.network.PacketDistributor;
|
import net.neoforged.neoforge.network.PacketDistributor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.joml.Math;
|
import org.joml.Math;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
import org.joml.Vector3d;
|
import org.joml.Vector3d;
|
||||||
|
import org.joml.Vector4f;
|
||||||
import software.bernie.geckolib.animatable.GeoEntity;
|
import software.bernie.geckolib.animatable.GeoEntity;
|
||||||
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
||||||
import software.bernie.geckolib.animation.*;
|
import software.bernie.geckolib.animation.*;
|
||||||
import software.bernie.geckolib.util.GeckoLibUtil;
|
import software.bernie.geckolib.util.GeckoLibUtil;
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, CannonEntity {
|
public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, CannonEntity {
|
||||||
|
@ -174,13 +175,20 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ParametersAreNonnullByDefault
|
public void positionRider(@NotNull Entity passenger, @NotNull MoveFunction callback) {
|
||||||
protected void positionRider(Entity pPassenger, MoveFunction pCallback) {
|
if (!this.hasPassenger(passenger)) {
|
||||||
if (this.hasPassenger(pPassenger)) {
|
return;
|
||||||
float f1 = (float) ((this.isRemoved() ? 0.009999999776482582 : this.getPassengerRidingPosition(pPassenger).y) + pPassenger.getVehicleAttachmentPoint(this).y);
|
|
||||||
Vec3 vec3 = (new Vec3(1, 0.0, 0.0)).yRot(-this.getYRot() * 0.017453292F - 1.5707964F);
|
|
||||||
pCallback.accept(pPassenger, this.getX() + vec3.x, this.getY() + (double) f1, this.getZ() + vec3.z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix4f transform = getVehicleFlatTransform(1);
|
||||||
|
|
||||||
|
float x = 0f;
|
||||||
|
float y = 3.3f;
|
||||||
|
float z = 1.5f;
|
||||||
|
|
||||||
|
Vector4f worldPosition = transformPosition(transform, x, y, z);
|
||||||
|
passenger.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
|
callback.accept(passenger, worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO addEntityPacket
|
// TODO addEntityPacket
|
||||||
|
|
|
@ -45,6 +45,8 @@ import net.neoforged.neoforge.event.EventHooks;
|
||||||
import net.neoforged.neoforge.network.PacketDistributor;
|
import net.neoforged.neoforge.network.PacketDistributor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.joml.Math;
|
import org.joml.Math;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
import org.joml.Vector4f;
|
||||||
import software.bernie.geckolib.animatable.GeoEntity;
|
import software.bernie.geckolib.animatable.GeoEntity;
|
||||||
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
||||||
import software.bernie.geckolib.animation.*;
|
import software.bernie.geckolib.animation.*;
|
||||||
|
@ -160,11 +162,6 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
|
||||||
entityData.set(PITCH, Mth.wrapDegrees((float) (-(Mth.atan2(d1, d3) * 57.2957763671875))) - (float) (distance * 0.008f));
|
entityData.set(PITCH, Mth.wrapDegrees((float) (-(Mth.atan2(d1, d3) * 57.2957763671875))) - (float) (distance * 0.008f));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getEyeY() {
|
|
||||||
return 2.16F;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO addEntityPacket
|
// TODO addEntityPacket
|
||||||
@Override
|
@Override
|
||||||
public @NotNull Packet<ClientGamePacketListener> getAddEntityPacket(@NotNull ServerEntity entity) {
|
public @NotNull Packet<ClientGamePacketListener> getAddEntityPacket(@NotNull ServerEntity entity) {
|
||||||
|
@ -178,8 +175,20 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull Vec3 getPassengerRidingPosition(@NotNull Entity entity) {
|
public void positionRider(@NotNull Entity passenger, @NotNull MoveFunction callback) {
|
||||||
return super.getPassengerRidingPosition(entity).add(0, -0.25, 0);
|
if (!this.hasPassenger(passenger)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Matrix4f transform = getVehicleFlatTransform(1);
|
||||||
|
|
||||||
|
float x = 0f;
|
||||||
|
float y = 2.3f;
|
||||||
|
float z = 0f;
|
||||||
|
|
||||||
|
Vector4f worldPosition = transformPosition(transform, x, y, z);
|
||||||
|
passenger.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
|
callback.accept(passenger, worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -284,8 +293,11 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
|
||||||
|
|
||||||
var entityToSpawn = ((CannonShellWeapon) getWeapon(0)).create(player);
|
var entityToSpawn = ((CannonShellWeapon) getWeapon(0)).create(player);
|
||||||
|
|
||||||
entityToSpawn.setPos(this.getX(), this.getEyeY(), this.getZ());
|
Matrix4f transform = getVehicleFlatTransform(1);
|
||||||
entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.05f);
|
Vector4f worldPosition = transformPosition(transform, 0f, 2.16f, 0.5175f);
|
||||||
|
|
||||||
|
entityToSpawn.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
|
entityToSpawn.shoot(getLookAngle().x, getLookAngle().y, getLookAngle().z, 15, 0.05f);
|
||||||
level.addFreshEntity(entityToSpawn);
|
level.addFreshEntity(entityToSpawn);
|
||||||
|
|
||||||
if (player instanceof ServerPlayer serverPlayer) {
|
if (player instanceof ServerPlayer serverPlayer) {
|
||||||
|
@ -304,9 +316,9 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity
|
||||||
this.getZ() + 5 * this.getLookAngle().z,
|
this.getZ() + 5 * this.getLookAngle().z,
|
||||||
100, 7, 0.02, 7, 0.005);
|
100, 7, 0.02, 7, 0.005);
|
||||||
|
|
||||||
double x = this.getX() + 9 * this.getLookAngle().x;
|
double x = worldPosition.x + 9 * this.getLookAngle().x;
|
||||||
double y = this.getEyeY() + 9 * this.getLookAngle().y;
|
double y = worldPosition.y + 9 * this.getLookAngle().y;
|
||||||
double z = this.getZ() + 9 * this.getLookAngle().z;
|
double z = worldPosition.z + 9 * this.getLookAngle().z;
|
||||||
|
|
||||||
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
server.sendParticles(ParticleTypes.CLOUD, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
server.sendParticles(ParticleTypes.CLOUD, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
|
|
|
@ -45,13 +45,13 @@ import net.neoforged.neoforge.event.EventHooks;
|
||||||
import net.neoforged.neoforge.network.PacketDistributor;
|
import net.neoforged.neoforge.network.PacketDistributor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.joml.Math;
|
import org.joml.Math;
|
||||||
import org.joml.Vector3d;
|
import org.joml.Matrix4f;
|
||||||
|
import org.joml.Vector4f;
|
||||||
import software.bernie.geckolib.animatable.GeoEntity;
|
import software.bernie.geckolib.animatable.GeoEntity;
|
||||||
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache;
|
||||||
import software.bernie.geckolib.animation.*;
|
import software.bernie.geckolib.animation.*;
|
||||||
import software.bernie.geckolib.util.GeckoLibUtil;
|
import software.bernie.geckolib.util.GeckoLibUtil;
|
||||||
|
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEntity {
|
public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEntity {
|
||||||
|
@ -182,13 +182,20 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ParametersAreNonnullByDefault
|
public void positionRider(@NotNull Entity passenger, @NotNull MoveFunction callback) {
|
||||||
protected void positionRider(Entity pPassenger, MoveFunction pCallback) {
|
if (!this.hasPassenger(passenger)) {
|
||||||
if (this.hasPassenger(pPassenger)) {
|
return;
|
||||||
float f1 = (float) ((this.isRemoved() ? 0.009999999776482582 : this.getPassengerRidingPosition(this).y) + pPassenger.getVehicleAttachmentPoint(this).y);
|
|
||||||
Vec3 vec3 = (new Vec3(1, 0.0, 0.0)).yRot(-this.getYRot() * 0.017453292F - 1.5707964F);
|
|
||||||
pCallback.accept(pPassenger, this.getX() + vec3.x, this.getY() + (double) f1, this.getZ() + vec3.z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix4f transform = getVehicleFlatTransform(1);
|
||||||
|
|
||||||
|
float x = 0f;
|
||||||
|
float y = 2.0f;
|
||||||
|
float z = 0.5f;
|
||||||
|
|
||||||
|
Vector4f worldPosition = transformPosition(transform, x, y, z);
|
||||||
|
passenger.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
|
callback.accept(passenger, worldPosition.x, worldPosition.y, worldPosition.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -302,97 +309,70 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt
|
||||||
|
|
||||||
boolean salvoShoot = consumed == 2;
|
boolean salvoShoot = consumed == 2;
|
||||||
|
|
||||||
float yRot = this.getYRot();
|
Matrix4f transform = getVehicleFlatTransform(1);
|
||||||
if (yRot < 0) {
|
Vector4f worldPositionL = transformPosition(transform, 0.486775f, 1.4992625f, 1.52065f);
|
||||||
yRot += 360;
|
Vector4f worldPositionR = transformPosition(transform, -0.486775f, 1.4992625f, 1.52065f);
|
||||||
}
|
|
||||||
yRot = yRot + 90 % 360;
|
|
||||||
|
|
||||||
var leftPos = new Vector3d(0, 0, -0.45);
|
|
||||||
leftPos.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
leftPos.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
// 左炮管
|
// 左炮管
|
||||||
var entityToSpawnLeft = ((CannonShellWeapon) getWeapon(0)).create(player);
|
var entityToSpawnLeft = ((CannonShellWeapon) getWeapon(0)).create(player);
|
||||||
|
|
||||||
entityToSpawnLeft.setPos(this.getX() + leftPos.x,
|
entityToSpawnLeft.setPos(worldPositionL.x, worldPositionL.y, worldPositionL.z);
|
||||||
this.getEyeY() - 0.2 + leftPos.y,
|
|
||||||
this.getZ() + leftPos.z);
|
|
||||||
entityToSpawnLeft.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.05f);
|
entityToSpawnLeft.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.05f);
|
||||||
level.addFreshEntity(entityToSpawnLeft);
|
level.addFreshEntity(entityToSpawnLeft);
|
||||||
|
|
||||||
var leftPosP1 = new Vector3d(8, 0, -0.45);
|
|
||||||
leftPosP1.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
leftPosP1.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
||||||
this.getX() + leftPosP1.x,
|
this.getX() + 5 * this.getLookAngle().x,
|
||||||
this.getEyeY() - 0.2 + leftPosP1.y,
|
this.getY(),
|
||||||
this.getZ() + leftPosP1.z,
|
this.getZ() + 5 * this.getLookAngle().z,
|
||||||
10, 0.4, 0.4, 0.4, 0.0075);
|
100, 7, 0.02, 7, 0.005);
|
||||||
|
|
||||||
server.sendParticles(ParticleTypes.CLOUD,
|
double x = worldPositionL.x + 9 * this.getLookAngle().x;
|
||||||
this.getX() + leftPosP1.x,
|
double y = worldPositionL.y + 9 * this.getLookAngle().y;
|
||||||
this.getEyeY() - 0.2 + leftPosP1.y,
|
double z = worldPositionL.z + 9 * this.getLookAngle().z;
|
||||||
this.getZ() + leftPosP1.z,
|
|
||||||
10, 0.4, 0.4, 0.4, 0.0075);
|
|
||||||
|
|
||||||
int count = 5;
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
|
server.sendParticles(ParticleTypes.CLOUD, x, y, z, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
|
|
||||||
for (float i = 9.5f; i < 14; i += .5f) {
|
int count = 6;
|
||||||
var leftPosP = new Vector3d(i, 0, -0.45);
|
|
||||||
leftPosP.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
leftPosP.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
|
for (float i = 9.5f; i < 16; i += .5f) {
|
||||||
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
||||||
this.getX() + leftPosP.x,
|
worldPositionL.x + i * this.getLookAngle().x,
|
||||||
this.getEyeY() - 0.2 + leftPosP.y,
|
worldPositionL.y + i * this.getLookAngle().y,
|
||||||
this.getZ() + leftPosP.z,
|
worldPositionL.z + i * this.getLookAngle().z,
|
||||||
Mth.clamp(count--, 1, 5), 0.1, 0.1, 0.1, 0.002);
|
Mth.clamp(count--, 1, 5), 0.15, 0.15, 0.15, 0.0025);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 右炮管
|
// 右炮管
|
||||||
if (salvoShoot) {
|
if (salvoShoot) {
|
||||||
var rightPos = new Vector3d(0, 0, 0.45);
|
|
||||||
rightPos.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
rightPos.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
var entityToSpawnRight = ((CannonShellWeapon) getWeapon(0)).create(player);
|
var entityToSpawnRight = ((CannonShellWeapon) getWeapon(0)).create(player);
|
||||||
|
|
||||||
entityToSpawnRight.setPos(this.getX() + rightPos.x,
|
entityToSpawnRight.setPos(worldPositionR.x, worldPositionR.y, worldPositionR.z);
|
||||||
this.getEyeY() - 0.2 + rightPos.y,
|
|
||||||
this.getZ() + rightPos.z);
|
|
||||||
entityToSpawnRight.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.05f);
|
entityToSpawnRight.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 15, 0.05f);
|
||||||
level.addFreshEntity(entityToSpawnRight);
|
level.addFreshEntity(entityToSpawnRight);
|
||||||
|
|
||||||
var rightPosP1 = new Vector3d(8, 0, 0.45);
|
|
||||||
rightPosP1.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
rightPosP1.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
||||||
this.getX() + rightPosP1.x,
|
this.getX() + 5 * this.getLookAngle().x,
|
||||||
this.getEyeY() - 0.2 + rightPosP1.y,
|
this.getY(),
|
||||||
this.getZ() + rightPosP1.z,
|
this.getZ() + 5 * this.getLookAngle().z,
|
||||||
10, 0.4, 0.4, 0.4, 0.0075);
|
100, 7, 0.02, 7, 0.005);
|
||||||
|
|
||||||
server.sendParticles(ParticleTypes.CLOUD,
|
double xR = worldPositionR.x + 9 * this.getLookAngle().x;
|
||||||
this.getX() + rightPosP1.x,
|
double yR = worldPositionR.y + 9 * this.getLookAngle().y;
|
||||||
this.getEyeY() - 0.2 + rightPosP1.y,
|
double zR = worldPositionR.z + 9 * this.getLookAngle().z;
|
||||||
this.getZ() + rightPosP1.z,
|
|
||||||
10, 0.4, 0.4, 0.4, 0.0075);
|
|
||||||
|
|
||||||
int countR = 5;
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, xR, yR, zR, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
|
server.sendParticles(ParticleTypes.CLOUD, xR, yR, zR, 10, 0.4, 0.4, 0.4, 0.0075);
|
||||||
|
|
||||||
for (float i = 9.5f; i < 14; i += .5f) {
|
int countR = 6;
|
||||||
var rightPosP = new Vector3d(i, 0, 0.45);
|
|
||||||
rightPosP.rotateZ(-this.getXRot() * Mth.DEG_TO_RAD);
|
|
||||||
rightPosP.rotateY(-yRot * Mth.DEG_TO_RAD);
|
|
||||||
|
|
||||||
|
for (float i = 9.5f; i < 16; i += .5f) {
|
||||||
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE,
|
||||||
this.getX() + rightPosP.x,
|
worldPositionR.x + i * this.getLookAngle().x,
|
||||||
this.getEyeY() - 0.2 + rightPosP.y,
|
worldPositionR.y + i * this.getLookAngle().y,
|
||||||
this.getZ() + rightPosP.z,
|
worldPositionR.z + i * this.getLookAngle().z,
|
||||||
Mth.clamp(countR--, 1, 5), 0.1, 0.1, 0.1, 0.002);
|
Mth.clamp(countR--, 1, 5), 0.15, 0.15, 0.15, 0.0025);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.entityData.set(TYPE, 1);
|
this.entityData.set(TYPE, 1);
|
||||||
|
|
|
@ -266,9 +266,8 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
|
||||||
Matrix4f transform = getVehicleTransform(1);
|
Matrix4f transform = getVehicleTransform(1);
|
||||||
|
|
||||||
float x = 0f;
|
float x = 0f;
|
||||||
float y = 0.45f;
|
float y = 0.05f;
|
||||||
float z = -0.4f;
|
float z = -0.4f;
|
||||||
y += (float) passenger.getVehicleAttachmentPoint(this).y;
|
|
||||||
|
|
||||||
int i = this.getSeatIndex(passenger);
|
int i = this.getSeatIndex(passenger);
|
||||||
|
|
||||||
|
|
|
@ -259,9 +259,8 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity {
|
||||||
Matrix4f transform = getVehicleTransform(1);
|
Matrix4f transform = getVehicleTransform(1);
|
||||||
|
|
||||||
float x = 0f;
|
float x = 0f;
|
||||||
float y = 0.3f;
|
float y = 0f;
|
||||||
float z = 0f;
|
float z = 0f;
|
||||||
y += (float) passenger.getVehicleAttachmentPoint(this).y;
|
|
||||||
|
|
||||||
int i = this.getSeatIndex(passenger);
|
int i = this.getSeatIndex(passenger);
|
||||||
|
|
||||||
|
|
|
@ -746,6 +746,14 @@ public abstract class VehicleEntity extends Entity {
|
||||||
return transform;
|
return transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Matrix4f getVehicleFlatTransform(float ticks) {
|
||||||
|
Matrix4f transform = new Matrix4f();
|
||||||
|
transform.translate((float) Mth.lerp(ticks, xo, getX()), (float) Mth.lerp(ticks, yo, getY()), (float) Mth.lerp(ticks, zo, getZ()));
|
||||||
|
transform.rotate(Axis.YP.rotationDegrees(-Mth.lerp(ticks, yRotO, getYRot())));
|
||||||
|
transform.rotate(Axis.ZP.rotationDegrees(Mth.lerp(ticks, prevRoll, getRoll())));
|
||||||
|
return transform;
|
||||||
|
}
|
||||||
|
|
||||||
public Vector4f transformPosition(Matrix4f transform, float x, float y, float z) {
|
public Vector4f transformPosition(Matrix4f transform, float x, float y, float z) {
|
||||||
return transform.transform(new Vector4f(x, y, z, 1));
|
return transform.transform(new Vector4f(x, y, z, 1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue