diff options
author | Robert Adams | 2013-04-01 11:10:05 -0700 |
---|---|---|
committer | Robert Adams | 2013-04-01 18:03:11 -0700 |
commit | 17aef1c883aa81edba9a272e0a6897ad9a3a3983 (patch) | |
tree | a95cf076a3d62a64a8d4e8d4998b8af638e77e3a /OpenSim/Region | |
parent | BulletSim: rearrange mega-region terrain code to make the thread flow (diff) | |
download | opensim-SC_OLD-17aef1c883aa81edba9a272e0a6897ad9a3a3983.zip opensim-SC_OLD-17aef1c883aa81edba9a272e0a6897ad9a3a3983.tar.gz opensim-SC_OLD-17aef1c883aa81edba9a272e0a6897ad9a3a3983.tar.bz2 opensim-SC_OLD-17aef1c883aa81edba9a272e0a6897ad9a3a3983.tar.xz |
BulletSim: update unmanaged API for HACD parameter passing. Bullet HACD
mesh to hull conversion calls in place but code not working. Update
BulletSim DLLs and SOs for new API and HACD code.
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | 6 | ||||
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs | 17 |
3 files changed, 20 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs index 77ea3ed..f5b84d4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |||
@@ -259,12 +259,12 @@ public override BulletShape CreateHullShape(BulletWorld world, int hullCount, fl | |||
259 | BSPhysicsShapeType.SHAPE_HULL); | 259 | BSPhysicsShapeType.SHAPE_HULL); |
260 | } | 260 | } |
261 | 261 | ||
262 | public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape) | 262 | public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms) |
263 | { | 263 | { |
264 | BulletWorldUnman worldu = world as BulletWorldUnman; | 264 | BulletWorldUnman worldu = world as BulletWorldUnman; |
265 | BulletShapeUnman shapeu = meshShape as BulletShapeUnman; | 265 | BulletShapeUnman shapeu = meshShape as BulletShapeUnman; |
266 | return new BulletShapeUnman( | 266 | return new BulletShapeUnman( |
267 | BSAPICPP.BuildHullShapeFromMesh2(worldu.ptr, shapeu.ptr), | 267 | BSAPICPP.BuildHullShapeFromMesh2(worldu.ptr, shapeu.ptr, parms), |
268 | BSPhysicsShapeType.SHAPE_HULL); | 268 | BSPhysicsShapeType.SHAPE_HULL); |
269 | } | 269 | } |
270 | 270 | ||
@@ -1411,7 +1411,7 @@ public static extern IntPtr CreateHullShape2(IntPtr world, | |||
1411 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | 1411 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); |
1412 | 1412 | ||
1413 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1413 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1414 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); | 1414 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape, HACDParams parms); |
1415 | 1415 | ||
1416 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 1416 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
1417 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); | 1417 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs index 6fc10e9..f6b4359 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | |||
@@ -1773,10 +1773,9 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
1773 | return new BulletShapeXNA(compoundshape, BSPhysicsShapeType.SHAPE_HULL); | 1773 | return new BulletShapeXNA(compoundshape, BSPhysicsShapeType.SHAPE_HULL); |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape) | 1776 | public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms) |
1777 | { | 1777 | { |
1778 | /* TODO */ return null; | 1778 | /* TODO */ return null; |
1779 | |||
1780 | } | 1779 | } |
1781 | 1780 | ||
1782 | public override BulletShape CreateMeshShape(BulletWorld pWorld, int pIndicesCount, int[] indices, int pVerticesCount, float[] verticesAsFloats) | 1781 | public override BulletShape CreateMeshShape(BulletWorld pWorld, int pIndicesCount, int[] indices, int pVerticesCount, float[] verticesAsFloats) |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs index 5765b0d..d0d9f34 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs | |||
@@ -191,6 +191,21 @@ public struct ConfigurationParameters | |||
191 | public const float numericFalse = 0f; | 191 | public const float numericFalse = 0f; |
192 | } | 192 | } |
193 | 193 | ||
194 | // Parameters passed for the conversion of a mesh to a hull using Bullet's HACD library. | ||
195 | [StructLayout(LayoutKind.Sequential)] | ||
196 | public struct HACDParams | ||
197 | { | ||
198 | // usual default values | ||
199 | public float maxVerticesPerHull; // 100 | ||
200 | public float minClusters; // 2 | ||
201 | public float compacityWeight; // 0.1 | ||
202 | public float volumeWeight; // 0.0 | ||
203 | public float concavity; // 100 | ||
204 | public float addExtraDistPoints; // false | ||
205 | public float addNeighboursDistPoints; // false | ||
206 | public float addFacesPoints; // false | ||
207 | public float shouldAdjustCollisionMargin; // false | ||
208 | } | ||
194 | 209 | ||
195 | // The states a bullet collision object can have | 210 | // The states a bullet collision object can have |
196 | public enum ActivationState : uint | 211 | public enum ActivationState : uint |
@@ -308,7 +323,7 @@ public abstract BulletShape CreateMeshShape(BulletWorld world, | |||
308 | public abstract BulletShape CreateHullShape(BulletWorld world, | 323 | public abstract BulletShape CreateHullShape(BulletWorld world, |
309 | int hullCount, float[] hulls); | 324 | int hullCount, float[] hulls); |
310 | 325 | ||
311 | public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape); | 326 | public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms); |
312 | 327 | ||
313 | public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData); | 328 | public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData); |
314 | 329 | ||