https://github.com/instilledbee/sfmlnet-collision
Collision detection classes for SFML.Net
https://github.com/instilledbee/sfmlnet-collision
collision-detection csharp dotnet sfml sfmlnet-collision
Last synced: about 1 year ago
JSON representation
Collision detection classes for SFML.Net
- Host: GitHub
- URL: https://github.com/instilledbee/sfmlnet-collision
- Owner: instilledbee
- License: other
- Created: 2015-07-04T13:34:35.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-03-30T10:59:51.000Z (over 5 years ago)
- Last Synced: 2025-03-23T10:51:11.221Z (over 1 year ago)
- Topics: collision-detection, csharp, dotnet, sfml, sfmlnet-collision
- Language: C#
- Size: 10.7 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SFMLNet-Collision
Collision detection classes for SFML.Net. Tested with SFML.NET v2.1.5 and v2.5
# About
These classes are a direct C# port of the "Simple Collision Detection" source code found in the [SFML wiki](https://github.com/SFML/SFML/wiki/Source:-Simple-Collision-Detection-for-SFML-2). The code is a translation of the existing C++ code, with the intent of making it easy to integrate with SFML.NET projects, and has been made available as a repository, so others may improve on the code and provide feedback.
# Adding the library to your code
The recommended installation is [via Nuget](https://nuget.org/packages/SFML.SimpleCollision/). The package name is `SFML.SimpleCollision`.
You may also directly drop in the 3 class files in the solution to your SFML.NET project and use them as is.
# Usage
`CollisionTester` is the static class that contains the collision testing methods supported (`CircleTest()`, `BoundingBoxTest()` and `PixelPerfectTest()`). To use the pixel perfect collision test, make sure to add the texture's bitmask to the `CollisionTester` via `AddBitMask()`.