Skip to content

divtor/rustycs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rustycs

2D physics engine written in Rust.

Usage: Demo application using macroquad

Setups

Rust:

VSC:

  • rust-analyzer - Improved Rust language support for VSC.
  • CodeLLDB - Native debugger powered by LLDB.
  • crates - Dependency manager for Cargo.

Limitations and potential future features

Body Types:

  • Supported:

    • Circle
    • Axis Aligned Bounding Boxes (AABB)
    • Oriented Bounding Boxes (OBB) (modelled as Polygons)
    • Convex Polygons
  • Not supported:

    • Concave Polygons
      • The engine checks for concave polygons and panics when it detects one.
      • But if the polygon edges intersect one another the polygons do not get detected as concave even though they are, but this is easy to detect visually and should not be done.

The engine uses a "homemade" collision detection approach, where each shape combination is checked explicitly.

Most parts of the engine are optimized to some extend, both memory and runtime wise. Nevertheless, there still is much room for possible improvements and optimizations, specifically:

  • Utilizing multiple cores in the collision pipeline.
  • Using a QuadTree for the collision broad phase.
  • Restricting world bounds; currently unlimited (f32::MAX)
  • Implementing continuos collision detection (CCD).
  • ...

As this is a passion project, the engine has no implementation timeline etc. Future functionality will be add whenever I feel like it.

Some sources and inspirations

About

Very simple 2D physics engine written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages