diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools | |
parent | * Deleted .user file (diff) | |
download | opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools')
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Point2D.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Tools.cs | 31 |
2 files changed, 17 insertions, 20 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Point2D.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Point2D.cs index 9985f03..1d52da9 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Point2D.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Point2D.cs | |||
@@ -26,10 +26,6 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | |||
33 | namespace libTerrain | 29 | namespace libTerrain |
34 | { | 30 | { |
35 | public class Point2D | 31 | public class Point2D |
@@ -43,4 +39,4 @@ namespace libTerrain | |||
43 | y = Y; | 39 | y = Y; |
44 | } | 40 | } |
45 | } | 41 | } |
46 | } | 42 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Tools.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Tools.cs index 3207f15..d805794 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Tools.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Tools/Tools.cs | |||
@@ -27,33 +27,34 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | 30 | ||
33 | namespace libTerrain | 31 | namespace libTerrain |
34 | { | 32 | { |
35 | class Tools | 33 | internal class Tools |
36 | { | 34 | { |
37 | public static double LinearInterpolate(double a, double b, double amount) | 35 | public static double LinearInterpolate(double a, double b, double amount) |
38 | { | 36 | { |
39 | return a + ((b - a) * amount); | 37 | return a + ((b - a)*amount); |
40 | } | 38 | } |
41 | 39 | ||
42 | public static double ExponentialInterpolate(double a, double b, double amount) | 40 | public static double ExponentialInterpolate(double a, double b, double amount) |
43 | { | 41 | { |
44 | a = Math.Pow(a, amount); | 42 | a = Math.Pow(a, amount); |
45 | b = Math.Pow(b - a, 1.0 - amount); | 43 | b = Math.Pow(b - a, 1.0 - amount); |
46 | return a+b; | 44 | return a + b; |
47 | } | 45 | } |
48 | 46 | ||
49 | public static int PowerOf2Log2(int n) { | 47 | public static int PowerOf2Log2(int n) |
50 | for (int i = 0; i < 31; i++) { | 48 | { |
51 | if ((n & 1) == 1) { | 49 | for (int i = 0; i < 31; i++) |
52 | return i; | 50 | { |
53 | } | 51 | if ((n & 1) == 1) |
54 | n >>= 1; | 52 | { |
55 | } | 53 | return i; |
56 | return 0; | 54 | } |
57 | } | 55 | n >>= 1; |
56 | } | ||
57 | return 0; | ||
58 | } | ||
58 | } | 59 | } |
59 | } | 60 | } \ No newline at end of file |