本文整理汇总了Java中com.jme3.terrain.noise.filter.OptimizedErode类的典型用法代码示例。如果您正苦于以下问题:Java OptimizedErode类的具体用法?Java OptimizedErode怎么用?Java OptimizedErode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OptimizedErode类属于com.jme3.terrain.noise.filter包,在下文中一共展示了OptimizedErode类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFractalGenerator
import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private Basis createFractalGenerator() {
final FractalSum fractalSum = new FractalSum();
fractalSum.setRoughness(getRoughness());
fractalSum.setFrequency(getFrequency());
fractalSum.setAmplitude(getBrushPower());
fractalSum.setLacunarity(getLacunarity()); // make it greater than 1.0f
fractalSum.setOctaves(getOctaves());
fractalSum.setScale(max(min(getScale(), 1.0F), 0F)); //0.02125f
fractalSum.addModulator((NoiseModulator) in -> ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1));
final FilteredBasis ground = new FilteredBasis(fractalSum);
final PerturbFilter perturb = new PerturbFilter();
perturb.setMagnitude(0.2f);//0.119 the higher, the slower it is
final OptimizedErode therm = new OptimizedErode();
therm.setRadius(5);
therm.setTalus(0.011f);
final SmoothFilter smooth = new SmoothFilter();
smooth.setRadius(1);
smooth.setEffect(0.1f); // 0.7
final IterativeFilter iterate = new IterativeFilter();
iterate.addPreFilter(perturb);
iterate.addPostFilter(smooth);
iterate.setFilter(therm);
iterate.setIterations(1);
ground.addPreFilter(iterate);
return ground;
}
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:35,代码来源:RoughTerrainToolControl.java
示例2: createNoiseGenerator
import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private FilteredBasis createNoiseGenerator()
{
FractalSum base = new FractalSum();
base.setRoughness(0.7f);
base.setFrequency(1.0f);
base.setAmplitude(1.0f);
base.setLacunarity(3.12f);
base.setOctaves(8);
base.setScale(0.02125f);
base.addModulator(new NoiseModulator()
{
@Override public float value(float... in)
{
return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
}
});
FilteredBasis ground = new FilteredBasis(base);
PerturbFilter perturb = new PerturbFilter();
perturb.setMagnitude(0.119f);
OptimizedErode therm = new OptimizedErode();
therm.setRadius(5);
therm.setTalus(0.011f);
SmoothFilter smooth = new SmoothFilter();
smooth.setRadius(1);
smooth.setEffect(0.7f);
IterativeFilter iterate = new IterativeFilter();
iterate.addPreFilter(perturb);
iterate.addPostFilter(smooth);
iterate.setFilter(therm);
iterate.setIterations(1);
ground.addPreFilter(iterate);
return ground;
}
开发者ID:jayfella,项目名称:World,代码行数:40,代码来源:Example_NoiseHeightMap.java
示例3: createFractalGenerator
import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private Basis createFractalGenerator(RoughExtraToolParams params, float weight) {
FractalSum base = new FractalSum();
base.setRoughness(params.roughness);
base.setFrequency(params.frequency);
base.setAmplitude(weight);
base.setLacunarity(params.lacunarity <= 1 ? 1.1f : params.lacunarity); // make it greater than 1.0f
base.setOctaves(params.octaves);
float scale = params.scale;
if (scale > 1.0f)
scale = 1.0f;
if (scale < 0)
scale = 0;
base.setScale(scale);//0.02125f
base.addModulator(new NoiseModulator() {
@Override
public float value(float... in) {
return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
}
});
FilteredBasis ground = new FilteredBasis(base);
PerturbFilter perturb = new PerturbFilter();
perturb.setMagnitude(0.2f);//0.119 the higher, the slower it is
OptimizedErode therm = new OptimizedErode();
therm.setRadius(5);
therm.setTalus(0.011f);
SmoothFilter smooth = new SmoothFilter();
smooth.setRadius(1);
smooth.setEffect(0.1f); // 0.7
IterativeFilter iterate = new IterativeFilter();
iterate.addPreFilter(perturb);
iterate.addPostFilter(smooth);
iterate.setFilter(therm);
iterate.setIterations(1);
ground.addPreFilter(iterate);
return ground;
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:44,代码来源:RoughTerrainToolAction.java
示例4: createWorldWithNoise
import com.jme3.terrain.noise.filter.OptimizedErode; //导入依赖的package包/类
private void createWorldWithNoise()
{
NoiseBasedWorld newWorld = new NoiseBasedWorld(app, bulletAppState.getPhysicsSpace(), tileSize, blockSize);
newWorld.setWorldHeight(192f);
newWorld.setViewDistance(2);
// newWorld.setViewDistance(14, 1, 2, 1);
newWorld.setCacheTime(5000);
Material terrainMaterial = createTerrainMaterial();
newWorld.setMaterial(terrainMaterial);
// create a noise generator
FractalSum base = new FractalSum();
base.setRoughness(0.7f);
base.setFrequency(1.0f);
base.setAmplitude(1.0f);
base.setLacunarity(3.12f);
base.setOctaves(8);
base.setScale(0.02125f);
base.addModulator(new NoiseModulator()
{
@Override
public float value(float... in) {
return ShaderUtils.clamp(in[0] * 0.5f + 0.5f, 0, 1);
}
});
FilteredBasis ground = new FilteredBasis(base);
PerturbFilter perturb = new PerturbFilter();
perturb.setMagnitude(0.119f);
OptimizedErode therm = new OptimizedErode();
therm.setRadius(5);
therm.setTalus(0.011f);
SmoothFilter smooth = new SmoothFilter();
smooth.setRadius(1);
smooth.setEffect(0.7f);
IterativeFilter iterate = new IterativeFilter();
iterate.addPreFilter(perturb);
iterate.addPostFilter(smooth);
iterate.setFilter(therm);
iterate.setIterations(1);
ground.addPreFilter(iterate);
newWorld.setFilteredBasis(ground);
this.world = newWorld;
}
开发者ID:jayfella,项目名称:TerrainWorld,代码行数:57,代码来源:Main.java
注:本文中的com.jme3.terrain.noise.filter.OptimizedErode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论