- Gamem.Unity for Unity (
⚠️ UNITY PROJECTS ONLY) - Gamem.Godot for Godot
- Gamem.MonoGame for MonoGame
- Gamem.Stride for Stride
Gamem is a C# and TypeScript library of Physics, Math and Geometry helpers, created for you to type code in one line instead of huge formulas. It works everywhere! From Console to Unity, Godot, MonoGame and different JS engines!
- MathGm:
RandomRange,SmoothStep,Lerp,InverseLerp,SmoothDampand more - PhysicsGm:
ApplyGravity,ApplyFriction,AddForce,AddImpulse,ClampVelocity,Bounceand more - GeometryGm:
Reflect,ToRadians,ToDegrees,GetDistance,NormalizeAngleand more - CollisionGm:
CheckCircleVsCircle,CheckAABBVsAABB,CheckCircleVsAABB,CheckSegmentVsSegment - VectorGm:
GetDotProduct,GetDotProduct3D,GetCrossProduct,GetAngleBetween,ClosestPointOnLineand more - RandomGm:
RollChance,RandomAngleDegrees,RandomAngleRadians,RandomSignand more
Click to view full Project Structure
Gamem
├── .github
│ ├── Assets
│ │ ├── ScreenShots
│ │ │ ├── 01.png
│ │ │ ├── 02.png
│ │ │ └── 03.png
│ │ ├── GamemBanner.png
│ │ ├── GamemContributingBanner.png
│ │ └── GamemTestsBanner.png
│ └── workflows
│ ├── build-docs.yml
│ └── scheduled-release.yml
├── docs
│ ├── docs
│ │ ├── getting-started.md
│ │ └── toc.yml
│ ├── images
│ │ └── logo.png
│ ├── public
│ │ └── main.css
│ ├── docfx.json
│ ├── favicon.ico
│ ├── index.md
│ ├── README.md
│ └── toc.yml
├── src
│ ├── Csharp
│ │ ├── Base
│ │ │ ├── GeometryGm
│ │ │ │ ├── CollisionGm
│ │ │ │ │ ├── CollisionGm.net8.cs
│ │ │ │ │ └── CollisionGm.netstandard.cs
│ │ │ │ ├── VectorGm
│ │ │ │ │ ├── VectorGm.net8.cs
│ │ │ │ │ └── VectorGm.netstandard.cs
│ │ │ │ ├── GeometryGm.net8.cs
│ │ │ │ └── GeometryGm.netstandard.cs
│ │ │ ├── images
│ │ │ │ └── logo.png
│ │ │ ├── MathGm
│ │ │ │ ├── RandomGm
│ │ │ │ │ ├── RandomGm.net8.cs
│ │ │ │ │ └── RandomGm.netstandard.cs
│ │ │ │ ├── MathGm.net8.cs
│ │ │ │ └── MathGm.netstandard.cs
│ │ │ ├── PhysicsGm
│ │ │ │ ├── PhysicsGm.net8.cs
│ │ │ │ └── PhysicsGm.netstandard.cs
│ │ │ ├── Extra.net8.cs
│ │ │ ├── Gamem.csproj
│ │ │ └── README.md
│ │ ├── Godot
│ │ │ ├── images
│ │ │ │ └── logo.png
│ │ │ ├── CollisionGmGodot.cs
│ │ │ ├── Gamem.Godot.csproj
│ │ │ ├── GeometryGmGodot.cs
│ │ │ ├── MathGmGodot.cs
│ │ │ ├── PhysicsGmGodot.cs
│ │ │ ├── README.md
│ │ │ └── VectorGmGodot.cs
│ │ ├── MonoGame
│ │ │ ├── images
│ │ │ │ └── logo.png
│ │ │ ├── CollisionGmMonoGame.cs
│ │ │ ├── Gamem.MonoGame.csproj
│ │ │ ├── GeometryGmMonoGame.cs
│ │ │ ├── MathGmMonoGame.cs
│ │ │ ├── PhysicsGmMonoGame.cs
│ │ │ ├── README.md
│ │ │ └── VectorGmMonoGame.cs
│ │ └── Stride
│ │ ├── images
│ │ │ └── logo.png
│ │ ├── CollisionGmStride.cs
│ │ ├── Gamem.Stride.csproj
│ │ ├── GeometryGmStride.cs
│ │ ├── MathGmStride.cs
│ │ ├── PhysicsGmStride.cs
│ │ ├── README.md
│ │ └── VectorGmStride.cs
│ └── Web
│ ├── cpp
│ │ ├── include
│ │ │ ├── GeometryGm.hpp
│ │ │ ├── MathGm.hpp
│ │ │ └── PhysicsGm.hpp
│ │ └── src
│ │ ├── GeometryGm.cpp
│ │ ├── MathGm.cpp
│ │ └── PhysicsGm.cpp
│ ├── src
│ │ ├── gamem_wasm.d.ts
│ │ ├── GeometryGm.ts
│ │ ├── index.ts
│ │ ├── MathGm.ts
│ │ ├── PhysicsGm.ts
│ │ └── WasmLoader.ts
│ ├── 3RD-PARTY-LICENSES
│ ├── package-lock.json
│ ├── package.json
│ ├── README.md
│ └── tsconfig.json
├── Tests
│ ├── Unit
│ │ └── Csharp
│ │ ├── Gamem.Tests.csproj
│ │ ├── MathGmTests.cs
│ │ └── PhysicsGmTests.cs
│ └── README.md
├── .clangd
├── .gitignore
├── CONTRIBUTING.md
├── Gamem.slnx
├── google223cc46a9ab379ba.html
├── LICENSE
└── README.md
(C#) Type this command:
dotnet add package Gamem
(TypeScript) Type this command
npm install gamem-wasm
(C#) To use Gamem methods type this:
using Gamem;
using Gamem.Unity; // If you use Unity extension
using Gamem.Godot; // If you use Godot extension
using Gamem.MonoGame; // If you use MonoGame extension
using Gamem.Stride; // If you use Stride extension(TypeScript) To use Gamem methods type this:
import { MathGm, GeometryGm, PhysicsGm, initializeGamem } from "gamem-wasm";
import gamemWasmFactory from "gamem-wasm/dist/gamem_wasm.js";Without Gamem:
float min = 2.5f;
float max = 7.5f;
float speed = Random.Shared.NextDouble() * (max - min) + min;With Gamem (1 line of code only):
float speed = MathGm.RandomRange(2.5f, 7.5f);- Zero Dependencies - C# and TypeScript only. Doesn't use other heavy libraries
- Engine doesn't matter - You can use it in any engine or project!
- Good performance - Optimized methods via Aggressive Inlining
- Liked the project? Leave a star for this repo, it motivates me to develop this project!
- Have any ideas or found a bug? Open an issue or send Pull Request!
- To contribute the project check CONTRIBUTING.md
Gamem is licensed under the MIT license
