OpenBve.TrainManager.UpdateRearBogieSectionElement C# (CSharp) Method

UpdateRearBogieSectionElement() private static method

private static UpdateRearBogieSectionElement ( 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 UpdateRearBogieSectionElement(Train Train, int CarIndex, int SectionIndex, int ElementIndex,Vector3 Position, Vector3 Direction, Vector3 Up, Vector3 Side, bool Show, double TimeElapsed, bool ForceUpdate)
		{
			{
				//REAR BOGIE
				Vector3 p;
				if (Train.Cars[CarIndex].RearBogie.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].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].RefreshRate != 0.0)
				{
					if (Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate >=
						Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].RefreshRate)
					{
						timeDelta =
							Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate;
						Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate =
							TimeElapsed;
						updatefunctions = true;
					}
					else
					{
						timeDelta = TimeElapsed;
						Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate +=
							TimeElapsed;
						updatefunctions = false;
					}
				}
				else
				{
					timeDelta = Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate;
					Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex].SecondsSinceLastUpdate =
						TimeElapsed;
					updatefunctions = true;
				}
				if (ForceUpdate)
				{
					updatefunctions = true;
				}
				ObjectManager.UpdateAnimatedObject(ref Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Elements[ElementIndex], true, Train, CarIndex,Train.Cars[CarIndex].RearBogie.CurrentCarSection,Train.Cars[CarIndex].RearBogie.FrontAxle.Follower.TrackPosition - Train.Cars[CarIndex].RearBogie.FrontAxlePosition, p, Direction, Up,
					Side, Train.Cars[CarIndex].RearBogie.CarSections[SectionIndex].Overlay, updatefunctions, Show, timeDelta);
			}
		}