diff options
author | Melanie | 2013-01-16 16:52:57 +0000 |
---|---|---|
committer | Melanie | 2013-01-16 16:52:57 +0000 |
commit | 9c99ed26ebe7cd2e42c10487e4ddfde0c934d921 (patch) | |
tree | 536b2d6530fdda925203afddd27a4b9444e4d2a7 /OpenSim/Region/Physics/BulletSPlugin | |
parent | Complete removal of the now unused state queue (diff) | |
parent | Changed a couple of debug messages at the request of osgrid. (diff) | |
download | opensim-SC_OLD-9c99ed26ebe7cd2e42c10487e4ddfde0c934d921.zip opensim-SC_OLD-9c99ed26ebe7cd2e42c10487e4ddfde0c934d921.tar.gz opensim-SC_OLD-9c99ed26ebe7cd2e42c10487e4ddfde0c934d921.tar.bz2 opensim-SC_OLD-9c99ed26ebe7cd2e42c10487e4ddfde0c934d921.tar.xz |
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
7 files changed, 143 insertions, 57 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs index 9ff7084..ae54499 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |||
@@ -166,7 +166,7 @@ public override BulletWorld Initialize(Vector3 maxPosition, ConfigurationParamet | |||
166 | 166 | ||
167 | // If Debug logging level, enable logging from the unmanaged code | 167 | // If Debug logging level, enable logging from the unmanaged code |
168 | m_DebugLogCallbackHandle = null; | 168 | m_DebugLogCallbackHandle = null; |
169 | if (BSScene.m_log.IsDebugEnabled || PhysicsScene.PhysicsLogging.Enabled) | 169 | if (BSScene.m_log.IsDebugEnabled && PhysicsScene.PhysicsLogging.Enabled) |
170 | { | 170 | { |
171 | BSScene.m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", BSScene.LogHeader); | 171 | BSScene.m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", BSScene.LogHeader); |
172 | if (PhysicsScene.PhysicsLogging.Enabled) | 172 | if (PhysicsScene.PhysicsLogging.Enabled) |
@@ -212,6 +212,19 @@ public override void Shutdown(BulletWorld world) | |||
212 | { | 212 | { |
213 | BulletWorldUnman worldu = world as BulletWorldUnman; | 213 | BulletWorldUnman worldu = world as BulletWorldUnman; |
214 | BSAPICPP.Shutdown2(worldu.ptr); | 214 | BSAPICPP.Shutdown2(worldu.ptr); |
215 | |||
216 | if (m_paramsHandle.IsAllocated) | ||
217 | { | ||
218 | m_paramsHandle.Free(); | ||
219 | } | ||
220 | if (m_collisionArrayPinnedHandle.IsAllocated) | ||
221 | { | ||
222 | m_collisionArrayPinnedHandle.Free(); | ||
223 | } | ||
224 | if (m_updateArrayPinnedHandle.IsAllocated) | ||
225 | { | ||
226 | m_updateArrayPinnedHandle.Free(); | ||
227 | } | ||
215 | } | 228 | } |
216 | 229 | ||
217 | public override bool PushUpdate(BulletBody obj) | 230 | public override bool PushUpdate(BulletBody obj) |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index a5fec87..87a06c1 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -215,7 +215,7 @@ public sealed class BSCharacter : BSPhysObject | |||
215 | // Add special movement force to allow avatars to walk up stepped surfaces. | 215 | // Add special movement force to allow avatars to walk up stepped surfaces. |
216 | moveForce += WalkUpStairs(); | 216 | moveForce += WalkUpStairs(); |
217 | 217 | ||
218 | DetailLog("{0},BSCharacter.MoveMotor,move,stepVel={1},vel={2},mass={3},moveForce={4}", LocalID, stepVelocity, _velocity, Mass, moveForce); | 218 | // DetailLog("{0},BSCharacter.MoveMotor,move,stepVel={1},vel={2},mass={3},moveForce={4}", LocalID, stepVelocity, _velocity, Mass, moveForce); |
219 | PhysicsScene.PE.ApplyCentralImpulse(PhysBody, moveForce); | 219 | PhysicsScene.PE.ApplyCentralImpulse(PhysBody, moveForce); |
220 | }); | 220 | }); |
221 | } | 221 | } |
@@ -855,7 +855,10 @@ public sealed class BSCharacter : BSPhysObject | |||
855 | _rotationalVelocity = entprop.RotationalVelocity; | 855 | _rotationalVelocity = entprop.RotationalVelocity; |
856 | 856 | ||
857 | // Do some sanity checking for the avatar. Make sure it's above ground and inbounds. | 857 | // Do some sanity checking for the avatar. Make sure it's above ground and inbounds. |
858 | PositionSanityCheck(true); | 858 | if (PositionSanityCheck(true)) |
859 | { | ||
860 | entprop.Position = _position; | ||
861 | } | ||
859 | 862 | ||
860 | // remember the current and last set values | 863 | // remember the current and last set values |
861 | LastEntityProperties = CurrentEntityProperties; | 864 | LastEntityProperties = CurrentEntityProperties; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index bcebaec..6601479 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -124,9 +124,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
124 | static readonly float PIOverTwo = ((float)Math.PI) / 2f; | 124 | static readonly float PIOverTwo = ((float)Math.PI) / 2f; |
125 | 125 | ||
126 | // For debugging, flags to turn on and off individual corrections. | 126 | // For debugging, flags to turn on and off individual corrections. |
127 | private bool enableAngularVerticalAttraction = true; | 127 | private bool enableAngularVerticalAttraction; |
128 | private bool enableAngularDeflection = true; | 128 | private bool enableAngularDeflection; |
129 | private bool enableAngularBanking = true; | 129 | private bool enableAngularBanking; |
130 | 130 | ||
131 | public BSDynamics(BSScene myScene, BSPrim myPrim) | 131 | public BSDynamics(BSScene myScene, BSPrim myPrim) |
132 | { | 132 | { |
@@ -141,8 +141,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
141 | public void SetupVehicleDebugging() | 141 | public void SetupVehicleDebugging() |
142 | { | 142 | { |
143 | enableAngularVerticalAttraction = true; | 143 | enableAngularVerticalAttraction = true; |
144 | enableAngularDeflection = true; | 144 | enableAngularDeflection = false; |
145 | enableAngularBanking = true; | 145 | enableAngularBanking = false; |
146 | if (BSParam.VehicleDebuggingEnabled != ConfigurationParameters.numericFalse) | 146 | if (BSParam.VehicleDebuggingEnabled != ConfigurationParameters.numericFalse) |
147 | { | 147 | { |
148 | enableAngularVerticalAttraction = false; | 148 | enableAngularVerticalAttraction = false; |
@@ -649,6 +649,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
649 | private Quaternion m_knownOrientation; | 649 | private Quaternion m_knownOrientation; |
650 | private Vector3 m_knownRotationalVelocity; | 650 | private Vector3 m_knownRotationalVelocity; |
651 | private Vector3 m_knownRotationalForce; | 651 | private Vector3 m_knownRotationalForce; |
652 | private Vector3 m_knownRotationalImpulse; | ||
652 | private Vector3 m_knownForwardVelocity; // vehicle relative forward speed | 653 | private Vector3 m_knownForwardVelocity; // vehicle relative forward speed |
653 | 654 | ||
654 | private const int m_knownChangedPosition = 1 << 0; | 655 | private const int m_knownChangedPosition = 1 << 0; |
@@ -658,9 +659,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
658 | private const int m_knownChangedOrientation = 1 << 4; | 659 | private const int m_knownChangedOrientation = 1 << 4; |
659 | private const int m_knownChangedRotationalVelocity = 1 << 5; | 660 | private const int m_knownChangedRotationalVelocity = 1 << 5; |
660 | private const int m_knownChangedRotationalForce = 1 << 6; | 661 | private const int m_knownChangedRotationalForce = 1 << 6; |
661 | private const int m_knownChangedTerrainHeight = 1 << 7; | 662 | private const int m_knownChangedRotationalImpulse = 1 << 7; |
662 | private const int m_knownChangedWaterLevel = 1 << 8; | 663 | private const int m_knownChangedTerrainHeight = 1 << 8; |
663 | private const int m_knownChangedForwardVelocity = 1 << 9; | 664 | private const int m_knownChangedWaterLevel = 1 << 9; |
665 | private const int m_knownChangedForwardVelocity = 1 <<10; | ||
664 | 666 | ||
665 | private void ForgetKnownVehicleProperties() | 667 | private void ForgetKnownVehicleProperties() |
666 | { | 668 | { |
@@ -700,6 +702,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
700 | PhysicsScene.PE.SetInterpolationAngularVelocity(Prim.PhysBody, m_knownRotationalVelocity); | 702 | PhysicsScene.PE.SetInterpolationAngularVelocity(Prim.PhysBody, m_knownRotationalVelocity); |
701 | } | 703 | } |
702 | 704 | ||
705 | if ((m_knownChanged & m_knownChangedRotationalImpulse) != 0) | ||
706 | Prim.ApplyTorqueImpulse((Vector3)m_knownRotationalImpulse, true /*inTaintTime*/); | ||
707 | |||
703 | if ((m_knownChanged & m_knownChangedRotationalForce) != 0) | 708 | if ((m_knownChanged & m_knownChangedRotationalForce) != 0) |
704 | { | 709 | { |
705 | Prim.AddAngularForce((Vector3)m_knownRotationalForce, false /*pushForce*/, true /*inTaintTime*/); | 710 | Prim.AddAngularForce((Vector3)m_knownRotationalForce, false /*pushForce*/, true /*inTaintTime*/); |
@@ -843,6 +848,17 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
843 | m_knownChanged |= m_knownChangedRotationalForce; | 848 | m_knownChanged |= m_knownChangedRotationalForce; |
844 | m_knownHas |= m_knownChangedRotationalForce; | 849 | m_knownHas |= m_knownChangedRotationalForce; |
845 | } | 850 | } |
851 | private void VehicleAddRotationalImpulse(Vector3 pImpulse) | ||
852 | { | ||
853 | if ((m_knownHas & m_knownChangedRotationalImpulse) == 0) | ||
854 | { | ||
855 | m_knownRotationalImpulse = Vector3.Zero; | ||
856 | m_knownHas |= m_knownChangedRotationalImpulse; | ||
857 | } | ||
858 | m_knownRotationalImpulse += pImpulse; | ||
859 | m_knownChanged |= m_knownChangedRotationalImpulse; | ||
860 | } | ||
861 | |||
846 | // Vehicle relative forward velocity | 862 | // Vehicle relative forward velocity |
847 | private Vector3 VehicleForwardVelocity | 863 | private Vector3 VehicleForwardVelocity |
848 | { | 864 | { |
@@ -1031,16 +1047,32 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1031 | else | 1047 | else |
1032 | { | 1048 | { |
1033 | // Error is positive if below the target and negative if above. | 1049 | // Error is positive if below the target and negative if above. |
1034 | float verticalError = m_VhoverTargetHeight - VehiclePosition.Z; | 1050 | Vector3 hpos = VehiclePosition; |
1035 | float verticalCorrectionVelocity = verticalError / m_VhoverTimescale * pTimestep; | 1051 | float verticalError = m_VhoverTargetHeight - hpos.Z; |
1052 | float verticalCorrection = verticalError / m_VhoverTimescale; | ||
1053 | verticalCorrection *= m_VhoverEfficiency; | ||
1054 | |||
1055 | hpos.Z += verticalCorrection; | ||
1056 | VehiclePosition = hpos; | ||
1057 | |||
1058 | // Since we are hovering, we need to do the opposite of falling -- get rid of world Z | ||
1059 | Vector3 vel = VehicleVelocity; | ||
1060 | vel.Z = 0f; | ||
1061 | VehicleVelocity = vel; | ||
1062 | |||
1063 | /* | ||
1064 | float verticalCorrectionVelocity = verticalError / m_VhoverTimescale; | ||
1065 | Vector3 verticalCorrection = new Vector3(0f, 0f, verticalCorrectionVelocity); | ||
1066 | verticalCorrection *= m_vehicleMass; | ||
1036 | 1067 | ||
1037 | // TODO: implement m_VhoverEfficiency correctly | 1068 | // TODO: implement m_VhoverEfficiency correctly |
1038 | VehicleAddForceImpulse(new Vector3(0f, 0f, verticalCorrectionVelocity)); | 1069 | VehicleAddForceImpulse(verticalCorrection); |
1070 | */ | ||
1039 | 1071 | ||
1040 | VDetailLog("{0}, MoveLinear,hover,pos={1},eff={2},hoverTS={3},height={4},target={5},err={6},corrVel={7}", | 1072 | VDetailLog("{0}, MoveLinear,hover,pos={1},eff={2},hoverTS={3},height={4},target={5},err={6},corr={7}", |
1041 | Prim.LocalID, VehiclePosition, m_VhoverEfficiency, | 1073 | Prim.LocalID, VehiclePosition, m_VhoverEfficiency, |
1042 | m_VhoverTimescale, m_VhoverHeight, m_VhoverTargetHeight, | 1074 | m_VhoverTimescale, m_VhoverHeight, m_VhoverTargetHeight, |
1043 | verticalError, verticalCorrectionVelocity); | 1075 | verticalError, verticalCorrection); |
1044 | } | 1076 | } |
1045 | 1077 | ||
1046 | } | 1078 | } |
@@ -1128,8 +1160,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1128 | if (!Prim.IsColliding && VehicleVelocity.Z > 0.1) | 1160 | if (!Prim.IsColliding && VehicleVelocity.Z > 0.1) |
1129 | { | 1161 | { |
1130 | // Get rid of any of the velocity vector that is pushing us up. | 1162 | // Get rid of any of the velocity vector that is pushing us up. |
1131 | VehicleVelocity += new Vector3(0, 0, -VehicleVelocity.Z); | 1163 | float upVelocity = VehicleVelocity.Z; |
1164 | VehicleVelocity += new Vector3(0, 0, -upVelocity); | ||
1132 | 1165 | ||
1166 | /* | ||
1133 | // If we're pointed up into the air, we should nose down | 1167 | // If we're pointed up into the air, we should nose down |
1134 | Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation; | 1168 | Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation; |
1135 | // The rotation around the Y axis is pitch up or down | 1169 | // The rotation around the Y axis is pitch up or down |
@@ -1143,11 +1177,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1143 | VDetailLog("{0}, MoveLinear,limitMotorUp,newVel={1},pntDir={2},corrFrc={3},aCorr={4}", | 1177 | VDetailLog("{0}, MoveLinear,limitMotorUp,newVel={1},pntDir={2},corrFrc={3},aCorr={4}", |
1144 | Prim.LocalID, VehicleVelocity, pointingDirection, angularCorrectionForce, angularCorrectionVector); | 1178 | Prim.LocalID, VehicleVelocity, pointingDirection, angularCorrectionForce, angularCorrectionVector); |
1145 | } | 1179 | } |
1146 | else | 1180 | */ |
1147 | { | 1181 | VDetailLog("{0}, MoveLinear,limitMotorUp,collide={1},upVel={2},newVel={3}", |
1148 | VDetailLog("{0}, MoveLinear,limitMotorUp,newVel={1},pntDir={2}", | 1182 | Prim.LocalID, Prim.IsColliding, upVelocity, VehicleVelocity); |
1149 | Prim.LocalID, VehicleVelocity, pointingDirection); | ||
1150 | } | ||
1151 | } | 1183 | } |
1152 | } | 1184 | } |
1153 | } | 1185 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs index 5a1b5c7..8c9a774 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs | |||
@@ -108,8 +108,8 @@ public sealed class BSLinksetCompound : BSLinkset | |||
108 | // Schedule a refresh to happen after all the other taint processing. | 108 | // Schedule a refresh to happen after all the other taint processing. |
109 | private void ScheduleRebuild(BSPhysObject requestor) | 109 | private void ScheduleRebuild(BSPhysObject requestor) |
110 | { | 110 | { |
111 | DetailLog("{0},BSLinksetCompound.ScheduleRebuild,,rebuilding={1},hasChildren={2}", | 111 | DetailLog("{0},BSLinksetCompound.ScheduleRebuild,,rebuilding={1},hasChildren={2},actuallyScheduling={3}", |
112 | requestor.LocalID, Rebuilding, HasAnyChildren); | 112 | requestor.LocalID, Rebuilding, HasAnyChildren, (!Rebuilding && HasAnyChildren)); |
113 | // When rebuilding, it is possible to set properties that would normally require a rebuild. | 113 | // When rebuilding, it is possible to set properties that would normally require a rebuild. |
114 | // If already rebuilding, don't request another rebuild. | 114 | // If already rebuilding, don't request another rebuild. |
115 | // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. | 115 | // If a linkset with just a root prim (simple non-linked prim) don't bother rebuilding. |
@@ -195,8 +195,11 @@ public sealed class BSLinksetCompound : BSLinkset | |||
195 | && PhysicsScene.TerrainManager.IsWithinKnownTerrain(LinksetRoot.RawPosition)) | 195 | && PhysicsScene.TerrainManager.IsWithinKnownTerrain(LinksetRoot.RawPosition)) |
196 | { | 196 | { |
197 | // TODO: replace this with are calculation of the child prim's orientation and pos. | 197 | // TODO: replace this with are calculation of the child prim's orientation and pos. |
198 | updated.LinksetInfo = null; | 198 | // TODO: for the moment, don't rebuild the compound shape. |
199 | ScheduleRebuild(updated); | 199 | // This is often just the car turning its wheels. When we can just reorient the one |
200 | // member shape of the compound shape, the overhead of rebuilding won't be a problem. | ||
201 | // updated.LinksetInfo = null; | ||
202 | // ScheduleRebuild(updated); | ||
200 | } | 203 | } |
201 | } | 204 | } |
202 | 205 | ||
@@ -308,7 +311,7 @@ public sealed class BSLinksetCompound : BSLinkset | |||
308 | else | 311 | else |
309 | { | 312 | { |
310 | // Rebuild the compound shape with the child removed | 313 | // Rebuild the compound shape with the child removed |
311 | ScheduleRebuild(child); | 314 | ScheduleRebuild(LinksetRoot); |
312 | } | 315 | } |
313 | } | 316 | } |
314 | return; | 317 | return; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 27ff047..3e80aa4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -94,16 +94,16 @@ public static class BSParam | |||
94 | public static float PID_D { get; private set; } // derivative | 94 | public static float PID_D { get; private set; } // derivative |
95 | public static float PID_P { get; private set; } // proportional | 95 | public static float PID_P { get; private set; } // proportional |
96 | 96 | ||
97 | // Various constants that come from that other virtual world that shall not be named | 97 | // Various constants that come from that other virtual world that shall not be named. |
98 | public const float MinGravityZ = -1f; | 98 | public const float MinGravityZ = -1f; |
99 | public const float MaxGravityZ = 28f; | 99 | public const float MaxGravityZ = 28f; |
100 | public const float MinFriction = 0f; | 100 | public const float MinFriction = 0f; |
101 | public const float MaxFriction = 255f; | 101 | public const float MaxFriction = 255f; |
102 | public const float MinDensity = 0f; | 102 | public const float MinDensity = 0.01f; |
103 | public const float MaxDensity = 22587f; | 103 | public const float MaxDensity = 22587f; |
104 | public const float MinRestitution = 0f; | 104 | public const float MinRestitution = 0f; |
105 | public const float MaxRestitution = 1f; | 105 | public const float MaxRestitution = 1f; |
106 | public const float MaxAddForceMagnitude = 20000f; | 106 | public const float MaxAddForceMagnitude = 20f; |
107 | 107 | ||
108 | // =========================================================================== | 108 | // =========================================================================== |
109 | public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val); | 109 | public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val); |
@@ -318,13 +318,13 @@ public static class BSParam | |||
318 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularSleepingThreshold=x;}, p, l, v); }, | 318 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{AngularSleepingThreshold=x;}, p, l, v); }, |
319 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), | 319 | (s,o,v) => { s.PE.SetSleepingThresholds(o.PhysBody, v, v); } ), |
320 | new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" , | 320 | new ParameterDefn("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" , |
321 | 0f, // set to zero to disable | 321 | 0.3f, // set to zero to disable |
322 | (s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); }, | 322 | (s,cf,p,v) => { CcdMotionThreshold = cf.GetFloat(p, v); }, |
323 | (s) => { return CcdMotionThreshold; }, | 323 | (s) => { return CcdMotionThreshold; }, |
324 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdMotionThreshold=x;}, p, l, v); }, | 324 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdMotionThreshold=x;}, p, l, v); }, |
325 | (s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ), | 325 | (s,o,v) => { s.PE.SetCcdMotionThreshold(o.PhysBody, v); } ), |
326 | new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" , | 326 | new ParameterDefn("CcdSweptSphereRadius", "Continuious collision detection test radius" , |
327 | 0f, | 327 | 0.2f, |
328 | (s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); }, | 328 | (s,cf,p,v) => { CcdSweptSphereRadius = cf.GetFloat(p, v); }, |
329 | (s) => { return CcdSweptSphereRadius; }, | 329 | (s) => { return CcdSweptSphereRadius; }, |
330 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdSweptSphereRadius=x;}, p, l, v); }, | 330 | (s,p,l,v) => { s.UpdateParameterObject((x)=>{CcdSweptSphereRadius=x;}, p, l, v); }, |
@@ -465,7 +465,7 @@ public static class BSParam | |||
465 | (s) => { return s.UnmanagedParams[0].shouldSplitSimulationIslands; }, | 465 | (s) => { return s.UnmanagedParams[0].shouldSplitSimulationIslands; }, |
466 | (s,p,l,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ), | 466 | (s,p,l,v) => { s.UnmanagedParams[0].shouldSplitSimulationIslands = v; } ), |
467 | new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", | 467 | new ParameterDefn("ShouldEnableFrictionCaching", "Enable friction computation caching", |
468 | ConfigurationParameters.numericFalse, | 468 | ConfigurationParameters.numericTrue, |
469 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, | 469 | (s,cf,p,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = BSParam.NumericBool(cf.GetBoolean(p, BSParam.BoolNumeric(v))); }, |
470 | (s) => { return s.UnmanagedParams[0].shouldEnableFrictionCaching; }, | 470 | (s) => { return s.UnmanagedParams[0].shouldEnableFrictionCaching; }, |
471 | (s,p,l,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ), | 471 | (s,p,l,v) => { s.UnmanagedParams[0].shouldEnableFrictionCaching = v; } ), |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs index addab29..9fbfcdc 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs | |||
@@ -442,7 +442,8 @@ public sealed class BSShapeCollection : IDisposable | |||
442 | return ret; | 442 | return ret; |
443 | } | 443 | } |
444 | 444 | ||
445 | // Create a mesh/hull shape or a native shape if 'nativeShapePossible' is 'true'. | 445 | // Create a mesh, hull or native shape. |
446 | // Return 'true' if the prim's shape was changed. | ||
446 | public bool CreateGeomNonSpecial(bool forceRebuild, BSPhysObject prim, ShapeDestructionCallback shapeCallback) | 447 | public bool CreateGeomNonSpecial(bool forceRebuild, BSPhysObject prim, ShapeDestructionCallback shapeCallback) |
447 | { | 448 | { |
448 | bool ret = false; | 449 | bool ret = false; |
@@ -472,7 +473,7 @@ public sealed class BSShapeCollection : IDisposable | |||
472 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,maybeNative,force={1},primScale={2},primSize={3},primShape={4}", | 473 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,maybeNative,force={1},primScale={2},primSize={3},primShape={4}", |
473 | prim.LocalID, forceRebuild, prim.Scale, prim.Size, prim.PhysShape.type); | 474 | prim.LocalID, forceRebuild, prim.Scale, prim.Size, prim.PhysShape.type); |
474 | 475 | ||
475 | // It doesn't look like Bullet scales spheres so make sure the scales are all equal | 476 | // It doesn't look like Bullet scales native spheres so make sure the scales are all equal |
476 | if ((pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1) | 477 | if ((pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1) |
477 | && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z) | 478 | && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z) |
478 | { | 479 | { |
@@ -484,9 +485,9 @@ public sealed class BSShapeCollection : IDisposable | |||
484 | { | 485 | { |
485 | ret = GetReferenceToNativeShape(prim, BSPhysicsShapeType.SHAPE_SPHERE, | 486 | ret = GetReferenceToNativeShape(prim, BSPhysicsShapeType.SHAPE_SPHERE, |
486 | FixedShapeKey.KEY_SPHERE, shapeCallback); | 487 | FixedShapeKey.KEY_SPHERE, shapeCallback); |
487 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,sphere,force={1},shape={2}", | ||
488 | prim.LocalID, forceRebuild, prim.PhysShape); | ||
489 | } | 488 | } |
489 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,sphere,force={1},rebuilt={2},shape={3}", | ||
490 | prim.LocalID, forceRebuild, ret, prim.PhysShape); | ||
490 | } | 491 | } |
491 | if (!haveShape && pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) | 492 | if (!haveShape && pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) |
492 | { | 493 | { |
@@ -498,9 +499,9 @@ public sealed class BSShapeCollection : IDisposable | |||
498 | { | 499 | { |
499 | ret = GetReferenceToNativeShape( prim, BSPhysicsShapeType.SHAPE_BOX, | 500 | ret = GetReferenceToNativeShape( prim, BSPhysicsShapeType.SHAPE_BOX, |
500 | FixedShapeKey.KEY_BOX, shapeCallback); | 501 | FixedShapeKey.KEY_BOX, shapeCallback); |
501 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,box,force={1},shape={2}", | ||
502 | prim.LocalID, forceRebuild, prim.PhysShape); | ||
503 | } | 502 | } |
503 | if (DDetail) DetailLog("{0},BSShapeCollection.CreateGeom,box,force={1},rebuilt={2},shape={3}", | ||
504 | prim.LocalID, forceRebuild, ret, prim.PhysShape); | ||
504 | } | 505 | } |
505 | } | 506 | } |
506 | 507 | ||
@@ -513,6 +514,7 @@ public sealed class BSShapeCollection : IDisposable | |||
513 | return ret; | 514 | return ret; |
514 | } | 515 | } |
515 | 516 | ||
517 | // return 'true' if the prim's shape was changed. | ||
516 | public bool CreateGeomMeshOrHull(BSPhysObject prim, ShapeDestructionCallback shapeCallback) | 518 | public bool CreateGeomMeshOrHull(BSPhysObject prim, ShapeDestructionCallback shapeCallback) |
517 | { | 519 | { |
518 | 520 | ||
@@ -872,8 +874,7 @@ public sealed class BSShapeCollection : IDisposable | |||
872 | { | 874 | { |
873 | prim.LastAssetBuildFailed = true; | 875 | prim.LastAssetBuildFailed = true; |
874 | BSPhysObject xprim = prim; | 876 | BSPhysObject xprim = prim; |
875 | DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset,lID={1},lastFailed={2}", | 877 | DetailLog("{0},BSShapeCollection.VerifyMeshCreated,fetchAsset,lastFailed={1}", prim.LocalID, prim.LastAssetBuildFailed); |
876 | LogHeader, prim.LocalID, prim.LastAssetBuildFailed); | ||
877 | Util.FireAndForget(delegate | 878 | Util.FireAndForget(delegate |
878 | { | 879 | { |
879 | RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod; | 880 | RequestAssetDelegate assetProvider = PhysicsScene.RequestAssetMethod; |
@@ -882,19 +883,34 @@ public sealed class BSShapeCollection : IDisposable | |||
882 | BSPhysObject yprim = xprim; // probably not necessary, but, just in case. | 883 | BSPhysObject yprim = xprim; // probably not necessary, but, just in case. |
883 | assetProvider(yprim.BaseShape.SculptTexture, delegate(AssetBase asset) | 884 | assetProvider(yprim.BaseShape.SculptTexture, delegate(AssetBase asset) |
884 | { | 885 | { |
885 | if (!yprim.BaseShape.SculptEntry) | 886 | bool assetFound = false; // DEBUG DEBUG |
886 | return; | 887 | string mismatchIDs = String.Empty; // DEBUG DEBUG |
887 | if (yprim.BaseShape.SculptTexture.ToString() != asset.ID) | 888 | if (yprim.BaseShape.SculptEntry) |
888 | return; | 889 | { |
889 | 890 | if (yprim.BaseShape.SculptTexture.ToString() == asset.ID) | |
890 | yprim.BaseShape.SculptData = asset.Data; | 891 | { |
891 | // This will cause the prim to see that the filler shape is not the right | 892 | yprim.BaseShape.SculptData = asset.Data; |
892 | // one and try again to build the object. | 893 | // This will cause the prim to see that the filler shape is not the right |
893 | // No race condition with the normal shape setting since the rebuild is at taint time. | 894 | // one and try again to build the object. |
894 | yprim.ForceBodyShapeRebuild(false); | 895 | // No race condition with the normal shape setting since the rebuild is at taint time. |
896 | yprim.ForceBodyShapeRebuild(false /* inTaintTime */); | ||
897 | assetFound = true; | ||
898 | } | ||
899 | else | ||
900 | { | ||
901 | mismatchIDs = yprim.BaseShape.SculptTexture.ToString() + "/" + asset.ID; | ||
902 | } | ||
903 | } | ||
904 | DetailLog("{0},BSShapeCollection,fetchAssetCallback,found={1},isSculpt={2},ids={3}", | ||
905 | yprim.LocalID, assetFound, yprim.BaseShape.SculptEntry, mismatchIDs ); | ||
895 | 906 | ||
896 | }); | 907 | }); |
897 | } | 908 | } |
909 | else | ||
910 | { | ||
911 | PhysicsScene.Logger.ErrorFormat("{0} Physical object requires asset but no asset provider. Name={1}", | ||
912 | LogHeader, PhysicsScene.Name); | ||
913 | } | ||
898 | }); | 914 | }); |
899 | } | 915 | } |
900 | else | 916 | else |
@@ -906,9 +922,9 @@ public sealed class BSShapeCollection : IDisposable | |||
906 | } | 922 | } |
907 | } | 923 | } |
908 | 924 | ||
909 | // While we figure out the real problem, stick in a simple box for the object. | 925 | // While we wait for the mesh defining asset to be loaded, stick in a simple box for the object. |
910 | BulletShape fillinShape = | 926 | BulletShape fillinShape = BuildPhysicalNativeShape(prim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); |
911 | BuildPhysicalNativeShape(prim, BSPhysicsShapeType.SHAPE_BOX, FixedShapeKey.KEY_BOX); | 927 | DetailLog("{0},BSShapeCollection.VerifyMeshCreated,boxTempShape", prim.LocalID); |
912 | 928 | ||
913 | return fillinShape; | 929 | return fillinShape; |
914 | } | 930 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index 59cbab9..d4545f7 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt | |||
@@ -1,7 +1,14 @@ | |||
1 | CURRENT PRIORITIES | 1 | CURRENT PRIORITIES |
2 | ================================================= | 2 | ================================================= |
3 | Mantis 6040 script http://opensimulator.org/mantis/view.php?id=6040 | ||
4 | Msg Kayaker on OSGrid when working | ||
5 | Teravus llMoveToTarget script debug | ||
6 | Mixing of hover, buoyancy/gravity, moveToTarget, into one force | ||
7 | Boats floating at proper level | ||
3 | Nebadon vehicles turning funny in arena | 8 | Nebadon vehicles turning funny in arena |
4 | limitMotorUp calibration (more down?) | 9 | limitMotorUp calibration (more down?) |
10 | llRotLookAt | ||
11 | llLookAt | ||
5 | Vehicle angular vertical attraction | 12 | Vehicle angular vertical attraction |
6 | Vehicle angular deflection | 13 | Vehicle angular deflection |
7 | Preferred orientation angular correction fix | 14 | Preferred orientation angular correction fix |
@@ -9,8 +16,6 @@ vehicle angular banking | |||
9 | Avatars walking up stairs (HALF DONE) | 16 | Avatars walking up stairs (HALF DONE) |
10 | Radius of the capsule affects ability to climb edges. | 17 | Radius of the capsule affects ability to climb edges. |
11 | Vehicle movement on terrain smoothness | 18 | Vehicle movement on terrain smoothness |
12 | Surfboard go wonky when turning | ||
13 | Angular motor direction is global coordinates rather than local coordinates? | ||
14 | Boats float low in the water (DONE) | 19 | Boats float low in the water (DONE) |
15 | Avatar movement | 20 | Avatar movement |
16 | flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE) | 21 | flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE) |
@@ -27,6 +32,10 @@ Add material densities to the material types | |||
27 | 32 | ||
28 | CRASHES | 33 | CRASHES |
29 | ================================================= | 34 | ================================================= |
35 | Crazyness during 20130115 office hours was PositionAdjustUnderground for both char and prim | ||
36 | m1:logs/20130115.0934/physics-BulletSim-20130115083613.log | ||
37 | Creation of Neb's terrain made the terrain "disappear". Everything started to fall | ||
38 | and then get restored to be above terrain. | ||
30 | 20121129.1411: editting/moving phys object across region boundries causes crash | 39 | 20121129.1411: editting/moving phys object across region boundries causes crash |
31 | getPos-> btRigidBody::upcast -> getBodyType -> BOOM | 40 | getPos-> btRigidBody::upcast -> getBodyType -> BOOM |
32 | 20121128.1600: mesh object not rezzing (no physics mesh). | 41 | 20121128.1600: mesh object not rezzing (no physics mesh). |
@@ -111,6 +120,8 @@ Physical and phantom will drop through the terrain | |||
111 | 120 | ||
112 | LINKSETS | 121 | LINKSETS |
113 | ====================================================== | 122 | ====================================================== |
123 | Editing a child of a linkset causes the child to go phantom | ||
124 | Move a child prim once when it is physical and can never move it again without it going phantom | ||
114 | Offset the center of the linkset to be the geometric center of all the prims | 125 | Offset the center of the linkset to be the geometric center of all the prims |
115 | Not quite the same as the center-of-gravity | 126 | Not quite the same as the center-of-gravity |
116 | Linksets should allow collisions to individual children | 127 | Linksets should allow collisions to individual children |
@@ -133,6 +144,10 @@ Eliminate collisions between objects in a linkset. (LinksetConstraint) | |||
133 | 144 | ||
134 | MORE | 145 | MORE |
135 | ====================================================== | 146 | ====================================================== |
147 | Create tests for different interface components | ||
148 | Have test objects/scripts measure themselves and turn color if correct/bad | ||
149 | Test functions in SL and calibrate correctness there | ||
150 | Create auto rezzer and tracker to run through the tests | ||
136 | Use the HACD convex hull routine in Bullet rather than the C# version. | 151 | Use the HACD convex hull routine in Bullet rather than the C# version. |
137 | Do we need to do convex hulls all the time? Can complex meshes be left meshes? | 152 | Do we need to do convex hulls all the time? Can complex meshes be left meshes? |
138 | There is some problem with meshes and collisions | 153 | There is some problem with meshes and collisions |
@@ -167,6 +182,7 @@ Enforce physical parameter min/max: | |||
167 | Restitution [0, 1] | 182 | Restitution [0, 1] |
168 | http://wiki.secondlife.com/wiki/Physics_Material_Settings_test | 183 | http://wiki.secondlife.com/wiki/Physics_Material_Settings_test |
169 | Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html | 184 | Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html |
185 | Keep avatar scaling correct. http://pennycow.blogspot.fr/2011/07/matter-of-scale.html | ||
170 | 186 | ||
171 | INTERNAL IMPROVEMENT/CLEANUP | 187 | INTERNAL IMPROVEMENT/CLEANUP |
172 | ================================================= | 188 | ================================================= |
@@ -287,4 +303,7 @@ Disable activity of passive linkset children. (DONE) | |||
287 | Since the linkset is a compound object, the old prims are left lying | 303 | Since the linkset is a compound object, the old prims are left lying |
288 | around and need to be phantomized so they don't collide, ... | 304 | around and need to be phantomized so they don't collide, ... |
289 | Remove HeightmapInfo from terrain specification (DONE) | 305 | Remove HeightmapInfo from terrain specification (DONE) |
290 | Since C++ code does not need terrain height, this structure et al are not needed. \ No newline at end of file | 306 | Since C++ code does not need terrain height, this structure et al are not needed. |
307 | Surfboard go wonky when turning (DONE) | ||
308 | Angular motor direction is global coordinates rather than local coordinates? | ||
309 | (Resolution: made angular motor direction correct coordinate system) \ No newline at end of file | ||