diff options
author | Robert Adams | 2014-12-31 12:48:26 -0800 |
---|---|---|
committer | Robert Adams | 2014-12-31 12:48:26 -0800 |
commit | c89d0e26b2c098cd2c5679fb73987a742a66ce38 (patch) | |
tree | 0ee422a9563736aab47385a97a6420d70adc97da /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: Add axis locking enabled through the ExtendedPhysics module. (diff) | |
download | opensim-SC-c89d0e26b2c098cd2c5679fb73987a742a66ce38.zip opensim-SC-c89d0e26b2c098cd2c5679fb73987a742a66ce38.tar.gz opensim-SC-c89d0e26b2c098cd2c5679fb73987a742a66ce38.tar.bz2 opensim-SC-c89d0e26b2c098cd2c5679fb73987a742a66ce38.tar.xz |
BulletSim: add the beginnings of hull creation unit testing.
Change how physics engine is created in unit tests to resolve a lib reference problem.
Add ShapeInfoInfo class to collect info about the created physical shape
for debugging and unit test testing.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 414bc92..238fcc2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -947,6 +947,73 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
947 | } | 947 | } |
948 | #endregion // Extensions | 948 | #endregion // Extensions |
949 | 949 | ||
950 | public static string PrimitiveBaseShapeToString(PrimitiveBaseShape pbs) | ||
951 | { | ||
952 | float pathShearX = pbs.PathShearX < 128 ? (float)pbs.PathShearX * 0.01f : (float)(pbs.PathShearX - 256) * 0.01f; | ||
953 | float pathShearY = pbs.PathShearY < 128 ? (float)pbs.PathShearY * 0.01f : (float)(pbs.PathShearY - 256) * 0.01f; | ||
954 | float pathBegin = (float)pbs.PathBegin * 2.0e-5f; | ||
955 | float pathEnd = 1.0f - (float)pbs.PathEnd * 2.0e-5f; | ||
956 | float pathScaleX = (float)(pbs.PathScaleX - 100) * 0.01f; | ||
957 | float pathScaleY = (float)(pbs.PathScaleY - 100) * 0.01f; | ||
958 | |||
959 | float profileBegin = (float)pbs.ProfileBegin * 2.0e-5f; | ||
960 | float profileEnd = 1.0f - (float)pbs.ProfileEnd * 2.0e-5f; | ||
961 | float profileHollow = (float)pbs.ProfileHollow * 2.0e-5f; | ||
962 | if (profileHollow > 0.95f) | ||
963 | profileHollow = 0.95f; | ||
964 | |||
965 | StringBuilder buff = new StringBuilder(); | ||
966 | buff.Append("shape="); | ||
967 | buff.Append(((ProfileShape)pbs.ProfileShape).ToString()); | ||
968 | buff.Append(","); | ||
969 | buff.Append("hollow="); | ||
970 | buff.Append(((HollowShape)pbs.HollowShape).ToString()); | ||
971 | buff.Append(","); | ||
972 | buff.Append("pathCurve="); | ||
973 | buff.Append(((Extrusion)pbs.PathCurve).ToString()); | ||
974 | buff.Append(","); | ||
975 | buff.Append("profCurve="); | ||
976 | buff.Append(((Extrusion)pbs.ProfileCurve).ToString()); | ||
977 | buff.Append(","); | ||
978 | buff.Append("profHollow="); | ||
979 | buff.Append(profileHollow.ToString()); | ||
980 | buff.Append(","); | ||
981 | buff.Append("pathBegEnd="); | ||
982 | buff.Append(pathBegin.ToString()); | ||
983 | buff.Append("/"); | ||
984 | buff.Append(pathEnd.ToString()); | ||
985 | buff.Append(","); | ||
986 | buff.Append("profileBegEnd="); | ||
987 | buff.Append(profileBegin.ToString()); | ||
988 | buff.Append("/"); | ||
989 | buff.Append(profileEnd.ToString()); | ||
990 | buff.Append(","); | ||
991 | buff.Append("scaleXY="); | ||
992 | buff.Append(pathScaleX.ToString()); | ||
993 | buff.Append("/"); | ||
994 | buff.Append(pathScaleY.ToString()); | ||
995 | buff.Append(","); | ||
996 | buff.Append("shearXY="); | ||
997 | buff.Append(pathShearX.ToString()); | ||
998 | buff.Append("/"); | ||
999 | buff.Append(pathShearY.ToString()); | ||
1000 | buff.Append(","); | ||
1001 | buff.Append("taperXY="); | ||
1002 | buff.Append(pbs.PathTaperX.ToString()); | ||
1003 | buff.Append("/"); | ||
1004 | buff.Append(pbs.PathTaperY.ToString()); | ||
1005 | buff.Append(","); | ||
1006 | buff.Append("skew="); | ||
1007 | buff.Append(pbs.PathSkew.ToString()); | ||
1008 | buff.Append(","); | ||
1009 | buff.Append("twist/Beg="); | ||
1010 | buff.Append(pbs.PathTwist.ToString()); | ||
1011 | buff.Append("/"); | ||
1012 | buff.Append(pbs.PathTwistBegin.ToString()); | ||
1013 | |||
1014 | return buff.ToString(); | ||
1015 | } | ||
1016 | |||
950 | #region Taints | 1017 | #region Taints |
951 | // The simulation execution order is: | 1018 | // The simulation execution order is: |
952 | // Simulate() | 1019 | // Simulate() |