From 03afbe4442b62960eccbd52cf898c9cc1a930369 Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Sat, 18 Jul 2020 03:28:28 -0700 Subject: [PATCH] fix some references --- content/_index.md | 4 ++-- content/api/SpatialHash.md | 6 +++--- content/broad_phase/spatial_hash.md | 6 +++--- content/getting_started/installation.md | 8 ++++---- content/transform/overview.md | 5 ++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/content/_index.md b/content/_index.md index 82f4a3d..55c953a 100644 --- a/content/_index.md +++ b/content/_index.md @@ -4,7 +4,7 @@ title: "Bonk" # Bonk -[Bonk](https://github.com/MoonsideGames/MoonTools.Core.Bonk) is a fast and modular collision detection system for MonoGame that is part of the MoonTools suite. +[Bonk](https://gitea.moonside.games/MoonsideGames/MoonTools.Bonk) is a fast and modular collision detection system for MonoGame that is part of the MoonTools suite. Bonk **is** designed to help you figure out if two shapes are overlapping and by how much. @@ -12,6 +12,6 @@ Bonk **is not** a physics simulator and it will not help you execute collision r Bonk is designed for performance and memory efficiency. Defining shapes and performing collision tests require no heap allocations and thus put no pressure on the garbage collector. If you reuse spatial hashes, Bonk will never cause garbage collection. -Bonk is available as a [NuGet package](https://www.nuget.org/packages/MoonTools.Core.Bonk/) and can also be included in your project [from source](https://github.com/MoonsideGames/MoonTools.Core.Bonk). +Bonk is available as a [NuGet package](https://www.nuget.org/packages/MoonTools.Bonk/) and can also be included in your project [from source](https://gitea.moonside.games/MoonsideGames/MoonTools.Bonk). Bonk is licensed under the [LGPL-3](https://www.gnu.org/licenses/lgpl-3.0.en.html) license. In summary: feel free to include it in your closed-source game and modify it internally at will, but if you make changes that you intend to redistribute, you **must** freely publish your changes. diff --git a/content/api/SpatialHash.md b/content/api/SpatialHash.md index ff87cba..2750e7c 100644 --- a/content/api/SpatialHash.md +++ b/content/api/SpatialHash.md @@ -33,7 +33,7 @@ Given an ID, a shape, and corresponding transform, inserts into the spatial hash ```cs var hash = new SpatialHash(16); -var circle = new MoonTools.Core.Bonk.Circle(8); +var circle = new MoonTools.Bonk.Circle(8); var circleTransform = new Transform2D(new Vector2(16, 16)); var rect = new Rectangle(-2, -2, 2, 2); @@ -54,7 +54,7 @@ Given an ID, a shape, and corresponding transform, retrieves a set of potential ```cs var hash = new SpatialHash(16); -var circle = new MoonTools.Core.Bonk.Circle(8); +var circle = new MoonTools.Bonk.Circle(8); var circleTransform = new Transform2D(new Vector2(16, 16)); var rect = new Rectangle(-2, -2, 2, 2); @@ -74,4 +74,4 @@ If a potential colliding shape-transform has the same ID as the one passed into ##### **public void Clear()** -Empties the spatial hash. Useful when the spatial hash contains dynamic data that needs to be updated. \ No newline at end of file +Empties the spatial hash. Useful when the spatial hash contains dynamic data that needs to be updated. diff --git a/content/broad_phase/spatial_hash.md b/content/broad_phase/spatial_hash.md index d50273d..904acae 100644 --- a/content/broad_phase/spatial_hash.md +++ b/content/broad_phase/spatial_hash.md @@ -14,14 +14,14 @@ var hash = new SpatialHash(32); This spatial hash will use C# **GUID**s as its ID type and a cell width of 32. -There is an art to choosing a cell width. If your cell width is too small relative to the objects in your game, then your objects will occupy many cells, and the hash check will have to check all of those cells for potential collisions. If your cell width is too large, then many objects will be contained in each cell. You are looking for a sweet spot. My rule of thumb is picking a cell width that is roughly twice the size of the most common objects in your game. +There is an art to choosing a cell width. If your cell width is too small relative to the objects in your game, then your objects will occupy many cells, and the hash check will have to check all of those cells for potential collisions. If your cell width is too large, then many objects will be contained in each cell. You are looking for a sweet spot. My rule of thumb is picking a cell width that is roughly twice the size of the most common objects in your game. To insert an object into the hash, use the **Insert** method and give an ID, an IShape2D, and a Transform2D. ```cs var hash = new SpatialHash(16); -var circle = new MoonTools.Core.Bonk.Circle(8); +var circle = new MoonTools.Bonk.Circle(8); var circleTransform = new Transform2D(new Vector2(16, 16)); var rect = new Rectangle(-2, -2, 2, 2); @@ -47,4 +47,4 @@ hash.Clear(); // Re-insert objects here ``` -That's it! This is everything you need to use a spatial hash for broad-phase collision. \ No newline at end of file +That's it! This is everything you need to use a spatial hash for broad-phase collision. diff --git a/content/getting_started/installation.md b/content/getting_started/installation.md index 731549f..88bdc9e 100644 --- a/content/getting_started/installation.md +++ b/content/getting_started/installation.md @@ -8,21 +8,21 @@ The simplest way of using Bonk is by including it in your C# project as a NuGet To include the latest version of Bonk in your project using the .NET CLI, use the following command: ```sh -dotnet add package MoonTools.Core.Bonk +dotnet add package MoonTools.Bonk ``` If you are using the NuGet Package Manager, you may do: ```sh -PM> Install-Package MoonTools.Core.Bonk +PM> Install-Package MoonTools.Bonk ``` Once you have done this, you may access Bonk functionality by including ```cs -using MoonTools.Core.Bonk; +using MoonTools.Bonk; ``` in any C# file. -Of course, you are free to include the source code directly in your project as well, but this is less convenient. \ No newline at end of file +Of course, you are free to include the source code directly in your project as well, but this is less convenient. diff --git a/content/transform/overview.md b/content/transform/overview.md index c1da1be..a17c8ca 100644 --- a/content/transform/overview.md +++ b/content/transform/overview.md @@ -4,11 +4,10 @@ date: 2019-09-14T23:08:31-07:00 weight: 5 --- -Bonk uses the *Transform2D* struct which is taken from the MoonTools.Core.Structs package. By extension it also uses the *Position2D* struct taken from the same package. +Bonk uses the *Transform2D* struct which is taken from the MoonTools.Structs package. By extension it also uses the *Position2D* struct taken from the same package. A *Transform2D* is basically a way to store information about an object's location, rotation, and scale in 2-dimensional space. Transforms use matrix math to perform all of these operations at once, making them very fast. -For memory performance purposes, shapes are implemented as structs, meaning they are value types. This means that it is much easier to deal with collision using a transform applied to a shape, rather than containing a transform within the shape. +For memory performance purposes, shapes are implemented as structs, meaning they are value types. This means that it is much easier to deal with collision using a transform applied to a shape, rather than containing a transform within the shape. It is also often the case that you will have a shape attached to a game object that is offset from the object by a certain amount. A *Transform2D* can represent this information as well, since *Tranform2Ds* can be composed together. As you can see, a *Transform2D* provides a generic structure for dealing with many scenarios involving 2D space. -