aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Terrain.BasicTerrain
diff options
context:
space:
mode:
authorAdam Frisby2007-06-20 21:57:22 +0000
committerAdam Frisby2007-06-20 21:57:22 +0000
commit8194d822301481c56c2e48857e6609409613dd6d (patch)
treeb2036fe5cc82334623810c67bee7b0da180ba231 /OpenSim/OpenSim.Terrain.BasicTerrain
parent* Bonus commit: "terrain save" now supports a 'PNG' method. (diff)
downloadopensim-SC-8194d822301481c56c2e48857e6609409613dd6d.zip
opensim-SC-8194d822301481c56c2e48857e6609409613dd6d.tar.gz
opensim-SC-8194d822301481c56c2e48857e6609409613dd6d.tar.bz2
opensim-SC-8194d822301481c56c2e48857e6609409613dd6d.tar.xz
* Terrain modification more robust, uses area sizes matching those employed by the client display.
* Terrain tools now account for the duration the cursor was held for. * Terrain tools now support new brushes (completing the common set) ** Smooth brush ** Flatten brush ** Revert brush ** Noise brush
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs83
1 files changed, 83 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
index 2d0fb30..d1d54ad 100644
--- a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -542,6 +542,89 @@ namespace OpenSim.Terrain
542 } 542 }
543 543
544 /// <summary> 544 /// <summary>
545 /// Flattens the land under the brush of specified coordinates (spherical mask)
546 /// </summary>
547 /// <param name="rx">Center of sphere</param>
548 /// <param name="ry">Center of sphere</param>
549 /// <param name="size">Radius of the sphere</param>
550 /// <param name="amount">Thickness of the mask (0..2 recommended)</param>
551 public void flatten(double rx, double ry, double size, double amount)
552 {
553 lock (heightmap)
554 {
555 heightmap.flatten(rx, ry, size, amount);
556 }
557
558 tainted++;
559 }
560
561 /// <summary>
562 /// Creates noise within the specified bounds
563 /// </summary>
564 /// <param name="rx">Center of the bounding sphere</param>
565 /// <param name="ry">Center of the bounding sphere</param>
566 /// <param name="size">The radius of the sphere</param>
567 /// <param name="amount">Strength of the mask (0..2) recommended</param>
568 public void noise(double rx, double ry, double size, double amount)
569 {
570 lock (heightmap)
571 {
572 Channel smoothed = new Channel();
573 smoothed.noise();
574
575 Channel mask = new Channel();
576 mask.raise(rx, ry, size, amount);
577
578 heightmap.blend(smoothed, mask);
579 }
580
581 tainted++;
582 }
583
584 /// <summary>
585 /// Reverts land within the specified bounds
586 /// </summary>
587 /// <param name="rx">Center of the bounding sphere</param>
588 /// <param name="ry">Center of the bounding sphere</param>
589 /// <param name="size">The radius of the sphere</param>
590 /// <param name="amount">Strength of the mask (0..2) recommended</param>
591 public void revert(double rx, double ry, double size, double amount)
592 {
593 lock (heightmap)
594 {
595 Channel mask = new Channel();
596 mask.raise(rx, ry, size, amount);
597
598 heightmap.blend(revertmap, mask);
599 }
600
601 tainted++;
602 }
603
604 /// <summary>
605 /// Smooths land under the brush of specified coordinates (spherical mask)
606 /// </summary>
607 /// <param name="rx">Center of the sphere</param>
608 /// <param name="ry">Center of the sphere</param>
609 /// <param name="size">Radius of the sphere</param>
610 /// <param name="amount">Thickness of the mask (0..2 recommended)</param>
611 public void smooth(double rx, double ry, double size, double amount)
612 {
613 lock (heightmap)
614 {
615 Channel smoothed = heightmap.copy();
616 smoothed.smooth(amount);
617
618 Channel mask = new Channel();
619 mask.raise(rx,ry,size,amount);
620
621 heightmap.blend(smoothed, mask);
622 }
623
624 tainted++;
625 }
626
627 /// <summary>
545 /// Generates a simple set of hills in the shape of an island 628 /// Generates a simple set of hills in the shape of an island
546 /// </summary> 629 /// </summary>
547 public void hills() 630 public void hills()