The trax library implements the logic of track-guided vehicles, signaling, sensors, and cargo transportation; it leverages the NVIDIA PhysX engine to simulate train dynamics - on tracks and beyond.
Our mission: a physically realistic railroad simulation, built to last - with open ideas, better code, and shared success.
This repository contains the mature core of trax library version 3.0.0. The library was used to build the railroad simulators EEP Train Simulator Mission and EEP TSM Gotthardbahn Nordrampe Modul Erstfeld. It also is part of the Eisenbahn.exe Professional (EEP) product line. There is a whitepaper that describes the basic ideas behind the library. The mathematical foundations for the railroad dynamics are described here.
Note: This project is source-available under a custom, non-OSS license. See the LICENSE for details.
The Trax GitHub Project produces a documentation from the source code using Doxygen. It contains a medium level overview as well as detailed description of the API. A ready generated version is available online: Trax Library Documentation.
- Support for arbitrary track geometries and complex layouts.
- Realistic physics-based simulation of railroad vehicles using NVIDIA PhysX.
- Signaling and sensor systems for train operations.
- Modular architecture for easy integration and extension.
- Sample application and test cases to demonstrate library capabilities:
Figure: EEPNew (v.0.1.0) using trax library
Install these tools prior to following the installation instructions for the project.
Required:
- Git: A version control system. Needed to get the source code from the repository.
- Register a GitHub Account: Here the 'Trend Trax Library' resides.
- CMake: A project configuration tool, will also be used by the PhysX SDK.
- Visual Studio 2022 Community Edition: Download and install the community edition. We will only need the 'workload' called Desktop Development with C++.
- Python will be used by the PhysX SDK.
Optional:
- PhysX Visual Debugger: A tool that renders a PhysX simulated scene. Can be used with the trax tests.
- Doxygen: A documentation generator.
- Graphviz - for class hierarchy and include graphs in generated documentation
- Without Graphviz: Basic text diagrams will be generated instead
- Java Runtime (JRE 8+) - required for PlantUML diagrams in documentation
- PlantUML JAR is included in
Tools/plantuml-mit-1.2025.10.jar - No separate PlantUML installation needed
- PlantUML JAR is included in
Currently there are two dependencies of the library:
Boost, referenced in the project by the environment variable BOOST_ROOT. From that we currently need the following libraries:
- boost/math
- boost/program_options
- boost/property_tree
- boost/test
./Tools/BuildBoost.bat
file from the trax project (see 3. Installation) into the boost root and execute it.
PhysX, referenced by the environment variable PHYSX_ROOT. Open a command prompt with administrator rights and clone the main branch of the repository:
git clone https://github.com/NVIDIA-Omniverse/PhysX.git PhysX
cd ./PhysX/physx
setx PHYSX_ROOT "%CD%"
It provides a batch file that lets you create the project files for Visual Studio; we need a '64 bit CPU only' solution. Also the PhysX library has to link with the 'Multi-threaded DLL' runtime libary. That can be done, by editing the respective xml data files in the folder:
./physx/buildtools/presets/public
NV_USE_STATIC_WINCRT should be set to 'False':
<cmakeSwitch name="NV_USE_STATIC_WINCRT" value="False" comment="Use the statically linked windows CRT" />
Open the generated solution and build all the targets ('Release', 'Debug', 'Checked', 'Profile') for the 'INSTALL' project.
The first step would be to install the tools from the list (see above); download, build and install the dependencies and then get the latest version of trax from GitHub: open a new command prompt and with a valid account use git:
git clone https://github.com/Trend-Verlag/trax.git Trax3
There is a batch file (Install.bat) in the root folder of trax, that does necessary installations, like setting environment variables, generating project files with CMake, building the Debug version as a compile test and generates the documentation:
cd ./Trax3
./Install.bat
Open the solution in the ./_Build folder, select 'Release' as a configuration, select the 'ALL_TESTS' project and build and run it.
- The Trax GitHub Project produces a documentation from the source code using Doxygen. It contains a medium level overview as well as detailed description of the API.
- A ready generated (maybe slightly outdated) version of the documentation is available online: Trax Library Documentation.
- The Frequently Asked Questions (FAQ) answers some common questions regarding the library.
- The Trax Library Whitepaper provides an overview of the basic concepts and architecture.
- The Trax Library Book offers a more in-depth exploration.
- Detailed mathematical descriptions of the track constraint solver can be found in the Track Constraint PDF.
- Simulating Railroads with OpenUSD: An article discussing the integration of Trax with OpenUSD for railroad simulation.
- YouTube Playlist
