-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge develop into master (pull request #9)
# Package changes (external) - Replace linear interpolation with spherical (linear) interpolation in spherical mesh fragmentation as discussed [here](https://blog.matheusamazonas.net/posts/generating_icosphere_with_code#step-2-fragmentation). - Fix Randomizer sample sometimes creating terrains with holes. - Add an assembly definition file for each sample. # Project changes (internal) In addition to the package (external) changes, this version contains the following internal changes: - Use LSL's information in the package's "author" section. - Upgrade to Unity 2022.3.47. - Optimize Display's setup warmup.
- Loading branch information
Showing
21 changed files
with
203 additions
and
57 deletions.
There are no files selected for viewing
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
36 changes: 36 additions & 0 deletions
36
Assets/Libraries/TerracedTerrainGenerator/Runtime/MeshFragmentation/PlanarMeshFragmenter.cs
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,36 @@ | ||
using UnityEngine; | ||
|
||
namespace LazySquirrelLabs.TerracedTerrainGenerator.MeshFragmentation | ||
{ | ||
/// <summary> | ||
/// Fragments a planar mesh into sub-triangles given an arbitrary depth. The original mesh is modified. | ||
/// </summary> | ||
internal class PlanarMeshFragmenter : MeshFragmenter | ||
{ | ||
#region Setup | ||
|
||
/// <summary> | ||
/// <see cref="PlanarMeshFragmenter"/>'s constructor. To actually fragment a mesh, call | ||
/// <see cref="MeshFragmenter.Fragment"/>. | ||
/// </summary> | ||
/// <param name="depth">The depth (how many consecutive times) the mesh will be fragmented.</param> | ||
internal PlanarMeshFragmenter(ushort depth) : base(depth) { } | ||
|
||
#endregion | ||
|
||
#region Internal | ||
|
||
/// <summary> | ||
/// Finds the middle point between the given positions. | ||
/// </summary> | ||
/// <param name="v1">The first position to find the middle point for.</param> | ||
/// <param name="v2">The second position to find the middle point for.</param> | ||
/// <returns>The middle point between <paramref name="v1"/> and <paramref name="v2"/>.</returns> | ||
protected override Vector3 FindMiddlePoint(Vector3 v1, Vector3 v2) | ||
{ | ||
return (v1 + v2) / 2; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...Libraries/TerracedTerrainGenerator/Runtime/MeshFragmentation/PlanarMeshFragmenter.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...s/Libraries/TerracedTerrainGenerator/Runtime/MeshFragmentation/SphericalMeshFragmenter.cs
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,36 @@ | ||
using UnityEngine; | ||
|
||
namespace LazySquirrelLabs.TerracedTerrainGenerator.MeshFragmentation | ||
{ | ||
/// <summary> | ||
/// Fragments a spherical mesh into sub-triangles given an arbitrary depth. The original mesh is modified. | ||
/// </summary> | ||
internal class SphericalMeshFragmenter : MeshFragmenter | ||
{ | ||
#region Setup | ||
|
||
/// <summary> | ||
/// <see cref="SphericalMeshFragmenter"/>'s constructor. To actually fragment a mesh, call | ||
/// <see cref="MeshFragmenter.Fragment"/>. | ||
/// </summary> | ||
/// <param name="depth">The depth (how many consecutive times) the mesh will be fragmented.</param> | ||
internal SphericalMeshFragmenter(ushort depth) : base(depth) { } | ||
|
||
#endregion | ||
|
||
#region Protected | ||
|
||
/// <summary> | ||
/// Finds the middle point between the given directions. | ||
/// </summary> | ||
/// <param name="v1">The first direction to find the middle point for.</param> | ||
/// <param name="v2">The second direction to find the middle point for.</param> | ||
/// <returns>The middle point between <paramref name="v1"/> and <paramref name="v2"/>.</returns> | ||
protected override Vector3 FindMiddlePoint(Vector3 v1, Vector3 v2) | ||
{ | ||
return Vector3.Slerp(v1, v2, 0.5f); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...raries/TerracedTerrainGenerator/Runtime/MeshFragmentation/SphericalMeshFragmenter.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
4 changes: 2 additions & 2 deletions
4
...s.TerracedTerrainGenerator.Samples.asmdef → ...edTerrainGenerator.Samples.Display.asmdef
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
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...etersTest/Scripts/LazySquirrelLabs.TerracedTerrainGenerator.Samples.ParametersTest.asmdef
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,16 @@ | ||
{ | ||
"name": "LazySquirrelLabs.TerracedTerrainGenerator.Samples.ParametersTest", | ||
"rootNamespace": "LazySquirrelLabs.TerracedTerrainGenerator.Samples.ParametersTest", | ||
"references": [ | ||
"GUID:3a0a9c0c8ea5546ce85aca8e39ded36b" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
7 changes: 7 additions & 0 deletions
7
...Test/Scripts/LazySquirrelLabs.TerracedTerrainGenerator.Samples.ParametersTest.asmdef.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.