{"id":26159610,"url":"https://github.com/virxec/rocketsim-rs","last_synced_at":"2025-04-14T10:53:50.309Z","repository":{"id":65608034,"uuid":"595390224","full_name":"VirxEC/rocketsim-rs","owner":"VirxEC","description":"Rust bindings for the RocketSim project","archived":false,"fork":false,"pushed_at":"2025-02-20T17:48:25.000Z","size":441,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T10:52:45.090Z","etag":null,"topics":["autocxx","bindings","cpp","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rocketsim_rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VirxEC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-31T01:15:00.000Z","updated_at":"2025-02-20T17:48:29.000Z","dependencies_parsed_at":"2023-04-14T15:14:55.870Z","dependency_job_id":"0e3e641e-180b-41e5-91b4-a5fe2a08bb8b","html_url":"https://github.com/VirxEC/rocketsim-rs","commit_stats":{"total_commits":121,"total_committers":3,"mean_commits":"40.333333333333336","dds":0.04958677685950408,"last_synced_commit":"49b484068149c6d42e7821236112c098757042b4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frocketsim-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frocketsim-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frocketsim-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VirxEC%2Frocketsim-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VirxEC","download_url":"https://codeload.github.com/VirxEC/rocketsim-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868772,"owners_count":21174757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocxx","bindings","cpp","rust"],"created_at":"2025-03-11T11:33:04.581Z","updated_at":"2025-04-14T10:53:50.289Z","avatar_url":"https://github.com/VirxEC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://user-images.githubusercontent.com/36944229/219303954-7267bce1-b7c5-4f15-881c-b9545512e65b.png)\n\n[![Build and test](https://github.com/VirxEC/rocketsim-rs/actions/workflows/build-and-test.yaml/badge.svg)](https://github.com/VirxEC/rocketsim-rs/actions/workflows/build-and-test.yaml)\n\n**Rust bindings for the [RocketSim](https://github.com/ZealanL/RocketSim) project**\n\n## Basic usage\n\n```rust\nuse rocketsim_rs::{\n    math::Vec3,\n    sim::{Arena, CarConfig, CarControls, Team},\n};\nuse std::time::Instant;\n\n// Load in the Rocket League assets from the collision_meshes folder in the current directory\nrocketsim_rs::init(None, true);\n\n// Create a new arena with gamemode soccar and a tick rate of 120\nlet mut arena = Arena::default_standard();\nprintln!(\"Arena tick rate: {}\", arena.get_tick_rate());\n\nlet car_id = arena.pin_mut().add_car(Team::Blue, CarConfig::octane());\n\nprintln!(\"Car id: {car_id}\");\n\n{\n    // custom initial car state\n    let mut car_state = arena.pin_mut().get_car(car_id);\n\n    car_state.pos = Vec3::new(5., 0., 50.);\n    car_state.vel = Vec3::new(500., 800., 0.);\n    car_state.boost = 100.;\n\n    println!(\"Created custom car state\");\n\n    // Make the car boost\n    arena\n        .pin_mut()\n        .set_car_controls(\n            car_id,\n            CarControls {\n                boost: true,\n                ..Default::default()\n            },\n        )\n        .unwrap();\n\n    // If car_id can't be found in arena than this will return Err\n    arena.pin_mut().set_car(car_id, car_state).unwrap();\n\n    println!(\"Set car ({car_id}) state\");\n}\n\n{\n    let mut ball_state = arena.pin_mut().get_ball();\n\n    ball_state.pos.z = 1050.;\n    ball_state.vel = Vec3::new(0., 0., 250.);\n\n    arena.pin_mut().set_ball(ball_state);\n\n    println!(\"Set ball state\");\n}\n\nlet ticks = 1800;\nlet curr_time = Instant::now();\n\narena.pin_mut().step(ticks);\n\nprintln!(\"Simulated {}s in {}ms\", ticks as f32 / 120., curr_time.elapsed().as_millis());\n\n{\n    // get the car state again\n    let car_state = arena.pin_mut().get_car(car_id);\n\n    println!(\"Got new car state\");\n\n    // You can debug the whole of the state\n    // but it takes up a lot of space in stdout\n    // dbg!(\u0026car_state);\n\n    println!(\"New car location: {}\", car_state.pos);\n    println!(\"New car boost: {}\", car_state.boost);\n}\n\n// Cast the ball state position to a glam Vec3A\n#[cfg(feature = \"glam\")]\nprintln!(\"New ball location: {}\", arena.pin_mut().get_ball().pos.to_glam());\n\n#[cfg(not(feature = \"glam\"))]\nprintln!(\"New ball location: {}\", arena.pin_mut().get_ball().pos);\n```\n\n## Benchmarks\n\nNumbers are from a system running Ubuntu 23.10 with a Ryzen 9 5900X and 3600MHz CL18 RAM.\n\nNumbers _will_ vary depending on your system. Only default features are enabled.\n\n- `real_bench`:\n\n  ```bash\n  Running on 24 threads\n  Simulated 11.11 hours in 7.003 seconds\n  FPS: 685459\n  ```\n\n- `cpu_bench`:\n\n  ```bash\n  Running on 24 threads\n  Simulated 55.56 hours in 0.907 seconds\n  FPS: 26474106\n  ```\n\n- `thread_bench` (1 thread):\n\n  ```bash\n  Simulated 2.31 hours in 12.307 seconds\n  FPS: 81253.64\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirxec%2Frocketsim-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirxec%2Frocketsim-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirxec%2Frocketsim-rs/lists"}