-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create MeshBuilder class from Renderer code
Used for creating triangles or quads for Skia rendering. Also can be used for Unity mesh creation (in progress). Move unit tests to NUnit from Microsoft's Test classes to be a bit more open. Upped installer version to 1.2 (not yet released). Added Itch.io banner image for Itch release.
- Loading branch information
Showing
17 changed files
with
388 additions
and
155 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Voxels.Test { | ||
[TestFixture] | ||
|
||
public class TestColor { | ||
[Test] | ||
public void TestHSV() { | ||
float h, s, v; | ||
|
||
Color.Black.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(0, h); | ||
Assert.AreEqual(0, s); | ||
Assert.AreEqual(0, v); | ||
Assert.AreEqual(Color.Black, Color.FromHSV(h, s, v)); | ||
|
||
Color.White.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(0, h); | ||
Assert.AreEqual(0, s); | ||
Assert.AreEqual(1, v); | ||
Assert.AreEqual(Color.White, Color.FromHSV(h, s, v)); | ||
|
||
Color.Red.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(0, h); | ||
Assert.AreEqual(1, s); | ||
Assert.AreEqual(1, v); | ||
Assert.AreEqual(Color.Red, Color.FromHSV(h, s, v)); | ||
|
||
Color.Green.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(120, h); | ||
Assert.AreEqual(1, s); | ||
Assert.AreEqual(1, v); | ||
Assert.AreEqual(Color.Green, Color.FromHSV(h, s, v)); | ||
|
||
Color.Blue.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(240, h); | ||
Assert.AreEqual(1, s); | ||
Assert.AreEqual(1, v); | ||
Assert.AreEqual(Color.Blue, Color.FromHSV(h, s, v)); | ||
|
||
Color.Tan.ToHSV(out h, out s, out v); | ||
Assert.AreEqual(34, h); | ||
Assert.AreEqual(0.3333333, s, 1e-6); | ||
Assert.AreEqual(0.8235294, v, 1e-6); | ||
Assert.AreEqual(Color.Tan, Color.FromHSV(h, s, v)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.