aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs7
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs12
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs6
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs6
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs58
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt25
6 files changed, 76 insertions, 38 deletions
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 e434412..6601479 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -1160,8 +1160,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1160 if (!Prim.IsColliding && VehicleVelocity.Z > 0.1) 1160 if (!Prim.IsColliding && VehicleVelocity.Z > 0.1)
1161 { 1161 {
1162 // 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.
1163 VehicleVelocity += new Vector3(0, 0, -VehicleVelocity.Z); 1163 float upVelocity = VehicleVelocity.Z;
1164 VehicleVelocity += new Vector3(0, 0, -upVelocity);
1164 1165
1166 /*
1165 // 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
1166 Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation; 1168 Vector3 pointingDirection = Vector3.UnitX * VehicleOrientation;
1167 // The rotation around the Y axis is pitch up or down 1169 // The rotation around the Y axis is pitch up or down
@@ -1175,11 +1177,9 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1175 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}",
1176 Prim.LocalID, VehicleVelocity, pointingDirection, angularCorrectionForce, angularCorrectionVector); 1178 Prim.LocalID, VehicleVelocity, pointingDirection, angularCorrectionForce, angularCorrectionVector);
1177 } 1179 }
1178 else 1180 */
1179 { 1181 VDetailLog("{0}, MoveLinear,limitMotorUp,collide={1},upVel={2},newVel={3}",
1180 VDetailLog("{0}, MoveLinear,limitMotorUp,newVel={1},pntDir={2}", 1182 Prim.LocalID, Prim.IsColliding, upVelocity, VehicleVelocity);
1181 Prim.LocalID, VehicleVelocity, pointingDirection);
1182 }
1183 } 1183 }
1184 } 1184 }
1185 } 1185 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 2dc89b5..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.
@@ -311,7 +311,7 @@ public sealed class BSLinksetCompound : BSLinkset
311 else 311 else
312 { 312 {
313 // Rebuild the compound shape with the child removed 313 // Rebuild the compound shape with the child removed
314 ScheduleRebuild(child); 314 ScheduleRebuild(LinksetRoot);
315 } 315 }
316 } 316 }
317 return; 317 return;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 862dbf6..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);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapeCollection.cs
index 838c845..473ef10 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 @@
1CURRENT PRIORITIES 1CURRENT PRIORITIES
2================================================= 2=================================================
3Mantis 6040 script http://opensimulator.org/mantis/view.php?id=6040
4 Msg Kayaker on OSGrid when working
5Teravus llMoveToTarget script debug
6 Mixing of hover, buoyancy/gravity, moveToTarget, into one force
7Boats floating at proper level
3Nebadon vehicles turning funny in arena 8Nebadon vehicles turning funny in arena
4limitMotorUp calibration (more down?) 9limitMotorUp calibration (more down?)
10llRotLookAt
11llLookAt
5Vehicle angular vertical attraction 12Vehicle angular vertical attraction
6Vehicle angular deflection 13Vehicle angular deflection
7 Preferred orientation angular correction fix 14 Preferred orientation angular correction fix
@@ -9,8 +16,6 @@ vehicle angular banking
9Avatars walking up stairs (HALF DONE) 16Avatars 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.
11Vehicle movement on terrain smoothness 18Vehicle movement on terrain smoothness
12Surfboard go wonky when turning
13 Angular motor direction is global coordinates rather than local coordinates?
14Boats float low in the water (DONE) 19Boats float low in the water (DONE)
15Avatar movement 20Avatar 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
28CRASHES 33CRASHES
29================================================= 34=================================================
35Crazyness 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.
3020121129.1411: editting/moving phys object across region boundries causes crash 3920121129.1411: editting/moving phys object across region boundries causes crash
31 getPos-> btRigidBody::upcast -> getBodyType -> BOOM 40 getPos-> btRigidBody::upcast -> getBodyType -> BOOM
3220121128.1600: mesh object not rezzing (no physics mesh). 4120121128.1600: mesh object not rezzing (no physics mesh).
@@ -111,6 +120,8 @@ Physical and phantom will drop through the terrain
111 120
112LINKSETS 121LINKSETS
113====================================================== 122======================================================
123Editing 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
114Offset the center of the linkset to be the geometric center of all the prims 125Offset 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
116Linksets should allow collisions to individual children 127Linksets should allow collisions to individual children
@@ -133,6 +144,10 @@ Eliminate collisions between objects in a linkset. (LinksetConstraint)
133 144
134MORE 145MORE
135====================================================== 146======================================================
147Create 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
136Use the HACD convex hull routine in Bullet rather than the C# version. 151Use the HACD convex hull routine in Bullet rather than the C# version.
137Do we need to do convex hulls all the time? Can complex meshes be left meshes? 152Do 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
169Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html 184Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html
185Keep avatar scaling correct. http://pennycow.blogspot.fr/2011/07/matter-of-scale.html
170 186
171INTERNAL IMPROVEMENT/CLEANUP 187INTERNAL 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, ...
289Remove HeightmapInfo from terrain specification (DONE) 305Remove 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.
307Surfboard 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