diff options
author | UbitUmarov | 2018-01-14 01:40:49 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-14 01:40:49 +0000 |
commit | 3d87e37d99b0db26847e079f5b1da3ac82412ddc (patch) | |
tree | 18919f5348ea877ab3befb7946fb58ef65403e39 /OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | |
parent | make ubOde PInvoke follow ms coding rules (diff) | |
download | opensim-SC-3d87e37d99b0db26847e079f5b1da3ac82412ddc.zip opensim-SC-3d87e37d99b0db26847e079f5b1da3ac82412ddc.tar.gz opensim-SC-3d87e37d99b0db26847e079f5b1da3ac82412ddc.tar.bz2 opensim-SC-3d87e37d99b0db26847e079f5b1da3ac82412ddc.tar.xz |
make old Ode PInvoke follow ms coding rules
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs index 78dd7de..c731c6c 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs | |||
@@ -61,12 +61,12 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
61 | /// <summary> | 61 | /// <summary> |
62 | /// ODE contact array to be filled by the collision testing | 62 | /// ODE contact array to be filled by the collision testing |
63 | /// </summary> | 63 | /// </summary> |
64 | d.ContactGeom[] contacts = new d.ContactGeom[5]; | 64 | SafeNativeMethods.ContactGeom[] contacts = new SafeNativeMethods.ContactGeom[5]; |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// ODE near callback delegate | 67 | /// ODE near callback delegate |
68 | /// </summary> | 68 | /// </summary> |
69 | private d.NearCallback nearCallback; | 69 | private SafeNativeMethods.NearCallback nearCallback; |
70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
71 | private List<ContactResult> m_contactResults = new List<ContactResult>(); | 71 | private List<ContactResult> m_contactResults = new List<ContactResult>(); |
72 | 72 | ||
@@ -179,14 +179,14 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
179 | len = 100f; | 179 | len = 100f; |
180 | 180 | ||
181 | // Create the ray | 181 | // Create the ray |
182 | IntPtr ray = d.CreateRay(m_scene.space, len); | 182 | IntPtr ray = SafeNativeMethods.CreateRay(m_scene.space, len); |
183 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 183 | SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
184 | 184 | ||
185 | // Collide test | 185 | // Collide test |
186 | d.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); | 186 | SafeNativeMethods.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); |
187 | 187 | ||
188 | // Remove Ray | 188 | // Remove Ray |
189 | d.GeomDestroy(ray); | 189 | SafeNativeMethods.GeomDestroy(ray); |
190 | 190 | ||
191 | // Define default results | 191 | // Define default results |
192 | bool hitYN = false; | 192 | bool hitYN = false; |
@@ -230,14 +230,14 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
230 | len = 100f; | 230 | len = 100f; |
231 | 231 | ||
232 | // Create the ray | 232 | // Create the ray |
233 | IntPtr ray = d.CreateRay(m_scene.space, len); | 233 | IntPtr ray = SafeNativeMethods.CreateRay(m_scene.space, len); |
234 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 234 | SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
235 | 235 | ||
236 | // Collide test | 236 | // Collide test |
237 | d.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); | 237 | SafeNativeMethods.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); |
238 | 238 | ||
239 | // Remove Ray | 239 | // Remove Ray |
240 | d.GeomDestroy(ray); | 240 | SafeNativeMethods.GeomDestroy(ray); |
241 | 241 | ||
242 | // Find closest contact and object. | 242 | // Find closest contact and object. |
243 | lock (m_contactResults) | 243 | lock (m_contactResults) |
@@ -258,7 +258,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
258 | // return; | 258 | // return; |
259 | 259 | ||
260 | // Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms. | 260 | // Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms. |
261 | if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2)) | 261 | if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) |
262 | { | 262 | { |
263 | if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) | 263 | if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) |
264 | return; | 264 | return; |
@@ -269,7 +269,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
269 | // contact points in the space | 269 | // contact points in the space |
270 | try | 270 | try |
271 | { | 271 | { |
272 | d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); | 272 | SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); |
273 | } | 273 | } |
274 | catch (AccessViolationException) | 274 | catch (AccessViolationException) |
275 | { | 275 | { |
@@ -296,7 +296,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
296 | 296 | ||
297 | lock (contacts) | 297 | lock (contacts) |
298 | { | 298 | { |
299 | count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.unmanagedSizeOf); | 299 | count = SafeNativeMethods.Collide(g1, g2, contacts.GetLength(0), contacts, SafeNativeMethods.ContactGeom.unmanagedSizeOf); |
300 | } | 300 | } |
301 | } | 301 | } |
302 | catch (SEHException) | 302 | catch (SEHException) |