diff options
author | Robert Adams | 2012-11-24 20:15:07 -0800 |
---|---|---|
committer | Robert Adams | 2012-11-25 20:04:29 -0800 |
commit | 980edabc2e9c3563a27f76bc6d8dcc88a59568a1 (patch) | |
tree | b234308154a10c3c5a9c5cd9757a957a2bc9fb1f /OpenSim/Region/Physics/BulletSPlugin | |
parent | BulletSim: small change to add position correction force with AddForce rather... (diff) | |
download | opensim-SC_OLD-980edabc2e9c3563a27f76bc6d8dcc88a59568a1.zip opensim-SC_OLD-980edabc2e9c3563a27f76bc6d8dcc88a59568a1.tar.gz opensim-SC_OLD-980edabc2e9c3563a27f76bc6d8dcc88a59568a1.tar.bz2 opensim-SC_OLD-980edabc2e9c3563a27f76bc6d8dcc88a59568a1.tar.xz |
BulletSim: clean up TODO list. It is kept somewhere wlse that should be more public. Add error logging for the detail log writer so a message is output when it cannot write to the specified logging directory. Modify friction defaults to be closer to ODE's values. Add new collision margin and vehicle angular damping parameters.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 33 |
2 files changed, 17 insertions, 18 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index a121c3d..7fd7b82 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -525,7 +525,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
525 | BulletSimAPI.SetFriction2(Prim.PhysBody.ptr, 0f); | 525 | BulletSimAPI.SetFriction2(Prim.PhysBody.ptr, 0f); |
526 | BulletSimAPI.SetHitFraction2(Prim.PhysBody.ptr, 0f); | 526 | BulletSimAPI.SetHitFraction2(Prim.PhysBody.ptr, 0f); |
527 | 527 | ||
528 | BulletSimAPI.SetAngularDamping2(Prim.PhysBody.ptr, 0.8f); | 528 | BulletSimAPI.SetAngularDamping2(Prim.PhysBody.ptr, PhysicsScene.Params.vehicleAngularDamping); |
529 | 529 | ||
530 | BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, new Vector3(1f, 1f, 1f)); | 530 | BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, new Vector3(1f, 1f, 1f)); |
531 | 531 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 37bdb84..333247f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -39,23 +39,10 @@ using log4net; | |||
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | 40 | ||
41 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) | 41 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) |
42 | // Test sculpties (verified that they don't work) | ||
43 | // Compute physics FPS reasonably | ||
44 | // Based on material, set density and friction | 42 | // Based on material, set density and friction |
45 | // Don't use constraints in linksets of non-physical objects. Means having to move children manually. | ||
46 | // Four states of prim: Physical, regular, phantom and selected. Are we modeling these correctly? | ||
47 | // In SL one can set both physical and phantom (gravity, does not effect others, makes collisions with ground) | ||
48 | // At the moment, physical and phantom causes object to drop through the terrain | ||
49 | // Physical phantom objects and related typing (collision options ) | ||
50 | // Check out llVolumeDetect. Must do something for that. | ||
51 | // Use collision masks for collision with terrain and phantom objects | ||
52 | // More efficient memory usage when passing hull information from BSPrim to BulletSim | 43 | // More efficient memory usage when passing hull information from BSPrim to BulletSim |
53 | // Should prim.link() and prim.delink() membership checking happen at taint time? | ||
54 | // Mesh sharing. Use meshHash to tell if we already have a hull of that shape and only create once. | ||
55 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect | 44 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect |
56 | // Implement LockAngularMotion | 45 | // Implement LockAngularMotion |
57 | // Decide if clearing forces is the right thing to do when setting position (BulletSim::SetObjectTranslation) | ||
58 | // Remove mesh and Hull stuff. Use mesh passed to bullet and use convexdecom from bullet. | ||
59 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? | 46 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? |
60 | // Check terrain size. 128 or 127? | 47 | // Check terrain size. 128 or 127? |
61 | // Raycast | 48 | // Raycast |
@@ -234,6 +221,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
234 | if (m_physicsLoggingEnabled) | 221 | if (m_physicsLoggingEnabled) |
235 | { | 222 | { |
236 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); | 223 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); |
224 | PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output error messages. | ||
237 | } | 225 | } |
238 | else | 226 | else |
239 | { | 227 | { |
@@ -1076,7 +1064,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1076 | (s,p,l,v) => { s.PID_P = v; } ), | 1064 | (s,p,l,v) => { s.PID_P = v; } ), |
1077 | 1065 | ||
1078 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", | 1066 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", |
1079 | 0.5f, | 1067 | 0.2f, |
1080 | (s,cf,p,v) => { s.m_params[0].defaultFriction = cf.GetFloat(p, v); }, | 1068 | (s,cf,p,v) => { s.m_params[0].defaultFriction = cf.GetFloat(p, v); }, |
1081 | (s) => { return s.m_params[0].defaultFriction; }, | 1069 | (s) => { return s.m_params[0].defaultFriction; }, |
1082 | (s,p,l,v) => { s.m_params[0].defaultFriction = v; } ), | 1070 | (s,p,l,v) => { s.m_params[0].defaultFriction = v; } ), |
@@ -1091,7 +1079,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1091 | (s) => { return s.m_params[0].defaultRestitution; }, | 1079 | (s) => { return s.m_params[0].defaultRestitution; }, |
1092 | (s,p,l,v) => { s.m_params[0].defaultRestitution = v; } ), | 1080 | (s,p,l,v) => { s.m_params[0].defaultRestitution = v; } ), |
1093 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", | 1081 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", |
1094 | 0f, | 1082 | 0.04f, |
1095 | (s,cf,p,v) => { s.m_params[0].collisionMargin = cf.GetFloat(p, v); }, | 1083 | (s,cf,p,v) => { s.m_params[0].collisionMargin = cf.GetFloat(p, v); }, |
1096 | (s) => { return s.m_params[0].collisionMargin; }, | 1084 | (s) => { return s.m_params[0].collisionMargin; }, |
1097 | (s,p,l,v) => { s.m_params[0].collisionMargin = v; } ), | 1085 | (s,p,l,v) => { s.m_params[0].collisionMargin = v; } ), |
@@ -1158,7 +1146,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1158 | (s) => { return s.m_params[0].terrainImplementation; }, | 1146 | (s) => { return s.m_params[0].terrainImplementation; }, |
1159 | (s,p,l,v) => { s.m_params[0].terrainImplementation = v; } ), | 1147 | (s,p,l,v) => { s.m_params[0].terrainImplementation = v; } ), |
1160 | new ParameterDefn("TerrainFriction", "Factor to reduce movement against terrain surface" , | 1148 | new ParameterDefn("TerrainFriction", "Factor to reduce movement against terrain surface" , |
1161 | 0.5f, | 1149 | 0.3f, |
1162 | (s,cf,p,v) => { s.m_params[0].terrainFriction = cf.GetFloat(p, v); }, | 1150 | (s,cf,p,v) => { s.m_params[0].terrainFriction = cf.GetFloat(p, v); }, |
1163 | (s) => { return s.m_params[0].terrainFriction; }, | 1151 | (s) => { return s.m_params[0].terrainFriction; }, |
1164 | (s,p,l,v) => { s.m_params[0].terrainFriction = v; /* TODO: set on real terrain */} ), | 1152 | (s,p,l,v) => { s.m_params[0].terrainFriction = v; /* TODO: set on real terrain */} ), |
@@ -1172,13 +1160,19 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1172 | (s,cf,p,v) => { s.m_params[0].terrainRestitution = cf.GetFloat(p, v); }, | 1160 | (s,cf,p,v) => { s.m_params[0].terrainRestitution = cf.GetFloat(p, v); }, |
1173 | (s) => { return s.m_params[0].terrainRestitution; }, | 1161 | (s) => { return s.m_params[0].terrainRestitution; }, |
1174 | (s,p,l,v) => { s.m_params[0].terrainRestitution = v; /* TODO: set on real terrain */ } ), | 1162 | (s,p,l,v) => { s.m_params[0].terrainRestitution = v; /* TODO: set on real terrain */ } ), |
1163 | new ParameterDefn("TerrainCollisionMargin", "Margin where collision checking starts" , | ||
1164 | 0.04f, | ||
1165 | (s,cf,p,v) => { s.m_params[0].terrainCollisionMargin = cf.GetFloat(p, v); }, | ||
1166 | (s) => { return s.m_params[0].terrainCollisionMargin; }, | ||
1167 | (s,p,l,v) => { s.m_params[0].terrainCollisionMargin = v; /* TODO: set on real terrain */ } ), | ||
1168 | |||
1175 | new ParameterDefn("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", | 1169 | new ParameterDefn("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", |
1176 | 0.2f, | 1170 | 0.2f, |
1177 | (s,cf,p,v) => { s.m_params[0].avatarFriction = cf.GetFloat(p, v); }, | 1171 | (s,cf,p,v) => { s.m_params[0].avatarFriction = cf.GetFloat(p, v); }, |
1178 | (s) => { return s.m_params[0].avatarFriction; }, | 1172 | (s) => { return s.m_params[0].avatarFriction; }, |
1179 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarFriction, p, l, v); } ), | 1173 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarFriction, p, l, v); } ), |
1180 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", | 1174 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", |
1181 | 10f, | 1175 | 0.99f, |
1182 | (s,cf,p,v) => { s.m_params[0].avatarStandingFriction = cf.GetFloat(p, v); }, | 1176 | (s,cf,p,v) => { s.m_params[0].avatarStandingFriction = cf.GetFloat(p, v); }, |
1183 | (s) => { return s.m_params[0].avatarStandingFriction; }, | 1177 | (s) => { return s.m_params[0].avatarStandingFriction; }, |
1184 | (s,p,l,v) => { s.m_params[0].avatarStandingFriction = v; } ), | 1178 | (s,p,l,v) => { s.m_params[0].avatarStandingFriction = v; } ), |
@@ -1213,6 +1207,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1213 | (s) => { return s.m_params[0].avatarContactProcessingThreshold; }, | 1207 | (s) => { return s.m_params[0].avatarContactProcessingThreshold; }, |
1214 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarContactProcessingThreshold, p, l, v); } ), | 1208 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarContactProcessingThreshold, p, l, v); } ), |
1215 | 1209 | ||
1210 | new ParameterDefn("vehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", | ||
1211 | 0.8f, | ||
1212 | (s,cf,p,v) => { s.m_params[0].vehicleAngularDamping = cf.GetFloat(p, v); }, | ||
1213 | (s) => { return s.m_params[0].vehicleAngularDamping; }, | ||
1214 | (s,p,l,v) => { s.m_params[0].vehicleAngularDamping = v; } ), | ||
1216 | 1215 | ||
1217 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", | 1216 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", |
1218 | 0f, | 1217 | 0f, |