Rolling stock more bogies and wheels allowed
#21
Posted 16 February 2018 - 04:19 PM
#22
Posted 16 February 2018 - 04:51 PM
#23
Posted 17 February 2018 - 08:41 AM
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
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
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
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
with power, cab, lights etc.
Like the real one.
Regards.
#28
Posted 17 February 2018 - 10:46 AM
Edward K.
#29
Posted 17 February 2018 - 11:18 AM
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: 623
#30
Posted 17 February 2018 - 11:38 AM
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.
#31
Posted 17 February 2018 - 04:27 PM
#32
Posted 17 February 2018 - 11:08 PM
This is create two 'virtual' bogies. Each bogie has a centre half way between the outer axle and the centre axle.
One 'virtual' bogie has two axles (front and centre) the other 'virtual' bogie has only one axle (rear).
Hence a long wheelbase three axle vehicle can be made to follow the curve appropriately.
Now to do the same with a three bogie vehicle rather than a three axle vehicle then rather than axles being children of the 'virtual' bogies then the real bogies need to be children of the 'virtual' bogies. (As in Erik's post).
Supporting additional bogies to be children of existing bogies (or virtual bogies) will solve both the three and four bogie problem and the Garrat problem.
#33
Posted 18 February 2018 - 04:32 AM
It requires the front virtual bogie to be made by joining the front and middle axleguards and spring as bogie1.
Using 2axle bogies, The bogie frames can be joined as bogie1 but you cannot join the wheels or they will rotate about their common centre.
You could make an invisible wheel as wheel11 and wheel12 and model the visible wheels as as part of the bogie but they would be non rotating.
You just need to hope nobody would notice.
I also tried making a three part wagon using a complete wagon as bogie1and bogie2 but this added the additional problem of how to position the load.
As I said in my previous post a 3bogie model is impossible.
Prove me wrong------Please.
#34
Posted 18 February 2018 - 01:04 PM
Quote
I may be wrong, but I think the purpose of this thread is to bring about a change in Open Rails, such that it will be possible in future. If the bogies were able to parent to bogies rather than to main then it should be possible for the wheels to rotate about the centre of their bogies and for the bogies to rotate about the centres of their "span bogies".
If bogies were allowed to be children of other 'span bogies' it should be possible to solve all of the problems under discussion. (In the Garrat case the span bogies would themselves have the driving wheels associated with the.)
Other than the span bogie idea, the only solution I can imagine is allowing separate vehicles to be "grouped" together as a single vehicles - not sure if that would mean allowing muliple shape files to be a single eng or wag entity or if it would mean adding bogies as freight anims - which would need a new kind of freight anim...
#35
Posted 25 February 2018 - 04:58 PM
copperpen, on 16 February 2018 - 01:49 AM, said:
I also have the part built Little Joe with 4 bogies sans wheels right now.
The NALW UP 4500HP gas turbine model is setup with two trucks per bolster. 4 trucks total under that machine.
Robert