internal void ChangeSection(int SectionIndex)
{
if (CarSections.Length == 0)
{
CurrentCarSection = -1;
//Hack: If no bogie objects are defined, just return
return;
}
for (int i = 0; i < CarSections.Length; i++)
{
for (int j = 0; j < CarSections[i].Elements.Length; j++)
{
int o = CarSections[i].Elements[j].ObjectIndex;
Renderer.HideObject(o);
}
}
if (SectionIndex >= 0)
{
CarSections[SectionIndex].Initialize(CurrentlyVisible);
for (int j = 0; j < CarSections[SectionIndex].Elements.Length; j++)
{
int o = CarSections[SectionIndex].Elements[j].ObjectIndex;
Renderer.ShowObject(o, ObjectType.Dynamic);
}
}
CurrentCarSection = SectionIndex;
UpdateObjects(0.0, true);
}