Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
AIGT_ProceduralTerrain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Buenen,F.W.M. (Felix)
AIGT_ProceduralTerrain
Commits
8c9c2b05
Commit
8c9c2b05
authored
4 years ago
by
Julian Thijssen
Browse files
Options
Downloads
Patches
Plain Diff
Lower cliffs and meander the rivers a little
parent
7d693036
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/CliffAgent.cs
+1
-1
1 addition, 1 deletion
Assets/Scripts/CliffAgent.cs
Assets/Scripts/RiverAgent.cs
+9
-2
9 additions, 2 deletions
Assets/Scripts/RiverAgent.cs
with
10 additions
and
3 deletions
Assets/Scripts/CliffAgent.cs
+
1
−
1
View file @
8c9c2b05
...
...
@@ -8,7 +8,7 @@ public class CliffAgent : ScriptableObject
private
Vector2Int
pos
;
private
float
cliffHeight
=
0.
6
f
;
private
float
cliffHeight
=
0.
4
f
;
// Start is called before the first frame update
void
Start
()
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/RiverAgent.cs
+
9
−
2
View file @
8c9c2b05
...
...
@@ -10,7 +10,7 @@ public class RiverAgent : MonoBehaviour
private
float
cliffHeight
=
0.6f
;
private
Vector2
direction
;
private
Vector2
origDir
;
// Start is called before the first frame update
void
Start
()
...
...
@@ -41,10 +41,17 @@ public class RiverAgent : MonoBehaviour
int
size
=
heightmap
.
getSize
();
pos
=
new
Vector2Int
(
size
/
2
,
size
/
2
);
direction
=
Random
.
insideUnitCircle
;
origDir
=
Random
.
insideUnitCircle
;
Vector2
direction
=
origDir
;
for
(
int
i
=
0
;
i
<
1000
;
i
++)
{
Vector2
randDir
=
Random
.
insideUnitCircle
;
randDir
=
Vector2
.
Dot
(
direction
,
randDir
)
>
0
?
randDir
:
-
randDir
;
Vector2
deviation
=
randDir
*
0.5f
;
direction
+=
deviation
;
direction
.
Normalize
();
pos
+=
direction
;
Vector2Int
intPos
=
new
Vector2Int
((
int
)
pos
.
x
,
(
int
)
pos
.
y
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment