Skip to content

emgre/orbiter-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orbiter-rs

Rust bindings for Orbiter 2016 Space Flight Simulator API.

Usage

  1. Install Orbiter 2016 Space Flight Simulator
  2. Install Rust
  3. Install i686-pc-windows-msvc target for Rust with
    rustup target add i686-pc-windows-msvc
  4. Set the ORBITER_DIR or ORBITER_SDK environment variable. In PowerShell, you can do $env:ORBITER_DIR = "<absolute_path_to_orbiter>" for example.
    • ORBITER_DIR: points to the root of your Orbiter installation (where orbiter.exe can be found).
    • ORBITER_SDK: points to the Orbitersdk directory of your Orbiter installation.
    • Note: ORBITER_SDK always take precedence to ORBITER_DIR.
  5. Create a new Rust project with
    cargo new <project_name>
  6. In the Cargo.toml, add the following:
    [lib]
    crate-type = ["cdylib"]
    
    [dependencies]
    orbiter = { git = "https://github.com/emgre/orbiter-rs" }
  7. Add a .cargo/config.toml with the following content:
    [build]
     target = "i686-pc-windows-msvc"
    
     rustflags = [
         "-Ctarget-feature=+crt-static", # Static CRT
         "-Clink-args=/NODEFAULTLIB:msvcrt.lib" # Avoid conflicts generated in OrbiterSDK
     ]
  8. Write your code, build it and copy the DLL in Orbiter for fun! Check the module example for inspiration.

License

Licensed under the MIT license. See LICENSE.md for more details.

Orbiter Space Flight Simulator (not included here) is licensed under a different license.

Copyright 2020 Émile Grégoire

About

Rust bindings for Orbiter 2016 Space Flight Simulator API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published