diff options
author | UbitUmarov | 2012-12-02 05:02:33 +0000 |
---|---|---|
committer | Melanie | 2012-12-03 19:41:29 +0100 |
commit | f21d9908200b4bb21f8002e9c87968767ab77bdb (patch) | |
tree | cd137fdaf18ec0d88c3a6f4eef54ca3b6d459078 /OpenSim | |
parent | *TEST* reduce all mesh vertices resolution to 1e-5. This reduces number (diff) | |
download | opensim-SC-f21d9908200b4bb21f8002e9c87968767ab77bdb.zip opensim-SC-f21d9908200b4bb21f8002e9c87968767ab77bdb.tar.gz opensim-SC-f21d9908200b4bb21f8002e9c87968767ab77bdb.tar.bz2 opensim-SC-f21d9908200b4bb21f8002e9c87968767ab77bdb.tar.xz |
fix vertex rounding direction
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Physics/UbitMeshing/Mesh.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs index 0476b28..b67422f 100644 --- a/OpenSim/Region/Physics/UbitMeshing/Mesh.cs +++ b/OpenSim/Region/Physics/UbitMeshing/Mesh.cs | |||
@@ -207,7 +207,14 @@ namespace OpenSim.Region.Physics.Meshing | |||
207 | 207 | ||
208 | private float fRound(float f) | 208 | private float fRound(float f) |
209 | { | 209 | { |
210 | int i = (int)(1e5f * f +0.5f); | 210 | int i; |
211 | if (f == 0f) | ||
212 | return f; | ||
213 | else if (f > 0f) | ||
214 | i = (int)(1e5f * f + 0.5f); | ||
215 | else | ||
216 | i = (int)(1e5f * f - 0.5f); | ||
217 | |||
211 | return ((float)i * 1e-5f); | 218 | return ((float)i * 1e-5f); |
212 | } | 219 | } |
213 | 220 | ||