Skip to content

Commit

Permalink
Automatic merge of T1.5.1-687-gd279e384a and 10 pull requests
Browse files Browse the repository at this point in the history
- Pull request #570 at c59c788: Experimental glTF 2.0 support with PBR lighting
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters
- Pull request #865 at 67014b7: Dispatcher window improvements
- Pull request #874 at f8dbeab: Dynamic brake controller refactoring
- Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #878 at b19b5a1: Implement Polach Adhesion
- Pull request #882 at d8a1c4d: Blueprint/train car operations UI window
- Pull request #883 at edcc2dd: SwitchPanel disconnect/connect handling
- Pull request #885 at c81447b: feat: Add notifications to Menu
  • Loading branch information
openrails-bot committed Nov 7, 2023
12 parents b764585 + d279e38 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + b19b5a1 + d8a1c4d + edcc2dd + c81447b commit dda07f5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5062,8 +5062,8 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
// Crank Angle - converts the above range to 0 - 180 - 0 - this is the principle reference used so that it lines up with reference
// tables used to buold this function
// Normalised Crank Angle - converts the above to a 0 - 360 range, this is used for triggering special steam effects, etc.
float axlePostionRad = (float)LocomotiveAxles[0].AxlePositionRad;
float crankAngleRad = (float)(axlePostionRad + WheelCrankAngleDiffRad[i]);
float LocalAxlePostionRad = (float)LocomotiveAxles[0].AxlePositionRad;
float crankAngleRad = (float)(LocalAxlePostionRad + WheelCrankAngleDiffRad[i]);

crankAngleRad = (float)(MathHelper.WrapAngle(crankAngleRad)); // Ensures that crank angle is in the range 0 - 180 - 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
//
// You should have received a copy of the GNU General Public License
// along with Open Rails. If not, see <http://www.gnu.org/licenses/>.
//
// Debug for Adhesion
//#define DEBUG_ADHESION

using System;
using System.IO;
Expand Down Expand Up @@ -974,6 +977,29 @@ public virtual void Update(float timeSpan)
axleStaticForceN = AxleWeightN * SlipCharacteristics(0);
}

#if DEBUG_ADHESION
double[] spd = new double[50];
double[] adh = new double[50];
for (int i = 0; i < spd.Length; i++)
{
spd[i] = i / (float)spd.Length;
adh[i] = SlipCharacteristics(spd[i]);
}
for (int i = 0; i < spd.Length; i++)
{
Console.Write(spd[i]);
Console.Write(" ");
}
Console.WriteLine("");
Console.WriteLine("");
for (int i = 0; i < spd.Length; i++)
{
Console.Write(adh[i]);
Console.Write(" ");
}
Console.WriteLine("");
#endif

motor?.Update(timeSpan);

Integrate(timeSpan);
Expand Down

0 comments on commit dda07f5

Please sign in to comment.