Skip to content
Took-StudioPublic

About

C# and TS library that allows you to use physics, math and geometry methods for developing games

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

GamemBanner

NuGet Version NuGet Downloads

NPM Version NPM Downloads

Static Badge

If you need vectors for Unity, Godot, MonoGame or Stride, use these extensions:

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!

Features

  • MathGm: RandomRange, SmoothStep, Lerp, InverseLerp, SmoothDamp and more
  • PhysicsGm: ApplyGravity, ApplyFriction, AddForce, AddImpulse, ClampVelocity, Bounce and more
  • GeometryGm: Reflect, ToRadians, ToDegrees, GetDistance, NormalizeAngle and more
  • CollisionGm: CheckCircleVsCircle, CheckAABBVsAABB, CheckCircleVsAABB, CheckSegmentVsSegment
  • VectorGm: GetDotProduct, GetDotProduct3D, GetCrossProduct, GetAngleBetween, ClosestPointOnLine and more
  • RandomGm: RollChance, RandomAngleDegrees, RandomAngleRadians, RandomSign and more

Project Structure

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

Installation

(C#) Type this command:

dotnet add package Gamem

(TypeScript) Type this command

npm install gamem-wasm

How to use

(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";

Write code much faster

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);

Why Gamem?

  • 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

Contributing

  • 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

License

Gamem is licensed under the MIT license

About

C# and TS library that allows you to use physics, math and geometry methods for developing games

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages