-
Notifications
You must be signed in to change notification settings - Fork 115
/
VertexHeightNoiseVertHeightCurve3.cs
executable file
·263 lines (233 loc) · 10.5 KB
/
VertexHeightNoiseVertHeightCurve3.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
/**
* Kopernicus Planetary System Modifier
* -------------------------------------------------------------
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* This library is intended to be used as a plugin for Kerbal Space Program
* which is copyright 2011-2017 Squad. Your usage of Kerbal Space Program
* itself is governed by the terms of its EULA, not the license above.
*
* https://kerbalspaceprogram.com
*/
using LibNoise;
using System;
using UnityEngine;
namespace Kopernicus
{
namespace Configuration
{
namespace ModLoader
{
[RequireConfigType(ConfigType.Node)]
public class VertexHeightNoiseVertHeightCurve3 : ModLoader<PQSMod_VertexHeightNoiseVertHeightCurve3>
{
// Maximum deformity
[ParserTarget("deformityMax")]
public NumericParser<Double> deformityMax
{
get { return mod.deformityMax; }
set { mod.deformityMax = value; }
}
// Minimum deformity
[ParserTarget("deformityMin")]
public NumericParser<Double> deformityMin
{
get { return mod.deformityMin; }
set { mod.deformityMin = value; }
}
// Deformity multiplier curve
[ParserTarget("inputHeightCurve")]
public FloatCurveParser inputHeightCurve
{
get { return mod.inputHeightCurve; }
set { mod.inputHeightCurve = value; }
}
// Ending height
[ParserTarget("inputHeightEnd")]
public NumericParser<Double> inputHeightEnd
{
get { return mod.inputHeightEnd; }
set { mod.inputHeightEnd = value; }
}
// Starting height
[ParserTarget("inputHeightStart")]
public NumericParser<Double> inputHeightStart
{
get { return mod.inputHeightStart; }
set { mod.inputHeightStart = value; }
}
// The frequency of the simplex multiplier
[ParserTarget("multiplierFrequency")]
public NumericParser<Double> multiplierFrequency
{
get { return mod.curveMultiplier.frequency; }
set { mod.curveMultiplier.frequency = value; }
}
// Octaves of the simplex multiplier
[ParserTarget("multiplierOctaves")]
public NumericParser<Int32> multiplierOctaves
{
get { return mod.curveMultiplier.octaves; }
set { mod.curveMultiplier.octaves = value; }
}
// Persistence of the simplex multiplier
[ParserTarget("multiplierPersistence")]
public NumericParser<Double> multiplierPersistence
{
get { return mod.curveMultiplier.persistence; }
set { mod.curveMultiplier.persistence = value; }
}
// The seed of the simplex multiplier
[ParserTarget("multiplierSeed")]
public NumericParser<Int32> multiplierSeed
{
get { return mod.curveMultiplier.seed; }
set { mod.curveMultiplier.seed = value; }
}
// The frequency of the simplex noise on deformity
[ParserTarget("deformityFrequency")]
public NumericParser<Double> deformityFrequency
{
get { return mod.deformity.frequency; }
set { mod.deformity.frequency = value; }
}
// Octaves of the simplex noise on deformity
[ParserTarget("deformityOctaves")]
public NumericParser<Int32> deformityOctaves
{
get { return mod.deformity.octaves; }
set { mod.deformity.octaves = value; }
}
// Persistence of the simplex noise on deformity
[ParserTarget("deformityPersistence")]
public NumericParser<Double> deformityPersistence
{
get { return mod.deformity.persistence; }
set { mod.deformity.persistence = value; }
}
// The seed of the simplex noise on deformity
[ParserTarget("deformitySeed")]
public NumericParser<Int32> deformitySeed
{
get { return mod.deformity.seed; }
set { mod.deformity.seed = value; }
}
// The frequency of the additive noise
[ParserTarget("ridgedAddFrequency")]
public NumericParser<Double> ridgedAddFrequency
{
get { return mod.ridgedAdd.frequency; }
set { mod.ridgedAdd.frequency = value; }
}
// Lacunarity of the additive noise
[ParserTarget("ridgedAddLacunarity")]
public NumericParser<Double> ridgedAddLacunarity
{
get { return mod.ridgedAdd.lacunarity; }
set { mod.ridgedAdd.lacunarity = value; }
}
// Octaves of the additive noise
[ParserTarget("ridgedAddOctaves")]
public NumericParser<Int32> ridgedAddOctaves
{
get { return mod.ridgedAdd.octaves; }
set { mod.ridgedAdd.octaves = Mathf.Clamp(value, 1, 30); }
}
// The quality of the additive noise
[ParserTarget("ridgedAddQuality")]
public EnumParser<KopernicusNoiseQuality> ridgedAddQuality
{
get { return (KopernicusNoiseQuality) (Int32) mod.ridgedAdd.quality; }
set { mod.ridgedAdd.quality = (NoiseQuality) (Int32) value.Value; }
}
// The seed of the additive noise
[ParserTarget("ridgedAddSeed")]
public NumericParser<Int32> ridgedAddSeed
{
get { return mod.ridgedAdd.seed; }
set { mod.ridgedAdd.seed = value; }
}
// The frequency of the subtractive noise
[ParserTarget("ridgedSubFrequency")]
public NumericParser<Double> ridgedSubFrequency
{
get { return mod.ridgedSub.frequency; }
set { mod.ridgedSub.frequency = value; }
}
// Lacunarity of the subtractive noise
[ParserTarget("ridgedSubLacunarity")]
public NumericParser<Double> ridgedSubLacunarity
{
get { return mod.ridgedSub.lacunarity; }
set { mod.ridgedSub.lacunarity = value; }
}
// Octaves of the subtractive noise
[ParserTarget("ridgedSubOctaves")]
public NumericParser<Int32> ridgedSubOctaves
{
get { return mod.ridgedSub.octaves; }
set { mod.ridgedSub.octaves = Mathf.Clamp(value, 1, 30); }
}
// The quality of the subtractive noise
[ParserTarget("ridgedSubQuality")]
public EnumParser<KopernicusNoiseQuality> ridgedSubQuality
{
get { return (KopernicusNoiseQuality) (Int32) mod.ridgedSub.quality; }
set { mod.ridgedSub.quality = (NoiseQuality) (Int32) value.Value; }
}
// The seed of the subtractive noise
[ParserTarget("ridgedSubSeed")]
public NumericParser<Int32> ridgedSubSeed
{
get { return mod.ridgedSub.seed; }
set { mod.ridgedSub.seed = value; }
}
// Create the mod
public override void Create(PQS pqsVersion)
{
base.Create(pqsVersion);
// Construct the internal objects.
mod.curveMultiplier = new PQSMod_VertexHeightNoiseVertHeightCurve3.SimplexNoise();
mod.deformity = new PQSMod_VertexHeightNoiseVertHeightCurve3.SimplexNoise();
mod.ridgedAdd = new PQSMod_VertexHeightNoiseVertHeightCurve3.RidgedNoise();
mod.ridgedSub = new PQSMod_VertexHeightNoiseVertHeightCurve3.RidgedNoise();
}
// Create the mod
public override void Create(PQSMod_VertexHeightNoiseVertHeightCurve3 _mod, PQS pqsVersion)
{
base.Create(_mod, pqsVersion);
// Construct the internal objects.
if (mod.curveMultiplier == null)
{
mod.curveMultiplier = new PQSMod_VertexHeightNoiseVertHeightCurve3.SimplexNoise();
}
if (mod.deformity == null)
{
mod.deformity = new PQSMod_VertexHeightNoiseVertHeightCurve3.SimplexNoise();
}
if (mod.ridgedAdd == null)
{
mod.ridgedAdd = new PQSMod_VertexHeightNoiseVertHeightCurve3.RidgedNoise();
}
if (mod.ridgedSub == null)
{
mod.ridgedSub = new PQSMod_VertexHeightNoiseVertHeightCurve3.RidgedNoise();
}
}
}
}
}
}