
PluginHeader{
	RailSimVersion = 2.00;
	PluginType = Train;
	PluginName = "東京都交通局 日暮里・舎人ライナー 320形";
	PluginAuthor = "n";
	IconTexture = "icon.png";
	Description = "先頭車同士の連結は未対応です。";
}

TrainInfo{
	FrontLimit = 4.5;
	TailLimit = -4.5;
	MaxVelocity = 60.0;
	MaxAcceleration = 3.5;
	MaxDeceleration = 3.5;
	DoorClosingTime = 3.0;
}
DefineSwitch "前照灯・尾灯"{
GroupCommon = "nNTL320前照灯・尾灯";
	Entry = "入(フレア有)";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "室内灯"{
GroupCommon = "nNTL320客室灯";
	Entry = "入";
	Entry = "切";
}
DefineSwitch "号車"{
	Entry = "1号車(日暮里方先頭)";
	Entry = "2号車";
	Entry = "3号車";
	Entry = "4号車";
	Entry = "5号車(見沼代親水公園方先頭)";
}
DefineSwitch "簡易影"{
	GroupCommon = "nNTL320簡易影";
	Entry = "自動";
	Entry = "切";
}
PrimaryAssembly{
	Axle "FrontDummyWheel"{
		ModelFileName = "";
		ModelScale = 1.0;
		Diameter = 0.44;
		Symmetric = 1;
		Coord = (2.5, 0.47);
	}
	Axle "TailDummyWheel"{
		ModelFileName = "";
		ModelScale = 1.0;
		Diameter = 0.44;
		Symmetric = 1;
		Coord = (-2.5, 0.47);
	}
	Body "Dummy"{
		ModelFileName = "Bogie1_1.x";
		ApplySwitch "号車"{
		Case 1,3:
			ChangeModel = "Bogie1_2.x", 1.0;
		}
		JointZY "FrontDummyWheel"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (2.5, 0.47);
		}
		JointZY "TailDummyWheel"{
			AttachCoord = (0.0, 0.0);
			LocalCoord = (-2.5, 0.47);
		}
	}
	Object3D "FrontRightWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (0.85, 0.47, 2.5);
			DirLink = "FrontDummyWheel";
			AttachDir = (1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "FrontLeftWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (-0.85, 0.47, 2.5);
			DirLink = "FrontDummyWheel";
			AttachDir = (-1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "TailRightWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (0.85, 0.47, -2.5);
			DirLink = "Dummy";
			AttachDir = (1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "TailLeftWheel"{
		ModelFileName = "Wheel.x";
		ModelScale = 1.0;
		Joint3D "Dummy"{
			AttachCoord = (-0.85, 0.47, -2.5);
			DirLink = "Dummy";
			AttachDir = (-1.0, 0.0, 0.0);
			UpLink = "FrontDummyWheel";
			AttachUp = (0.0, 0.0, 1.0);
		}
	}
	Object3D "Body"{
		ModelFileName = "Body1.x";
		NoShadow = 1,2;
		NoCastShadow = 4,5,9,13;
		If "室内灯"==0 {
			ChangeMaterial{
			   MaterialID = 3;
			   Emissive = 1.0, 1.0, 1.0; 
			}
　　　　　	}
		If "前照灯・尾灯"<2 && !"_CONNECT1"{
			If !"_FRONT"{
				ChangeAlpha = 1, 1.0;
			}Else{
				ChangeAlpha = 2, 1.0;
			}
		}
		ApplySwitch "号車"{
			Case 1:
				ChangeModel = "body2.x", 1.0;
			Case 2:
				ChangeModel = "body3.x", 1.0;
			Case 3:
				ChangeModel = "body4.x", 1.0;
			Case 4:
				ChangeModel = "body5.x", 1.0;
		}
			ChangeMaterial{
				MaterialID = 6,7,8;
				Diffuse = 0.9, 0.9, 0.9, 1.0;
				Ambient = 0.8, 0.81, 0.82;
				Specular = 0.9, 0.9, 0.9;
				Power = 7.0;
　　　　	　	}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	Object3D "shadow"{
		ModelFileName = "";
		If!"簡易影"&&!"_SHADOW" { 
			ChangeModel = "shadow.x", 1.0;
		}
		Joint3D "Dummy"{
			AttachCoord = (0.0, 0.0, 0.0);
		}
	}
	If  ("号車"==0||"号車"==4)&&"前照灯・尾灯"==0&&!"_CONNECT1" {
		If !"_FRONT"{
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.7066, 1.2827, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 30.0;
				    Twinkle = 0.2;
					Texture{
					    Distance = 0.005;
					    Radius = 0.3;
					    TexFileName = "tex/フレア.png";
					    Color = #FFffffff;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.7066, 1.2827, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}Else{
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (0.565, 1.238, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
				LensFlare{
				    StartAngle = 30.0;
				    Twinkle = 0.1;
					Texture{
					    Distance = 0.005;
					    Radius = 0.2;
					    TexFileName = "tex/フレア.png";
					    Color = #FFb20046;
					}
				}
			}
			Headlight{
			    AttachObject = "Dummy";
			    SourceCoord = (-0.565, 1.238, 4.35);
			    Direction = (0.0, 0.0, 1.0);
			    MaxDistance = 10.0;
			}
		}
	}
	FrontCabin{
		Joint3D "Dummy"{
			AttachCoord = (0.6, 2.2, 3.2);
		}
	}
}
