From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../Region/PhysicsModules/BulletS/BSAPIUnman.cs | 8 +- OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs | 310 ++++++++++----------- .../PhysicsModules/BulletS/BSActorMoveToTarget.cs | 2 +- .../Region/PhysicsModules/BulletS/BSApiTemplate.cs | 120 ++++---- .../Region/PhysicsModules/BulletS/BSCharacter.cs | 10 +- .../Region/PhysicsModules/BulletS/BSDynamics.cs | 6 +- OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs | 2 +- OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | 210 +++++++------- .../Region/PhysicsModules/BulletS/BSPhysObject.cs | 6 +- OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs | 8 +- OpenSim/Region/PhysicsModules/BulletS/BSScene.cs | 10 +- .../PhysicsModules/BulletS/ExtendedPhysics.cs | 2 +- .../BulletS/Properties/AssemblyInfo.cs | 8 +- .../BulletS/Tests/BulletSimTestsUtil.cs | 2 +- .../PhysicsModules/BulletS/Tests/HullCreation.cs | 2 +- 15 files changed, 353 insertions(+), 353 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/BulletS') diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs b/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs index c4a923c..42db7fe 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSAPIUnman.cs @@ -155,8 +155,8 @@ public BSAPIUnman(string paramName, BSScene physScene) // Initialization and simulation public override BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms, - int maxCollisions, ref CollisionDesc[] collisionArray, - int maxUpdates, ref EntityProperties[] updateArray + int maxCollisions, ref CollisionDesc[] collisionArray, + int maxUpdates, ref EntityProperties[] updateArray ) { // Pin down the memory that will be used to pass object collisions and updates back from unmanaged code @@ -1472,8 +1472,8 @@ public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg // Initialization and simulation [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms, - int maxCollisions, IntPtr collisionArray, - int maxUpdates, IntPtr updateArray, + int maxCollisions, IntPtr collisionArray, + int maxUpdates, IntPtr updateArray, DebugLogCallback logRoutine); [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs b/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs index 887311d..37017b0 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSAPIXNA.cs @@ -815,161 +815,161 @@ private sealed class BulletConstraintXNA : BulletConstraint public override bool SliderSetLimits(BulletConstraint pConstraint, int lowerUpper, int linAng, float val) { SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; - switch (lowerUpper) - { - case SLIDER_LOWER_LIMIT: - switch (linAng) - { - case SLIDER_LINEAR: - constraint.SetLowerLinLimit(val); - break; - case SLIDER_ANGULAR: - constraint.SetLowerAngLimit(val); - break; - } - break; - case SLIDER_UPPER_LIMIT: - switch (linAng) - { - case SLIDER_LINEAR: - constraint.SetUpperLinLimit(val); - break; - case SLIDER_ANGULAR: - constraint.SetUpperAngLimit(val); - break; - } - break; - } + switch (lowerUpper) + { + case SLIDER_LOWER_LIMIT: + switch (linAng) + { + case SLIDER_LINEAR: + constraint.SetLowerLinLimit(val); + break; + case SLIDER_ANGULAR: + constraint.SetLowerAngLimit(val); + break; + } + break; + case SLIDER_UPPER_LIMIT: + switch (linAng) + { + case SLIDER_LINEAR: + constraint.SetUpperLinLimit(val); + break; + case SLIDER_ANGULAR: + constraint.SetUpperAngLimit(val); + break; + } + break; + } return true; } public override bool SliderSet(BulletConstraint pConstraint, int softRestDamp, int dirLimOrtho, int linAng, float val) { SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; - switch (softRestDamp) - { - case SLIDER_SET_SOFTNESS: - switch (dirLimOrtho) - { - case SLIDER_SET_DIRECTION: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetSoftnessDirLin(val); break; - case SLIDER_ANGULAR: constraint.SetSoftnessDirAng(val); break; - } - break; - case SLIDER_SET_LIMIT: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetSoftnessLimLin(val); break; - case SLIDER_ANGULAR: constraint.SetSoftnessLimAng(val); break; - } - break; - case SLIDER_SET_ORTHO: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetSoftnessOrthoLin(val); break; - case SLIDER_ANGULAR: constraint.SetSoftnessOrthoAng(val); break; - } - break; - } - break; - case SLIDER_SET_RESTITUTION: - switch (dirLimOrtho) - { - case SLIDER_SET_DIRECTION: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetRestitutionDirLin(val); break; - case SLIDER_ANGULAR: constraint.SetRestitutionDirAng(val); break; - } - break; - case SLIDER_SET_LIMIT: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetRestitutionLimLin(val); break; - case SLIDER_ANGULAR: constraint.SetRestitutionLimAng(val); break; - } - break; - case SLIDER_SET_ORTHO: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetRestitutionOrthoLin(val); break; - case SLIDER_ANGULAR: constraint.SetRestitutionOrthoAng(val); break; - } - break; - } - break; - case SLIDER_SET_DAMPING: - switch (dirLimOrtho) - { - case SLIDER_SET_DIRECTION: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetDampingDirLin(val); break; - case SLIDER_ANGULAR: constraint.SetDampingDirAng(val); break; - } - break; - case SLIDER_SET_LIMIT: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetDampingLimLin(val); break; - case SLIDER_ANGULAR: constraint.SetDampingLimAng(val); break; - } - break; - case SLIDER_SET_ORTHO: - switch (linAng) - { - case SLIDER_LINEAR: constraint.SetDampingOrthoLin(val); break; - case SLIDER_ANGULAR: constraint.SetDampingOrthoAng(val); break; - } - break; - } - break; - } + switch (softRestDamp) + { + case SLIDER_SET_SOFTNESS: + switch (dirLimOrtho) + { + case SLIDER_SET_DIRECTION: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetSoftnessDirLin(val); break; + case SLIDER_ANGULAR: constraint.SetSoftnessDirAng(val); break; + } + break; + case SLIDER_SET_LIMIT: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetSoftnessLimLin(val); break; + case SLIDER_ANGULAR: constraint.SetSoftnessLimAng(val); break; + } + break; + case SLIDER_SET_ORTHO: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetSoftnessOrthoLin(val); break; + case SLIDER_ANGULAR: constraint.SetSoftnessOrthoAng(val); break; + } + break; + } + break; + case SLIDER_SET_RESTITUTION: + switch (dirLimOrtho) + { + case SLIDER_SET_DIRECTION: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetRestitutionDirLin(val); break; + case SLIDER_ANGULAR: constraint.SetRestitutionDirAng(val); break; + } + break; + case SLIDER_SET_LIMIT: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetRestitutionLimLin(val); break; + case SLIDER_ANGULAR: constraint.SetRestitutionLimAng(val); break; + } + break; + case SLIDER_SET_ORTHO: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetRestitutionOrthoLin(val); break; + case SLIDER_ANGULAR: constraint.SetRestitutionOrthoAng(val); break; + } + break; + } + break; + case SLIDER_SET_DAMPING: + switch (dirLimOrtho) + { + case SLIDER_SET_DIRECTION: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetDampingDirLin(val); break; + case SLIDER_ANGULAR: constraint.SetDampingDirAng(val); break; + } + break; + case SLIDER_SET_LIMIT: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetDampingLimLin(val); break; + case SLIDER_ANGULAR: constraint.SetDampingLimAng(val); break; + } + break; + case SLIDER_SET_ORTHO: + switch (linAng) + { + case SLIDER_LINEAR: constraint.SetDampingOrthoLin(val); break; + case SLIDER_ANGULAR: constraint.SetDampingOrthoAng(val); break; + } + break; + } + break; + } return true; } public override bool SliderMotorEnable(BulletConstraint pConstraint, int linAng, float numericTrueFalse) { SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; - switch (linAng) - { - case SLIDER_LINEAR: - constraint.SetPoweredLinMotor(numericTrueFalse == 0.0 ? false : true); - break; - case SLIDER_ANGULAR: - constraint.SetPoweredAngMotor(numericTrueFalse == 0.0 ? false : true); - break; - } + switch (linAng) + { + case SLIDER_LINEAR: + constraint.SetPoweredLinMotor(numericTrueFalse == 0.0 ? false : true); + break; + case SLIDER_ANGULAR: + constraint.SetPoweredAngMotor(numericTrueFalse == 0.0 ? false : true); + break; + } return true; } public override bool SliderMotor(BulletConstraint pConstraint, int forceVel, int linAng, float val) { SliderConstraint constraint = (pConstraint as BulletConstraintXNA).constrain as SliderConstraint; - switch (forceVel) - { - case SLIDER_MOTOR_VELOCITY: - switch (linAng) - { - case SLIDER_LINEAR: - constraint.SetTargetLinMotorVelocity(val); - break; - case SLIDER_ANGULAR: - constraint.SetTargetAngMotorVelocity(val); - break; - } - break; - case SLIDER_MAX_MOTOR_FORCE: - switch (linAng) - { - case SLIDER_LINEAR: - constraint.SetMaxLinMotorForce(val); - break; - case SLIDER_ANGULAR: - constraint.SetMaxAngMotorForce(val); - break; - } - break; - } + switch (forceVel) + { + case SLIDER_MOTOR_VELOCITY: + switch (linAng) + { + case SLIDER_LINEAR: + constraint.SetTargetLinMotorVelocity(val); + break; + case SLIDER_ANGULAR: + constraint.SetTargetAngMotorVelocity(val); + break; + } + break; + case SLIDER_MAX_MOTOR_FORCE: + switch (linAng) + { + case SLIDER_LINEAR: + constraint.SetMaxLinMotorForce(val); + break; + case SLIDER_ANGULAR: + constraint.SetMaxAngMotorForce(val); + break; + } + break; + } return true; } @@ -1197,20 +1197,20 @@ private sealed class BulletConstraintXNA : BulletConstraint }; /* m_mass = mass; - m_motionState =motionState; - m_collisionShape = collisionShape; - m_localInertia = localInertia; - m_linearDamping = 0f; - m_angularDamping = 0f; - m_friction = 0.5f; - m_restitution = 0f; - m_linearSleepingThreshold = 0.8f; - m_angularSleepingThreshold = 1f; - m_additionalDamping = false; - m_additionalDampingFactor = 0.005f; - m_additionalLinearDampingThresholdSqr = 0.01f; - m_additionalAngularDampingThresholdSqr = 0.01f; - m_additionalAngularDampingFactor = 0.01f; + m_motionState =motionState; + m_collisionShape = collisionShape; + m_localInertia = localInertia; + m_linearDamping = 0f; + m_angularDamping = 0f; + m_friction = 0.5f; + m_restitution = 0f; + m_linearSleepingThreshold = 0.8f; + m_angularSleepingThreshold = 1f; + m_additionalDamping = false; + m_additionalDampingFactor = 0.005f; + m_additionalLinearDampingThresholdSqr = 0.01f; + m_additionalAngularDampingThresholdSqr = 0.01f; + m_additionalAngularDampingFactor = 0.01f; m_startWorldTransform = IndexedMatrix.Identity; */ body.SetUserPointer(pLocalID); @@ -2172,7 +2172,7 @@ private sealed class BulletConstraintXNA : BulletConstraint } public override BulletShape CreateTerrainShape(uint id, Vector3 size, float minHeight, float maxHeight, float[] heightMap, - float scaleFactor, float collisionMargin) + float scaleFactor, float collisionMargin) { const int upAxis = 2; HeightfieldTerrainShape terrainShape = new HeightfieldTerrainShape((int)size.X, (int)size.Y, diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs index 87cf972..f2019ae 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs @@ -205,7 +205,7 @@ public class BSActorMoveToTarget : BSActor addedForce = correctionVector / timeStep; // Remove the existing velocity (only the moveToTarget force counts) addedForce -= m_controllingPrim.RawVelocity; - // Overcome gravity. + // Overcome gravity. addedForce -= m_controllingPrim.Gravity; // Add enough force to overcome the mass of the object diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs index 7756b10..816189f 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs @@ -36,16 +36,16 @@ namespace OpenSim.Region.PhysicsModule.BulletS { // Constraint type values as defined by Bullet public enum ConstraintType : int { - POINT2POINT_CONSTRAINT_TYPE = 3, - HINGE_CONSTRAINT_TYPE, - CONETWIST_CONSTRAINT_TYPE, - D6_CONSTRAINT_TYPE, - SLIDER_CONSTRAINT_TYPE, - CONTACT_CONSTRAINT_TYPE, - D6_SPRING_CONSTRAINT_TYPE, - GEAR_CONSTRAINT_TYPE, // added in Bullet 2.82 - FIXED_CONSTRAINT_TYPE, // added in Bullet 2.82 - MAX_CONSTRAINT_TYPE, // last type defined by Bullet + POINT2POINT_CONSTRAINT_TYPE = 3, + HINGE_CONSTRAINT_TYPE, + CONETWIST_CONSTRAINT_TYPE, + D6_CONSTRAINT_TYPE, + SLIDER_CONSTRAINT_TYPE, + CONTACT_CONSTRAINT_TYPE, + D6_SPRING_CONSTRAINT_TYPE, + GEAR_CONSTRAINT_TYPE, // added in Bullet 2.82 + FIXED_CONSTRAINT_TYPE, // added in Bullet 2.82 + MAX_CONSTRAINT_TYPE, // last type defined by Bullet // BS_FIXED_CONSTRAINT_TYPE = 1234 // BulletSim constraint that is fixed and unmoving } @@ -54,25 +54,25 @@ public enum ConstraintType : int [StructLayout(LayoutKind.Sequential)] public struct ConvexHull { - Vector3 Offset; - int VertexCount; - Vector3[] Vertices; + Vector3 Offset; + int VertexCount; + Vector3[] Vertices; } public enum BSPhysicsShapeType { - SHAPE_UNKNOWN = 0, - SHAPE_CAPSULE = 1, - SHAPE_BOX = 2, - SHAPE_CONE = 3, - SHAPE_CYLINDER = 4, - SHAPE_SPHERE = 5, - SHAPE_MESH = 6, - SHAPE_HULL = 7, + SHAPE_UNKNOWN = 0, + SHAPE_CAPSULE = 1, + SHAPE_BOX = 2, + SHAPE_CONE = 3, + SHAPE_CYLINDER = 4, + SHAPE_SPHERE = 5, + SHAPE_MESH = 6, + SHAPE_HULL = 7, // following defined by BulletSim - SHAPE_GROUNDPLANE = 20, - SHAPE_TERRAIN = 21, - SHAPE_COMPOUND = 22, - SHAPE_HEIGHTMAP = 23, + SHAPE_GROUNDPLANE = 20, + SHAPE_TERRAIN = 21, + SHAPE_COMPOUND = 22, + SHAPE_HEIGHTMAP = 23, SHAPE_AVATAR = 24, SHAPE_CONVEXHULL= 25, SHAPE_GIMPACT = 26, @@ -180,16 +180,16 @@ public struct ConfigurationParameters public float collisionMargin; public float gravity; - public float maxPersistantManifoldPoolSize; - public float maxCollisionAlgorithmPoolSize; - public float shouldDisableContactPoolDynamicAllocation; - public float shouldForceUpdateAllAabbs; - public float shouldRandomizeSolverOrder; - public float shouldSplitSimulationIslands; - public float shouldEnableFrictionCaching; - public float numberOfSolverIterations; + public float maxPersistantManifoldPoolSize; + public float maxCollisionAlgorithmPoolSize; + public float shouldDisableContactPoolDynamicAllocation; + public float shouldForceUpdateAllAabbs; + public float shouldRandomizeSolverOrder; + public float shouldSplitSimulationIslands; + public float shouldEnableFrictionCaching; + public float numberOfSolverIterations; public float useSingleSidedMeshes; - public float globalContactBreakingThreshold; + public float globalContactBreakingThreshold; public float physicsLoggingFrames; @@ -202,30 +202,30 @@ public struct ConfigurationParameters public struct HACDParams { // usual default values - public float maxVerticesPerHull; // 100 - public float minClusters; // 2 - public float compacityWeight; // 0.1 - public float volumeWeight; // 0.0 - public float concavity; // 100 - public float addExtraDistPoints; // false - public float addNeighboursDistPoints; // false - public float addFacesPoints; // false - public float shouldAdjustCollisionMargin; // false + public float maxVerticesPerHull; // 100 + public float minClusters; // 2 + public float compacityWeight; // 0.1 + public float volumeWeight; // 0.0 + public float concavity; // 100 + public float addExtraDistPoints; // false + public float addNeighboursDistPoints; // false + public float addFacesPoints; // false + public float shouldAdjustCollisionMargin; // false // VHACD - public float whichHACD; // zero if Bullet HACD, non-zero says VHACD - // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html - public float vHACDresolution; // 100,000 max number of voxels generated during voxelization stage - public float vHACDdepth; // 20 max number of clipping stages - public float vHACDconcavity; // 0.0025 maximum concavity - public float vHACDplaneDownsampling; // 4 granularity of search for best clipping plane - public float vHACDconvexHullDownsampling; // 4 precision of hull gen process - public float vHACDalpha; // 0.05 bias toward clipping along symmetry planes - public float vHACDbeta; // 0.05 bias toward clipping along revolution axis - public float vHACDgamma; // 0.00125 max concavity when merging - public float vHACDpca; // 0 on/off normalizing mesh before decomp - public float vHACDmode; // 0 0:voxel based, 1: tetrahedron based - public float vHACDmaxNumVerticesPerCH; // 64 max triangles per convex hull - public float vHACDminVolumePerCH; // 0.0001 sampling of generated convex hulls + public float whichHACD; // zero if Bullet HACD, non-zero says VHACD + // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html + public float vHACDresolution; // 100,000 max number of voxels generated during voxelization stage + public float vHACDdepth; // 20 max number of clipping stages + public float vHACDconcavity; // 0.0025 maximum concavity + public float vHACDplaneDownsampling; // 4 granularity of search for best clipping plane + public float vHACDconvexHullDownsampling; // 4 precision of hull gen process + public float vHACDalpha; // 0.05 bias toward clipping along symmetry planes + public float vHACDbeta; // 0.05 bias toward clipping along revolution axis + public float vHACDgamma; // 0.00125 max concavity when merging + public float vHACDpca; // 0 on/off normalizing mesh before decomp + public float vHACDmode; // 0 0:voxel based, 1: tetrahedron based + public float vHACDmaxNumVerticesPerCH; // 64 max triangles per convex hull + public float vHACDminVolumePerCH; // 0.0001 sampling of generated convex hulls } // The states a bullet collision object can have @@ -322,8 +322,8 @@ public abstract string BulletEngineVersion { get; protected set;} // Initialization and simulation public abstract BulletWorld Initialize(Vector3 maxPosition, ConfigurationParameters parms, - int maxCollisions, ref CollisionDesc[] collisionArray, - int maxUpdates, ref EntityProperties[] updateArray + int maxCollisions, ref CollisionDesc[] collisionArray, + int maxUpdates, ref EntityProperties[] updateArray ); public abstract int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, @@ -398,7 +398,7 @@ public abstract void DestroyObject(BulletWorld sim, BulletBody obj); public abstract BulletShape CreateGroundPlaneShape(UInt32 id, float height, float collisionMargin); public abstract BulletShape CreateTerrainShape(UInt32 id, Vector3 size, float minHeight, float maxHeight, float[] heightMap, - float scaleFactor, float collisionMargin); + float scaleFactor, float collisionMargin); // ===================================================================================== // Constraint creation and helper routines diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 6322695..57f03fb 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs @@ -64,9 +64,9 @@ public sealed class BSCharacter : BSPhysObject private OMV.Vector3 _PIDTarget; private float _PIDTau; -// public override OMV.Vector3 RawVelocity -// { get { return base.RawVelocity; } -// set { +// public override OMV.Vector3 RawVelocity +// { get { return base.RawVelocity; } +// set { // if (value != base.RawVelocity) // Util.PrintCallStack(); // Console.WriteLine("Set rawvel to {0}", value); @@ -82,7 +82,7 @@ public sealed class BSCharacter : BSPhysObject : base(parent_scene, localID, avName, "BSCharacter") { _physicsActorType = (int)ActorTypes.Agent; - RawPosition = pos; + RawPosition = pos; _flying = isFlying; RawOrientation = OMV.Quaternion.Identity; @@ -819,7 +819,7 @@ public sealed class BSCharacter : BSPhysObject // 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many // extra updates. // - // XXX: Contrary to the above comment, setting an update threshold here above 0.4 actually introduces jitter to + // XXX: Contrary to the above comment, setting an update threshold here above 0.4 actually introduces jitter to // avatar movement rather than removes it. The larger the threshold, the bigger the jitter. // This is most noticeable in level flight and can be seen with // the "show updates" option in a viewer. With an update threshold, the RawVelocity cycles between a lower diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs index 313c961..c4ccdbe 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs @@ -125,8 +125,8 @@ namespace OpenSim.Region.PhysicsModule.BulletS // Just some recomputed constants: #pragma warning disable 414 - static readonly float TwoPI = ((float)Math.PI) * 2f; - static readonly float FourPI = ((float)Math.PI) * 4f; + static readonly float TwoPI = ((float)Math.PI) * 2f; + static readonly float FourPI = ((float)Math.PI) * 4f; static readonly float PIOverFour = ((float)Math.PI) / 4f; static readonly float PIOverTwo = ((float)Math.PI) / 2f; #pragma warning restore 414 @@ -1595,7 +1595,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS // in that direction. // TODO: implement reference frame. public void ComputeAngularDeflection() - { + { if (BSParam.VehicleEnableAngularDeflection && m_angularDeflectionEfficiency != 0 && VehicleForwardSpeed > 0.2) { diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs b/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs index e73f0e8..13c1361 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSLinkset.cs @@ -319,7 +319,7 @@ public abstract class BSLinkset public virtual bool AllPartsComplete { get { - bool ret = true; + bool ret = true; this.ForEachMember((member) => { if ((!member.IsInitialized) || member.IsIncomplete || member.PrimAssetState == BSPhysObject.PrimAssetCondition.Waiting) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs index 28df2d9..352c03e 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs @@ -90,8 +90,8 @@ public static class BSParam public static float DeactivationTime { get; private set; } public static float LinearSleepingThreshold { get; private set; } public static float AngularSleepingThreshold { get; private set; } - public static float CcdMotionThreshold { get; private set; } - public static float CcdSweptSphereRadius { get; private set; } + public static float CcdMotionThreshold { get; private set; } + public static float CcdSweptSphereRadius { get; private set; } public static float ContactProcessingThreshold { get; private set; } public static bool ShouldMeshSculptedPrim { get; private set; } // cause scuplted prims to get meshed @@ -119,14 +119,14 @@ public static class BSParam public static float Gravity { get; private set; } // Physics Engine operation - public static float MaxPersistantManifoldPoolSize { get; private set; } - public static float MaxCollisionAlgorithmPoolSize { get; private set; } - public static bool ShouldDisableContactPoolDynamicAllocation { get; private set; } - public static bool ShouldForceUpdateAllAabbs { get; private set; } - public static bool ShouldRandomizeSolverOrder { get; private set; } - public static bool ShouldSplitSimulationIslands { get; private set; } - public static bool ShouldEnableFrictionCaching { get; private set; } - public static float NumberOfSolverIterations { get; private set; } + public static float MaxPersistantManifoldPoolSize { get; private set; } + public static float MaxCollisionAlgorithmPoolSize { get; private set; } + public static bool ShouldDisableContactPoolDynamicAllocation { get; private set; } + public static bool ShouldForceUpdateAllAabbs { get; private set; } + public static bool ShouldRandomizeSolverOrder { get; private set; } + public static bool ShouldSplitSimulationIslands { get; private set; } + public static bool ShouldEnableFrictionCaching { get; private set; } + public static float NumberOfSolverIterations { get; private set; } public static bool UseSingleSidedMeshes { get; private set; } public static float GlobalContactBreakingThreshold { get; private set; } public static float PhysicsUnmanLoggingFrames { get; private set; } @@ -149,19 +149,19 @@ public static class BSParam public static float AvatarFlyingGroundMargin { get; private set; } public static float AvatarFlyingGroundUpForce { get; private set; } public static float AvatarTerminalVelocity { get; private set; } - public static float AvatarContactProcessingThreshold { get; private set; } + public static float AvatarContactProcessingThreshold { get; private set; } public static float AvatarAddForcePushFactor { get; private set; } public static float AvatarStopZeroThreshold { get; private set; } public static float AvatarStopZeroThresholdSquared { get; private set; } - public static int AvatarJumpFrames { get; private set; } - public static float AvatarBelowGroundUpCorrectionMeters { get; private set; } - public static float AvatarStepHeight { get; private set; } - public static float AvatarStepAngle { get; private set; } - public static float AvatarStepGroundFudge { get; private set; } - public static float AvatarStepApproachFactor { get; private set; } - public static float AvatarStepForceFactor { get; private set; } - public static float AvatarStepUpCorrectionFactor { get; private set; } - public static int AvatarStepSmoothingSteps { get; private set; } + public static int AvatarJumpFrames { get; private set; } + public static float AvatarBelowGroundUpCorrectionMeters { get; private set; } + public static float AvatarStepHeight { get; private set; } + public static float AvatarStepAngle { get; private set; } + public static float AvatarStepGroundFudge { get; private set; } + public static float AvatarStepApproachFactor { get; private set; } + public static float AvatarStepForceFactor { get; private set; } + public static float AvatarStepUpCorrectionFactor { get; private set; } + public static int AvatarStepSmoothingSteps { get; private set; } // Vehicle parameters public static float VehicleMaxLinearVelocity { get; private set; } @@ -193,31 +193,31 @@ public static class BSParam public static float CSHullVolumeConservationThresholdPercent { get; private set; } public static int CSHullMaxVertices { get; private set; } public static float CSHullMaxSkinWidth { get; private set; } - public static float BHullMaxVerticesPerHull { get; private set; } // 100 - public static float BHullMinClusters { get; private set; } // 2 - public static float BHullCompacityWeight { get; private set; } // 0.1 - public static float BHullVolumeWeight { get; private set; } // 0.0 - public static float BHullConcavity { get; private set; } // 100 - public static bool BHullAddExtraDistPoints { get; private set; } // false - public static bool BHullAddNeighboursDistPoints { get; private set; } // false - public static bool BHullAddFacesPoints { get; private set; } // false - public static bool BHullShouldAdjustCollisionMargin { get; private set; } // false - public static float WhichHACD { get; private set; } // zero if Bullet HACD, non-zero says VHACD + public static float BHullMaxVerticesPerHull { get; private set; } // 100 + public static float BHullMinClusters { get; private set; } // 2 + public static float BHullCompacityWeight { get; private set; } // 0.1 + public static float BHullVolumeWeight { get; private set; } // 0.0 + public static float BHullConcavity { get; private set; } // 100 + public static bool BHullAddExtraDistPoints { get; private set; } // false + public static bool BHullAddNeighboursDistPoints { get; private set; } // false + public static bool BHullAddFacesPoints { get; private set; } // false + public static bool BHullShouldAdjustCollisionMargin { get; private set; } // false + public static float WhichHACD { get; private set; } // zero if Bullet HACD, non-zero says VHACD // Parameters for VHACD 2.0: http://code.google.com/p/v-hacd // To enable, set both ShouldUseBulletHACD=true and WhichHACD=1 - // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html - public static float VHACDresolution { get; private set; } // 100,000 max number of voxels generated during voxelization stage - public static float VHACDdepth { get; private set; } // 20 max number of clipping stages - public static float VHACDconcavity { get; private set; } // 0.0025 maximum concavity - public static float VHACDplaneDownsampling { get; private set; } // 4 granularity of search for best clipping plane - public static float VHACDconvexHullDownsampling { get; private set; } // 4 precision of hull gen process - public static float VHACDalpha { get; private set; } // 0.05 bias toward clipping along symmetry planes - public static float VHACDbeta { get; private set; } // 0.05 bias toward clipping along revolution axis - public static float VHACDgamma { get; private set; } // 0.00125 max concavity when merging - public static float VHACDpca { get; private set; } // 0 on/off normalizing mesh before decomp - public static float VHACDmode { get; private set; } // 0 0:voxel based, 1: tetrahedron based - public static float VHACDmaxNumVerticesPerCH { get; private set; } // 64 max triangles per convex hull - public static float VHACDminVolumePerCH { get; private set; } // 0.0001 sampling of generated convex hulls + // http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html + public static float VHACDresolution { get; private set; } // 100,000 max number of voxels generated during voxelization stage + public static float VHACDdepth { get; private set; } // 20 max number of clipping stages + public static float VHACDconcavity { get; private set; } // 0.0025 maximum concavity + public static float VHACDplaneDownsampling { get; private set; } // 4 granularity of search for best clipping plane + public static float VHACDconvexHullDownsampling { get; private set; } // 4 precision of hull gen process + public static float VHACDalpha { get; private set; } // 0.05 bias toward clipping along symmetry planes + public static float VHACDbeta { get; private set; } // 0.05 bias toward clipping along revolution axis + public static float VHACDgamma { get; private set; } // 0.00125 max concavity when merging + public static float VHACDpca { get; private set; } // 0 on/off normalizing mesh before decomp + public static float VHACDmode { get; private set; } // 0 0:voxel based, 1: tetrahedron based + public static float VHACDmaxNumVerticesPerCH { get; private set; } // 64 max triangles per convex hull + public static float VHACDminVolumePerCH { get; private set; } // 0.0001 sampling of generated convex hulls // Linkset implementation parameters public static float LinksetImplementation { get; private set; } @@ -579,7 +579,7 @@ public static class BSParam (s,v) => { ContactProcessingThreshold = v;}, (s,o) => { s.PE.SetContactProcessingThreshold(o.PhysBody, ContactProcessingThreshold); } ), - new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", + new ParameterDefn("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", (float)BSTerrainPhys.TerrainImplementation.Heightmap ), new ParameterDefn("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , 2 ), @@ -631,31 +631,31 @@ public static class BSParam 2.0f ), new ParameterDefn("AvatarTerminalVelocity", "Terminal Velocity of falling avatar", -54.0f ), - new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", + new ParameterDefn("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", 0.1f ), - new ParameterDefn("AvatarAddForcePushFactor", "BSCharacter.AddForce is multiplied by this and mass to be like other physics engines", + new ParameterDefn("AvatarAddForcePushFactor", "BSCharacter.AddForce is multiplied by this and mass to be like other physics engines", 0.315f ), - new ParameterDefn("AvatarStopZeroThreshold", "Movement velocity below which avatar is assumed to be stopped", + new ParameterDefn("AvatarStopZeroThreshold", "Movement velocity below which avatar is assumed to be stopped", 0.45f, (s) => { return (float)AvatarStopZeroThreshold; }, (s,v) => { AvatarStopZeroThreshold = v; AvatarStopZeroThresholdSquared = v * v; } ), - new ParameterDefn("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", + new ParameterDefn("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", 1.0f ), - new ParameterDefn("AvatarJumpFrames", "Number of frames to allow jump forces. Changes jump height.", + new ParameterDefn("AvatarJumpFrames", "Number of frames to allow jump forces. Changes jump height.", 4 ), - new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", + new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", 0.999f ) , - new ParameterDefn("AvatarStepAngle", "The angle (in radians) for a vertical surface to be considered a step", + new ParameterDefn("AvatarStepAngle", "The angle (in radians) for a vertical surface to be considered a step", 0.3f ) , - new ParameterDefn("AvatarStepGroundFudge", "Fudge factor subtracted from avatar base when comparing collision height", + new ParameterDefn("AvatarStepGroundFudge", "Fudge factor subtracted from avatar base when comparing collision height", 0.1f ) , - new ParameterDefn("AvatarStepApproachFactor", "Factor to control angle of approach to step (0=straight on)", + new ParameterDefn("AvatarStepApproachFactor", "Factor to control angle of approach to step (0=straight on)", 2f ), - new ParameterDefn("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step", + new ParameterDefn("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step", 0f ), - new ParameterDefn("AvatarStepUpCorrectionFactor", "Multiplied by height of step collision to create up movement at step", + new ParameterDefn("AvatarStepUpCorrectionFactor", "Multiplied by height of step collision to create up movement at step", 0.8f ), - new ParameterDefn("AvatarStepSmoothingSteps", "Number of frames after a step collision that we continue walking up stairs", + new ParameterDefn("AvatarStepSmoothingSteps", "Number of frames after a step collision that we continue walking up stairs", 1 ), new ParameterDefn("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", @@ -699,131 +699,131 @@ public static class BSParam new ParameterDefn("VehicleEnableAngularBanking", "Turn on/off vehicle angular banking effect", true ), - new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", + new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", 0f, (s) => { return MaxPersistantManifoldPoolSize; }, (s,v) => { MaxPersistantManifoldPoolSize = v; s.UnmanagedParams[0].maxPersistantManifoldPoolSize = v; } ), - new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)", + new ParameterDefn("MaxCollisionAlgorithmPoolSize", "Number of collisions pooled (0 means default of 4096)", 0f, (s) => { return MaxCollisionAlgorithmPoolSize; }, (s,v) => { MaxCollisionAlgorithmPoolSize = v; s.UnmanagedParams[0].maxCollisionAlgorithmPoolSize = v; } ), - new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count", + new ParameterDefn("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count", false, (s) => { return ShouldDisableContactPoolDynamicAllocation; }, (s,v) => { ShouldDisableContactPoolDynamicAllocation = v; s.UnmanagedParams[0].shouldDisableContactPoolDynamicAllocation = NumericBool(v); } ), - new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step", + new ParameterDefn("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step", false, (s) => { return ShouldForceUpdateAllAabbs; }, (s,v) => { ShouldForceUpdateAllAabbs = v; s.UnmanagedParams[0].shouldForceUpdateAllAabbs = NumericBool(v); } ), - new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction", + new ParameterDefn("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction", true, (s) => { return ShouldRandomizeSolverOrder; }, (s,v) => { ShouldRandomizeSolverOrder = v; s.UnmanagedParams[0].shouldRandomizeSolverOrder = NumericBool(v); } ), - new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands", + new ParameterDefn("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands", true, (s) => { return ShouldSplitSimulationIslands; }, (s,v) => { ShouldSplitSimulationIslands = v; s.UnmanagedParams[0].shouldSplitSimulationIslands = NumericBool(v); } ), - new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", + new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", true, (s) => { return ShouldEnableFrictionCaching; }, (s,v) => { ShouldEnableFrictionCaching = v; s.UnmanagedParams[0].shouldEnableFrictionCaching = NumericBool(v); } ), - new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)", + new ParameterDefn("NumberOfSolverIterations", "Number of internal iterations (0 means default)", 0f, // zero says use Bullet default (s) => { return NumberOfSolverIterations; }, (s,v) => { NumberOfSolverIterations = v; s.UnmanagedParams[0].numberOfSolverIterations = v; } ), - new ParameterDefn("UseSingleSidedMeshes", "Whether to compute collisions based on single sided meshes.", + new ParameterDefn("UseSingleSidedMeshes", "Whether to compute collisions based on single sided meshes.", true, (s) => { return UseSingleSidedMeshes; }, (s,v) => { UseSingleSidedMeshes = v; s.UnmanagedParams[0].useSingleSidedMeshes = NumericBool(v); } ), - new ParameterDefn("GlobalContactBreakingThreshold", "Amount of shape radius before breaking a collision contact (0 says Bullet default (0.2))", + new ParameterDefn("GlobalContactBreakingThreshold", "Amount of shape radius before breaking a collision contact (0 says Bullet default (0.2))", 0f, (s) => { return GlobalContactBreakingThreshold; }, (s,v) => { GlobalContactBreakingThreshold = v; s.UnmanagedParams[0].globalContactBreakingThreshold = v; } ), - new ParameterDefn("PhysicsUnmanLoggingFrames", "If non-zero, frames between output of detailed unmanaged physics statistics", + new ParameterDefn("PhysicsUnmanLoggingFrames", "If non-zero, frames between output of detailed unmanaged physics statistics", 0f, (s) => { return PhysicsUnmanLoggingFrames; }, (s,v) => { PhysicsUnmanLoggingFrames = v; s.UnmanagedParams[0].physicsLoggingFrames = v; } ), - new ParameterDefn("CSHullMaxDepthSplit", "CS impl: max depth to split for hull. 1-10 but > 7 is iffy", + new ParameterDefn("CSHullMaxDepthSplit", "CS impl: max depth to split for hull. 1-10 but > 7 is iffy", 7 ), - new ParameterDefn("CSHullMaxDepthSplitForSimpleShapes", "CS impl: max depth setting for simple prim shapes", + new ParameterDefn("CSHullMaxDepthSplitForSimpleShapes", "CS impl: max depth setting for simple prim shapes", 2 ), - new ParameterDefn("CSHullConcavityThresholdPercent", "CS impl: concavity threshold percent (0-20)", + new ParameterDefn("CSHullConcavityThresholdPercent", "CS impl: concavity threshold percent (0-20)", 5f ), - new ParameterDefn("CSHullVolumeConservationThresholdPercent", "percent volume conservation to collapse hulls (0-30)", + new ParameterDefn("CSHullVolumeConservationThresholdPercent", "percent volume conservation to collapse hulls (0-30)", 5f ), - new ParameterDefn("CSHullMaxVertices", "CS impl: maximum number of vertices in output hulls. Keep < 50.", + new ParameterDefn("CSHullMaxVertices", "CS impl: maximum number of vertices in output hulls. Keep < 50.", 32 ), - new ParameterDefn("CSHullMaxSkinWidth", "CS impl: skin width to apply to output hulls.", + new ParameterDefn("CSHullMaxSkinWidth", "CS impl: skin width to apply to output hulls.", 0f ), - new ParameterDefn("BHullMaxVerticesPerHull", "Bullet impl: max number of vertices per created hull", + new ParameterDefn("BHullMaxVerticesPerHull", "Bullet impl: max number of vertices per created hull", 200f ), - new ParameterDefn("BHullMinClusters", "Bullet impl: minimum number of hulls to create per mesh", + new ParameterDefn("BHullMinClusters", "Bullet impl: minimum number of hulls to create per mesh", 10f ), - new ParameterDefn("BHullCompacityWeight", "Bullet impl: weight factor for how compact to make hulls", + new ParameterDefn("BHullCompacityWeight", "Bullet impl: weight factor for how compact to make hulls", 20f ), - new ParameterDefn("BHullVolumeWeight", "Bullet impl: weight factor for volume in created hull", + new ParameterDefn("BHullVolumeWeight", "Bullet impl: weight factor for volume in created hull", 0.1f ), - new ParameterDefn("BHullConcavity", "Bullet impl: weight factor for how convex a created hull can be", + new ParameterDefn("BHullConcavity", "Bullet impl: weight factor for how convex a created hull can be", 10f ), - new ParameterDefn("BHullAddExtraDistPoints", "Bullet impl: whether to add extra vertices for long distance vectors", + new ParameterDefn("BHullAddExtraDistPoints", "Bullet impl: whether to add extra vertices for long distance vectors", true ), - new ParameterDefn("BHullAddNeighboursDistPoints", "Bullet impl: whether to add extra vertices between neighbor hulls", + new ParameterDefn("BHullAddNeighboursDistPoints", "Bullet impl: whether to add extra vertices between neighbor hulls", true ), - new ParameterDefn("BHullAddFacesPoints", "Bullet impl: whether to add extra vertices to break up hull faces", + new ParameterDefn("BHullAddFacesPoints", "Bullet impl: whether to add extra vertices to break up hull faces", true ), - new ParameterDefn("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin", + new ParameterDefn("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin", false ), - new ParameterDefn("WhichHACD", "zero if Bullet HACD, non-zero says VHACD", + new ParameterDefn("WhichHACD", "zero if Bullet HACD, non-zero says VHACD", 0f ), - new ParameterDefn("VHACDresolution", "max number of voxels generated during voxelization stage", + new ParameterDefn("VHACDresolution", "max number of voxels generated during voxelization stage", 100000f ), - new ParameterDefn("VHACDdepth", "max number of clipping stages", + new ParameterDefn("VHACDdepth", "max number of clipping stages", 20f ), - new ParameterDefn("VHACDconcavity", "maximum concavity", + new ParameterDefn("VHACDconcavity", "maximum concavity", 0.0025f ), - new ParameterDefn("VHACDplaneDownsampling", "granularity of search for best clipping plane", + new ParameterDefn("VHACDplaneDownsampling", "granularity of search for best clipping plane", 4f ), - new ParameterDefn("VHACDconvexHullDownsampling", "precision of hull gen process", + new ParameterDefn("VHACDconvexHullDownsampling", "precision of hull gen process", 4f ), - new ParameterDefn("VHACDalpha", "bias toward clipping along symmetry planes", + new ParameterDefn("VHACDalpha", "bias toward clipping along symmetry planes", 0.05f ), - new ParameterDefn("VHACDbeta", "bias toward clipping along revolution axis", + new ParameterDefn("VHACDbeta", "bias toward clipping along revolution axis", 0.05f ), - new ParameterDefn("VHACDgamma", "max concavity when merging", + new ParameterDefn("VHACDgamma", "max concavity when merging", 0.00125f ), - new ParameterDefn("VHACDpca", "on/off normalizing mesh before decomp", + new ParameterDefn("VHACDpca", "on/off normalizing mesh before decomp", 0f ), - new ParameterDefn("VHACDmode", "0:voxel based, 1: tetrahedron based", + new ParameterDefn("VHACDmode", "0:voxel based, 1: tetrahedron based", 0f ), - new ParameterDefn("VHACDmaxNumVerticesPerCH", "max triangles per convex hull", + new ParameterDefn("VHACDmaxNumVerticesPerCH", "max triangles per convex hull", 64f ), - new ParameterDefn("VHACDminVolumePerCH", "sampling of generated convex hulls", + new ParameterDefn("VHACDminVolumePerCH", "sampling of generated convex hulls", 0.0001f ), - new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", + new ParameterDefn("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", (float)BSLinkset.LinksetImplementation.Compound ), - new ParameterDefn("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same", + new ParameterDefn("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same", true ), - new ParameterDefn("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.", + new ParameterDefn("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.", false ), - new ParameterDefn("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints", + new ParameterDefn("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints", true ), - new ParameterDefn("LinkConstraintTransMotorMaxVel", "Maximum velocity to be applied by translational motor in linkset constraints", + new ParameterDefn("LinkConstraintTransMotorMaxVel", "Maximum velocity to be applied by translational motor in linkset constraints", 5.0f ), - new ParameterDefn("LinkConstraintTransMotorMaxForce", "Maximum force to be applied by translational motor in linkset constraints", + new ParameterDefn("LinkConstraintTransMotorMaxForce", "Maximum force to be applied by translational motor in linkset constraints", 0.1f ), - new ParameterDefn("LinkConstraintCFM", "Amount constraint can be violated. 0=no violation, 1=infinite. Default=0.1", + new ParameterDefn("LinkConstraintCFM", "Amount constraint can be violated. 0=no violation, 1=infinite. Default=0.1", 0.1f ), - new ParameterDefn("LinkConstraintERP", "Amount constraint is corrected each tick. 0=none, 1=all. Default = 0.2", + new ParameterDefn("LinkConstraintERP", "Amount constraint is corrected each tick. 0=none, 1=all. Default = 0.2", 0.1f ), - new ParameterDefn("LinkConstraintSolverIterations", "Number of solver iterations when computing constraint. (0 = Bullet default)", + new ParameterDefn("LinkConstraintSolverIterations", "Number of solver iterations when computing constraint. (0 = Bullet default)", 40 ), - new ParameterDefn("DebugNumber", "A console setable number sometimes used for debugging", + new ParameterDefn("DebugNumber", "A console setable number sometimes used for debugging", 1.0f ), new ParameterDefn("PhysicsMetricFrames", "Frames between outputting detailed phys metrics. (0 is off)", diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index a846869..6aa24d5 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs @@ -317,10 +317,10 @@ public abstract class BSPhysObject : PhysicsActor public virtual bool ForceBodyShapeRebuild(bool inTaintTime) { return false; } - public override bool PIDActive + public override bool PIDActive { get { return MoveToTargetActive; } - set { MoveToTargetActive = value; } + set { MoveToTargetActive = value; } } public override OMV.Vector3 PIDTarget { set { MoveToTargetTarget = value; } } @@ -572,7 +572,7 @@ public abstract class BSPhysObject : PhysicsActor newContact.RelativeSpeed = -OMV.Vector3.Dot(relvel, contactNormal); // DetailLog("{0},{1}.Collision.AddCollider,vel={2},contee.vel={3},relvel={4},relspeed={5}", // LocalID, TypeName, RawVelocity, (collidee == null ? OMV.Vector3.Zero : collidee.RawVelocity), relvel, newContact.RelativeSpeed); - + lock (PhysScene.CollisionLock) { CollisionCollection.AddCollider(collideeLocalID, newContact); diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index db2b9db..b153761 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs @@ -1144,14 +1144,14 @@ public class BSPrim : BSPhysObject } } - public override bool PIDActive + public override bool PIDActive { get { return MoveToTargetActive; } - set + set { MoveToTargetActive = value; @@ -1179,13 +1179,13 @@ public class BSPrim : BSPhysObject // if the actor exists, tell it to refresh its values. actor.Refresh(); } - + } } // Used for llSetHoverHeight and maybe vehicle height // Hover Height will override MoveTo target's Z public override bool PIDHoverActive { - get + get { return base.HoverActive; } diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs index ee57f0c..7ff0a07 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs @@ -351,12 +351,12 @@ namespace OpenSim.Region.PhysicsModule.BulletS if (BSParam.UseSeparatePhysicsThread) { // The physics simulation should happen independently of the heartbeat loop - m_physicsThread + m_physicsThread = WorkManager.StartThread( - BulletSPluginPhysicsThread, - string.Format("{0} ({1})", BulletEngineName, RegionName), - ThreadPriority.Normal, - true, + BulletSPluginPhysicsThread, + string.Format("{0} ({1})", BulletEngineName, RegionName), + ThreadPriority.Normal, + true, true); } } diff --git a/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs b/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs index 2ba3c5a..ab5d4849 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/ExtendedPhysics.cs @@ -136,7 +136,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS return; } - + // Register as LSL functions all the [ScriptInvocation] marked methods. Comms.RegisterScriptInvocations(this); Comms.RegisterConstants(this); diff --git a/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs index 6ed7af1..91ce468 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Properties/AssemblyInfo.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Mono.Addins; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("OpenSim.Region.Physics.BulletSPlugin")] @@ -15,8 +15,8 @@ using Mono.Addins; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -26,7 +26,7 @@ using Mono.Addins; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // diff --git a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs index 109e19c..3e8c1cd 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs @@ -80,7 +80,7 @@ public static class BulletSimTestsUtil } Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); - + RegionInfo info = new RegionInfo(); info.RegionName = "BSTestRegion"; info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize; diff --git a/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs index c0cf19a..c2be568 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/HullCreation.cs @@ -146,7 +146,7 @@ public class HullCreation : OpenSimTestCase uint torusLocalID = 125; PhysicsScene.AddPrimShape("testTorus", pbs, pos, size, rot, isPhys, torusLocalID); BSPrim primTypeTorus = (BSPrim)PhysicsScene.PhysObjects[torusLocalID]; - + // The actual prim shape creation happens at taint time PhysicsScene.ProcessTaints(); -- cgit v1.1