Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maplant/mgf
Matt's Game Framework
https://github.com/maplant/mgf
3d-video-game collision-detection physics-engine
Last synced: 27 days ago
JSON representation
Matt's Game Framework
- Host: GitHub
- URL: https://github.com/maplant/mgf
- Owner: maplant
- License: lgpl-3.0
- Created: 2017-10-26T01:47:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T18:57:23.000Z (over 4 years ago)
- Last Synced: 2024-11-21T20:28:07.786Z (about 2 months ago)
- Topics: 3d-video-game, collision-detection, physics-engine
- Language: Rust
- Size: 150 KB
- Stars: 63
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MGF: Matt's Game Framework
[![Documentation](https://docs.rs/mgf/badge.svg)](https://docs.rs/mgf)
[![Version](https://img.shields.io/crates/v/mgf.svg)](https://crates.io/crates/mgf)
[![License](https://img.shields.io/crates/l/mgf.svg)](https://github.com/DataAnalysisCosby/mgf/blob/master/LICENSE)
[![Downloads](https://img.shields.io/crates/d/mgf.svg)](https://crates.io/crates/mgf)MGF is a collision detection and physics library for use in 3D video games.
MGF is intended to very light weight and uses cgmath as a math backend.
The library provides various features such as:
- structures to define shapes: `Ray`, `Segment`, `AABB`, `Rectangle`, `Triangle`, `Sphere`, `Capsule`
- dynamic shape types: `Component`, `ComponentConstructor`
- structures to define aggregate shapes: `Mesh`, `Compound`,
- discrete collision detection: `Overlaps`, `Contains`
- continuous collision detection: `Intersection`, `Contact`, `LocalContact`
- a bounding volume hierarchy: `BVH`
- rigid body physics: `RigidBodyVec`, `ContactConstraint`, `Solver`
- dynamic containers: `Pool`MGF is very much in its infancy and is therefore not feature complete. If you
notice any errors or poorly thought out interfaces be sure to let me know.## 3D only
For the time being MGF is solely designed to handle 3D video games. This
reflects my own use of MGF. If there is enough demand for MGF to support 2D
games, it may in the future.## Differences between other collision detection/physics libraries
Most collision detection and physics libraries provide similar to functionality
to MGF, what differs is how they are implemented. Most libraries use the GJK
algorithm to perform every type of collision, including continuous ones. MGF focuses
on providing fast and accurate exact collision detection for moving geometries
commonly found in games, such as `Spheres` and `Capsules`, and does not and cannot
provide fast and accurate moving mesh on mesh collisions.As of version 1.1, MGF provides a limited form of GJK discrete collision detection,
although in its current form it is quite limited.## Things to keep in mind
One interesting result of the implementation is that the direction of the normal
of a polygon determines the "side" it is facing, in a similar manner to how back-face
culling is performed. This allows us to determine inter-object penetration much more
accurately than we would be able to otherwise. The normal force essentially acts
as the direction of propulsion for the object during physics resolution.## Examples
You can find working examples in the mgf_demo folder. Demos require gfx and
gfx_glutin to display visuals. Be sure to build the demos in release mode to get
adequate performance:```
cargo build --release
```[Here is a link to a video of the demo in action.](https://www.youtube.com/watch?v=bPMm2_ttSq8)
## Contributing
MGF is welcome to anyone's contribution, and any part of the interface is open to
discussion. Although if you are going to contribute new features please do
be sure to include unit tests.## License
The open source version of MGF is available with the GNU LGPL version 3 license.
This license is quite inconvenient for game programming, so if you would like to request
a custom license for your comercial product please contact `[email protected]` and we can
assign you a custom license free of charge.