Lateral displacement is a sideways movement. In the case of a centre bogie or truck, it doesn’t need to pivot around a centre point but move sideways left or right.
Rolling stock more bogies and wheels allowed
#22
Posted 16 February 2018 - 04:51 PM
#23
Posted 17 February 2018 - 08:41 AM
Is lateral displacement present with the normal 2 bogies and 3 axles? According to the post with the 3 bogie Renfe it does not exist on the middle bogie, but the bogies pivot. On the 4 bogie locomotive, is lateral displacement present on all bogies? The reason why I am asking is that if the bogies are pivoting then the basis of recognizing the extra bogies and axles is present. The physics side is whats missing or not complete.
Here is the code that is suppose to be responsible for tracking. The remainder of the code that is used below is found in TrainCar.cs. If Lateral Displacement is not present at all in OR, then we need a physics expert.
Here is the code that is suppose to be responsible for tracking. The remainder of the code that is used below is found in TrainCar.cs. If Lateral Displacement is not present at all in OR, then we need a physics expert.
public void ComputePosition(Traveller traveler, bool backToFront, float elapsedTimeS, float distance, float speed) { for (var j = 0; j < Parts.Count; j++) Parts[j].InitLineFit(); var tileX = traveler.TileX; var tileZ = traveler.TileZ; if (Flipped == backToFront) { var o = -CarLengthM / 2 - CentreOfGravityM.Z; for (var k = 0; k < WheelAxles.Count; k++) { var d = WheelAxles[k].OffsetM - o; o = WheelAxles[k].OffsetM; traveler.Move(d); var x = traveler.X + 2048 * (traveler.TileX - tileX); var y = traveler.Y; var z = traveler.Z + 2048 * (traveler.TileZ - tileZ); WheelAxles[k].Part.AddWheelSetLocation(1, o, x, y, z, 0, traveler); } o = CarLengthM / 2 - CentreOfGravityM.Z - o; traveler.Move(o); } else { var o = CarLengthM / 2 - CentreOfGravityM.Z; for (var k = WheelAxles.Count - 1; k >= 0; k--) { var d = o - WheelAxles[k].OffsetM; o = WheelAxles[k].OffsetM; traveler.Move(d); var x = traveler.X + 2048 * (traveler.TileX - tileX); var y = traveler.Y; var z = traveler.Z + 2048 * (traveler.TileZ - tileZ); WheelAxles[k].Part.AddWheelSetLocation(1, o, x, y, z, 0, traveler); } o = CarLengthM / 2 + CentreOfGravityM.Z + o; traveler.Move(o); } TrainCarPart p0 = Parts[0]; for (int i = 1; i < Parts.Count; i++) { TrainCarPart p = Parts[i]; p.FindCenterLine(); if (p.SumWgt > 1.5) p0.AddPartLocation(1, p); } p0.FindCenterLine(); Vector3 fwd = new Vector3(p0.B[0], p0.B[1], -p0.B[2]); // Check if null vector - The Length() is fine also, but may be more time consuming - By GeorgeS if (fwd.X != 0 && fwd.Y != 0 && fwd.Z != 0) fwd.Normalize(); Vector3 side = Vector3.Cross(Vector3.Up, fwd); // Check if null vector - The Length() is fine also, but may be more time consuming - By GeorgeS if (side.X != 0 && side.Y != 0 && side.Z != 0) side.Normalize(); Vector3 up = Vector3.Cross(fwd, side); Matrix m = Matrix.Identity; m.M11 = side.X; m.M12 = side.Y; m.M13 = side.Z; m.M21 = up.X; m.M22 = up.Y; m.M23 = up.Z; m.M31 = fwd.X; m.M32 = fwd.Y; m.M33 = fwd.Z; m.M41 = p0.A[0]; m.M42 = p0.A[1] + 0.275f; m.M43 = -p0.A[2]; WorldPosition.XNAMatrix = m; WorldPosition.TileX = tileX; WorldPosition.TileZ = tileZ; UpdatedTraveler(traveler, elapsedTimeS, distance, speed); // calculate truck angles for (int i = 1; i < Parts.Count; i++) { TrainCarPart p = Parts[i]; if (p.SumWgt < .5) continue; if (p.SumWgt < 1.5) { // single axle pony trunk float d = p.OffsetM - p.SumOffset / p.SumWgt; if (-.2 < d && d < .2) continue; p.AddWheelSetLocation(1, p.OffsetM, p0.A[0] + p.OffsetM * p0.B[0], p0.A[1] + p.OffsetM * p0.B[1], p0.A[2] + p.OffsetM * p0.B[2], 0, null); p.FindCenterLine(); } Vector3 fwd1 = new Vector3(p.B[0], p.B[1], -p.B[2]); if (fwd1.X == 0 && fwd1.Y == 0 && fwd1.Z == 0) { p.Cos = 1; } else { fwd1.Normalize(); p.Cos = Vector3.Dot(fwd, fwd1); } if (p.Cos >= .99999f) p.Sin = 0; else { p.Sin = (float)Math.Sqrt(1 - p.Cos * p.Cos); if (fwd.X * fwd1.Z < fwd.Z * fwd1.X) p.Sin = -p.Sin; } } }
#24
Posted 17 February 2018 - 09:50 AM
When viewing my 4 bogie test unit moving along the track the first two bogies pivot as the curve is taken, the second two do not.
Lateral movement is the body sliding across the bogie so the bogie remains on the track and as far as I am aware this does not exist in OR, and pretty positive that MSTS never had it either.
Lateral movement is the body sliding across the bogie so the bogie remains on the track and as far as I am aware this does not exist in OR, and pretty positive that MSTS never had it either.
#25
Posted 17 February 2018 - 10:03 AM
In my Baldwin turbine all the bogies pivot, but the inner ones are out of track.
The bogie sequence, front to rear, MUST be
Bogie2 Bogie3 Bogie4 Bogie1
I am using TSM.
Regards.
The bogie sequence, front to rear, MUST be
Bogie2 Bogie3 Bogie4 Bogie1
I am using TSM.
Regards.
#26
Posted 17 February 2018 - 10:11 AM
Not all locomotives with more than two trucks have them move laterally; many of them use span bolsters, so you're going to need separate code for that, probably.
EDIT: actually, just adding code for a span bolster could work for the other type of application as well. You would have both trucks children of the span bolster (which could be a dummy), and the span bolster's pivot at the same place as the lead/trail truck pivot. This would cause the inner trucks to displace sideways.
It's easier to think of it visually:
The yellow object is the span bolster. You can see that it has a central pivot on one example, and an offset one colocated with the lead/trail truck on the other. The bolster does not need to be visible geometry, it might just as well be a dummy. This allows it to move as is required depending on the translation desired. Note that I have pivoted to a rather extreme angle here for ease of visibility.
EDIT: actually, just adding code for a span bolster could work for the other type of application as well. You would have both trucks children of the span bolster (which could be a dummy), and the span bolster's pivot at the same place as the lead/trail truck pivot. This would cause the inner trucks to displace sideways.
It's easier to think of it visually:
The yellow object is the span bolster. You can see that it has a central pivot on one example, and an offset one colocated with the lead/trail truck on the other. The bolster does not need to be visible geometry, it might just as well be a dummy. This allows it to move as is required depending on the translation desired. Note that I have pivoted to a rather extreme angle here for ease of visibility.
#27
Posted 17 February 2018 - 10:15 AM
My UP4500 X55 has four bogies, but is implemented as two .wag carriing the bogies and one.eng, with no wheels but
with power, cab, lights etc.
Like the real one.
Regards.
with power, cab, lights etc.
Like the real one.
Regards.
#28
Posted 17 February 2018 - 10:46 AM
It looks as if I may have a fix for the Renfe which has 3 bogies then we continue moving forward. For starters, the naming convention in the Renfe locomotive must change. The middle bogie is named Bogie-Mid. This long naming convention is keeping it from being processed. Rename it to Bogie3. I am also making sure that any additional bogies after Bogie2 is officially recognized. Once finished, I will upload here for testing. Hopefully this will bring about the results that have been missing.
Edward K.
Edward K.
#29
Posted 17 February 2018 - 11:18 AM
Here is the file that will be used for testing. Use these files under X4075. First run the test with the Renfe and let me know the results. Keep in mind that the "Bogie-Mid" naming convention must be changed to "Bogie3" in the shape file since it is the third bogie. Proper naming conventions should be followed at this point since trying to cover the above naming convention makes the code messy.
If you know the naming convention of the Bogies are correct on the other locomotives or wagons then test on those as well.
If you know the naming convention of the Bogies are correct on the other locomotives or wagons then test on those as well.
Attached File(s)
-
X4075_Test.zip (1.22MB)
Number of downloads: 544
#30
Posted 17 February 2018 - 11:38 AM
Erik's description of "Span Bogies" looks like the same thing that would need to be used for Garrats.
The two bogies with the driving wheels are children of Main.
The remaining bogies are children of the two powered bogies (just as Erik says that the bogies in his example are children of the span bogie).
Hopefully this is the same problem and will have the same solution. Although at present TSM will allow bogies to be children of other bogies this does not export correctly. The 3DC train sim wizard at the moment allows up to three bogies.
The two bogies with the driving wheels are children of Main.
The remaining bogies are children of the two powered bogies (just as Erik says that the bogies in his example are children of the span bogie).
Hopefully this is the same problem and will have the same solution. Although at present TSM will allow bogies to be children of other bogies this does not export correctly. The 3DC train sim wizard at the moment allows up to three bogies.