aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2015-01-25 13:24:09 -0800
committerRobert Adams2015-01-25 13:24:09 -0800
commitde7611662472ffcae3c18976037a87a384864308 (patch)
tree78fe350779030f4d145069f1e4423df4816b7482
parentRevert "In GetDisplayNames, if user last name is Resident then only send firs... (diff)
downloadopensim-SC_OLD-de7611662472ffcae3c18976037a87a384864308.zip
opensim-SC_OLD-de7611662472ffcae3c18976037a87a384864308.tar.gz
opensim-SC_OLD-de7611662472ffcae3c18976037a87a384864308.tar.bz2
opensim-SC_OLD-de7611662472ffcae3c18976037a87a384864308.tar.xz
BulletSim: add parameters and parameter definitions for VHACD
addition coming.
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs15
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs44
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapes.cs3
3 files changed, 61 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
index 0458cd9..8491c0f 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs
@@ -211,6 +211,21 @@ public struct HACDParams
211 public float addNeighboursDistPoints; // false 211 public float addNeighboursDistPoints; // false
212 public float addFacesPoints; // false 212 public float addFacesPoints; // false
213 public float shouldAdjustCollisionMargin; // false 213 public float shouldAdjustCollisionMargin; // false
214 // VHACD
215 public float whichHACD; // zero if Bullet HACD, non-zero says VHACD
216 // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html
217 public float vHACDresolution; // 100,000 max number of voxels generated during voxelization stage
218 public float vHACDdepth; // 20 max number of clipping stages
219 public float vHACDconcavity; // 0.0025 maximum concavity
220 public float vHACDplaneDownsampling; // 4 granularity of search for best clipping plane
221 public float vHACDconvexHullDownsampling; // 4 precision of hull gen process
222 public float vHACDalpha; // 0.05 bias toward clipping along symmetry planes
223 public float vHACDbeta; // 0.05 bias toward clipping along revolution axis
224 public float vHACDgamma; // 0.00125 max concavity when merging
225 public float vHACDpca; // 0 on/off normalizing mesh before decomp
226 public float vHACDmode; // 0 0:voxel based, 1: tetrahedron based
227 public float vHACDmaxNumVerticesPerCH; // 64 max triangles per convex hull
228 public float vHACDminVolumePerCH; // 0.0001 sampling of generated convex hulls
214} 229}
215 230
216// The states a bullet collision object can have 231// The states a bullet collision object can have
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index ef75e3f..6d46fe6 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -183,6 +183,7 @@ public static class BSParam
183 public static bool VehicleEnableAngularBanking { get; private set; } 183 public static bool VehicleEnableAngularBanking { get; private set; }
184 184
185 // Convex Hulls 185 // Convex Hulls
186 // Parameters for convex hull routine that ships with Bullet
186 public static int CSHullMaxDepthSplit { get; private set; } 187 public static int CSHullMaxDepthSplit { get; private set; }
187 public static int CSHullMaxDepthSplitForSimpleShapes { get; private set; } 188 public static int CSHullMaxDepthSplitForSimpleShapes { get; private set; }
188 public static float CSHullConcavityThresholdPercent { get; private set; } 189 public static float CSHullConcavityThresholdPercent { get; private set; }
@@ -198,6 +199,22 @@ public static class BSParam
198 public static bool BHullAddNeighboursDistPoints { get; private set; } // false 199 public static bool BHullAddNeighboursDistPoints { get; private set; } // false
199 public static bool BHullAddFacesPoints { get; private set; } // false 200 public static bool BHullAddFacesPoints { get; private set; } // false
200 public static bool BHullShouldAdjustCollisionMargin { get; private set; } // false 201 public static bool BHullShouldAdjustCollisionMargin { get; private set; } // false
202 public static float WhichHACD { get; private set; } // zero if Bullet HACD, non-zero says VHACD
203 // Parameters for VHACD 2.0: http://code.google.com/p/v-hacd
204 // To enable, set both ShouldUseBulletHACD=true and WhichHACD=1
205 // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html
206 public static float VHACDresolution { get; private set; } // 100,000 max number of voxels generated during voxelization stage
207 public static float VHACDdepth { get; private set; } // 20 max number of clipping stages
208 public static float VHACDconcavity { get; private set; } // 0.0025 maximum concavity
209 public static float VHACDplaneDownsampling { get; private set; } // 4 granularity of search for best clipping plane
210 public static float VHACDconvexHullDownsampling { get; private set; } // 4 precision of hull gen process
211 public static float VHACDalpha { get; private set; } // 0.05 bias toward clipping along symmetry planes
212 public static float VHACDbeta { get; private set; } // 0.05 bias toward clipping along revolution axis
213 public static float VHACDgamma { get; private set; } // 0.00125 max concavity when merging
214 public static float VHACDpca { get; private set; } // 0 on/off normalizing mesh before decomp
215 public static float VHACDmode { get; private set; } // 0 0:voxel based, 1: tetrahedron based
216 public static float VHACDmaxNumVerticesPerCH { get; private set; } // 64 max triangles per convex hull
217 public static float VHACDminVolumePerCH { get; private set; } // 0.0001 sampling of generated convex hulls
201 218
202 // Linkset implementation parameters 219 // Linkset implementation parameters
203 public static float LinksetImplementation { get; private set; } 220 public static float LinksetImplementation { get; private set; }
@@ -749,6 +766,33 @@ public static class BSParam
749 new ParameterDefn<bool>("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin", 766 new ParameterDefn<bool>("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin",
750 false ), 767 false ),
751 768
769 new ParameterDefn<float>("WhichHACD", "zero if Bullet HACD, non-zero says VHACD",
770 0f ),
771 new ParameterDefn<float>("VHACDresolution", "max number of voxels generated during voxelization stage",
772 100000f ),
773 new ParameterDefn<float>("VHACDdepth", "max number of clipping stages",
774 20f ),
775 new ParameterDefn<float>("VHACDconcavity", "maximum concavity",
776 0.0025f ),
777 new ParameterDefn<float>("VHACDplaneDownsampling", "granularity of search for best clipping plane",
778 4f ),
779 new ParameterDefn<float>("VHACDconvexHullDownsampling", "precision of hull gen process",
780 4f ),
781 new ParameterDefn<float>("VHACDalpha", "bias toward clipping along symmetry planes",
782 0.05f ),
783 new ParameterDefn<float>("VHACDbeta", "bias toward clipping along revolution axis",
784 0.05f ),
785 new ParameterDefn<float>("VHACDgamma", "max concavity when merging",
786 0.00125f ),
787 new ParameterDefn<float>("VHACDpca", "on/off normalizing mesh before decomp",
788 0f ),
789 new ParameterDefn<float>("VHACDmode", "0:voxel based, 1: tetrahedron based",
790 0f ),
791 new ParameterDefn<float>("VHACDmaxNumVerticesPerCH", "max triangles per convex hull",
792 64f ),
793 new ParameterDefn<float>("VHACDminVolumePerCH", "sampling of generated convex hulls",
794 0.0001f ),
795
752 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", 796 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)",
753 (float)BSLinkset.LinksetImplementation.Compound ), 797 (float)BSLinkset.LinksetImplementation.Compound ),
754 new ParameterDefn<bool>("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same", 798 new ParameterDefn<bool>("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same",
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
index aa04726..86d86cb 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs
@@ -782,7 +782,7 @@ public class BSShapeHull : BSShape
782 782
783 if (meshShape.physShapeInfo.HasPhysicalShape) 783 if (meshShape.physShapeInfo.HasPhysicalShape)
784 { 784 {
785 HACDParams parms; 785 HACDParams parms = new HACDParams();
786 parms.maxVerticesPerHull = BSParam.BHullMaxVerticesPerHull; 786 parms.maxVerticesPerHull = BSParam.BHullMaxVerticesPerHull;
787 parms.minClusters = BSParam.BHullMinClusters; 787 parms.minClusters = BSParam.BHullMinClusters;
788 parms.compacityWeight = BSParam.BHullCompacityWeight; 788 parms.compacityWeight = BSParam.BHullCompacityWeight;
@@ -792,6 +792,7 @@ public class BSShapeHull : BSShape
792 parms.addNeighboursDistPoints = BSParam.NumericBool(BSParam.BHullAddNeighboursDistPoints); 792 parms.addNeighboursDistPoints = BSParam.NumericBool(BSParam.BHullAddNeighboursDistPoints);
793 parms.addFacesPoints = BSParam.NumericBool(BSParam.BHullAddFacesPoints); 793 parms.addFacesPoints = BSParam.NumericBool(BSParam.BHullAddFacesPoints);
794 parms.shouldAdjustCollisionMargin = BSParam.NumericBool(BSParam.BHullShouldAdjustCollisionMargin); 794 parms.shouldAdjustCollisionMargin = BSParam.NumericBool(BSParam.BHullShouldAdjustCollisionMargin);
795 parms.whichHACD = 0; // Use the HACD routine that comes with Bullet
795 796
796 physicsScene.DetailLog("{0},BSShapeHull.CreatePhysicalHull,hullFromMesh,beforeCall", prim.LocalID, newShape.HasPhysicalShape); 797 physicsScene.DetailLog("{0},BSShapeHull.CreatePhysicalHull,hullFromMesh,beforeCall", prim.LocalID, newShape.HasPhysicalShape);
797 newShape = physicsScene.PE.BuildHullShapeFromMesh(physicsScene.World, meshShape.physShapeInfo, parms); 798 newShape = physicsScene.PE.BuildHullShapeFromMesh(physicsScene.World, meshShape.physShapeInfo, parms);