OpenBve.TrainManager.UpdateFrontBogieSectionElement C# (CSharp) Method

UpdateFrontBogieSectionElement() private static method

private static UpdateFrontBogieSectionElement ( Train Train, int CarIndex, int SectionIndex, int ElementIndex, System.Vector3 Position, System.Vector3 Direction, System.Vector3 Up, System.Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate ) : void
Train Train
CarIndex int
SectionIndex int
ElementIndex int
Position System.Vector3
Direction System.Vector3
Up System.Vector3
Side System.Vector3
Show bool
TimeElapsed double
ForceUpdate bool
return void
		private static void UpdateFrontBogieSectionElement(Train Train, int CarIndex, int SectionIndex, int ElementIndex, Vector3 Position, Vector3 Direction, Vector3 Up, Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate)
		{
			{
				Vector3 p;
				if (Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Overlay &
					World.CameraRestriction != World.CameraRestrictionMode.NotAvailable)
				{
					//Should never be hit, as a bogie cannot be a cab object
					p = new Vector3(Train.Cars[CarIndex].DriverX, Train.Cars[CarIndex].DriverY, Train.Cars[CarIndex].DriverZ);
				}
				else
				{
					p = Position;
				}
				double timeDelta;
				bool updatefunctions;

				if (Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].RefreshRate != 0.0)
				{
					if (Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate >=Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].RefreshRate)
					{
						timeDelta =
							Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate;
						Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate =
							TimeElapsed;
						updatefunctions = true;
					}
					else
					{
						timeDelta = TimeElapsed;
						Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate += TimeElapsed;
						updatefunctions = false;
					}
				}
				else
				{
					timeDelta = Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate;
					Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate = TimeElapsed;
					updatefunctions = true;
				}
				if (ForceUpdate)
				{
					updatefunctions = true;
				}
				ObjectManager.UpdateAnimatedObject(ref Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Elements[ElementIndex], true, Train, CarIndex,Train.Cars[CarIndex].FrontBogie.CurrentCarSection,Train.Cars[CarIndex].FrontBogie.FrontAxle.Follower.TrackPosition - Train.Cars[CarIndex].RearBogie.FrontAxlePosition, p, Direction, Up,Side, Train.Cars[CarIndex].FrontBogie.CarSections[SectionIndex].Overlay, updatefunctions, Show, timeDelta);
			}
		}