ha10gen
04/24/2024, 5:55 AMrapid_agekara
04/24/2024, 6:28 AMrapid_agekara
04/24/2024, 6:29 AMha10gen
04/24/2024, 6:50 AMha10gen
04/24/2024, 6:51 AMha10gen
04/24/2024, 11:32 AMha10gen
04/24/2024, 11:33 AMhi03
04/24/2024, 12:11 PMjs
importPackage(Packages.jp.ngt.ngtlib.util);//NGTUtil
importPackage(Packages.jp.ngt.rtm.entity.vehicle);//EntityVehicleBase
importPackage(Packages.jp.ngt.rtm.entity.train);//EntityTrainBase
︙
var floors = NGTUtil.getField(EntityTrainBase.class, entity, ["vehicleFloors"]);
for (var i = 0; i < floors.size(); i++){
var entityFloor = floors.get(i);
var floorVec = entityFloor.getPartVec();
floorVec.func_72446_c(NGTMath.toRadians(-entity.rotationRoll));
floorVec.func_72440_a(NGTMath.toRadians(entity.field_70125_A));
floorVec.func_72442_b(NGTMath.toRadians(entity.field_70177_z));
var x = entity.field_70165_t + floorVec.field_72450_a;
var y = entity.field_70163_u + floorVec.field_72448_b;
var z = entity.field_70161_v + floorVec.field_72449_c;
entityFloor.func_70107_b(x, y, z);//entityFloor.setPosition(x, y, z)
entityFloor.func_70101_b(entity.field_70177_z, entity.field_70125_A)//entityFloor.setRotation(entity.rotationYaw, entity.rotationPitch)
}hi03
04/24/2024, 12:11 PMha10gen
04/24/2024, 12:13 PMhi03
04/24/2024, 12:21 PMhi03
04/24/2024, 12:21 PMha10gen
04/24/2024, 12:21 PMha10gen
04/24/2024, 12:22 PMha10gen
04/24/2024, 12:22 PMhi03
04/24/2024, 12:23 PMha10gen
04/24/2024, 12:24 PMhi03
04/24/2024, 12:37 PMjs
entity.field_70153_n.func_70107_b(x, y, z);//長いので省略 entity.riddenByEntity.setPosition(x, y, z)
entity.field_70153_n.field_70177_z -= MathHelper.func_76142_g(entity.field_70177_z - entity.field_70126_B);//entity.riddenByEntity.rotationYaw
となっているようです
EntityTrainBase.updateRiderPosition (EntityTrainBase.func_70043_V) でその記述が見れますha10gen
04/24/2024, 12:40 PMha10gen
04/24/2024, 12:42 PMha10gen
04/24/2024, 12:43 PMjava
public void updateRiderPosition()
{
if (this.riddenByEntity != null)
{
this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ);
}
}hi03
04/24/2024, 12:44 PMha10gen
04/24/2024, 12:46 PMhi03
04/24/2024, 12:49 PMhi03
04/24/2024, 12:55 PMha10gen
04/24/2024, 12:56 PMha10gen
04/24/2024, 1:14 PMha10gen
04/24/2024, 1:16 PMha10gen
04/24/2024, 1:17 PMha10gen
04/24/2024, 1:30 PMjava
public void updateRiderPosition()
{
super.updateRiderPosition();
if (this.prevRearingAmount > 0.0F)
{
float f = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F);
float f1 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F);
float f2 = 0.7F * this.prevRearingAmount;
float f3 = 0.15F * this.prevRearingAmount;
this.riddenByEntity.setPosition(this.posX + (double)(f2 * f), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)f3, this.posZ - (double)(f2 * f1));
if (this.riddenByEntity instanceof EntityLivingBase)
{
((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset;
}
}
}
で馬が跳ね馬の姿勢になった時に座席位置の変動があったのでもしかしたらscriptからもできるのではと思った次第でありますha10gen
04/24/2024, 2:04 PMha10gen
04/24/2024, 2:08 PMha10gen
04/24/2024, 2:33 PMha10gen
04/24/2024, 2:41 PMha10gen
04/25/2024, 3:02 PMha10gen
04/25/2024, 3:03 PMha10gen
04/26/2024, 5:19 AMha10gen
04/26/2024, 5:24 AM