aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
authorRobert Adams2012-07-31 11:32:26 -0700
committerRobert Adams2012-07-31 16:23:48 -0700
commite38d26a2dc35ce7bf904c58200912a65c05aa39d (patch)
tree558c81cd622dffb233595d3115dbc5d2f176f998 /OpenSim/Region/Physics/BulletSPlugin
parentChange exception log messages in XInventoryService connector to error rather ... (diff)
downloadopensim-SC_OLD-e38d26a2dc35ce7bf904c58200912a65c05aa39d.zip
opensim-SC_OLD-e38d26a2dc35ce7bf904c58200912a65c05aa39d.tar.gz
opensim-SC_OLD-e38d26a2dc35ce7bf904c58200912a65c05aa39d.tar.bz2
opensim-SC_OLD-e38d26a2dc35ce7bf904c58200912a65c05aa39d.tar.xz
BulletSim: change boolean parameters in the shape data from int's to float's to be consistant with parameter data structure
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs8
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs10
2 files changed, 11 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 50d11e6..758acdc 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -187,6 +187,7 @@ public sealed class BSPrim : PhysicsActor
187 { 187 {
188 _mass = CalculateMass(); // changing size changes the mass 188 _mass = CalculateMass(); // changing size changes the mass
189 BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, (IsPhysical ? _mass : 0f), IsPhysical); 189 BulletSimAPI.SetObjectScaleMass(_scene.WorldID, _localID, _scale, (IsPhysical ? _mass : 0f), IsPhysical);
190 DetailLog("{0}: setSize: size={1}, mass={2}, physical={3}", LocalID, _size, _mass, IsPhysical);
190 RecreateGeomAndObject(); 191 RecreateGeomAndObject();
191 }); 192 });
192 } 193 }
@@ -1201,7 +1202,8 @@ public sealed class BSPrim : PhysicsActor
1201 1202
1202 // Create an object in Bullet if it has not already been created 1203 // Create an object in Bullet if it has not already been created
1203 // No locking here because this is done when the physics engine is not simulating 1204 // No locking here because this is done when the physics engine is not simulating
1204 private void CreateObject() 1205 // Returns 'true' if an object was actually created.
1206 private bool CreateObject()
1205 { 1207 {
1206 // this routine is called when objects are rebuilt. 1208 // this routine is called when objects are rebuilt.
1207 1209
@@ -1209,10 +1211,12 @@ public sealed class BSPrim : PhysicsActor
1209 ShapeData shape; 1211 ShapeData shape;
1210 FillShapeInfo(out shape); 1212 FillShapeInfo(out shape);
1211 // m_log.DebugFormat("{0}: CreateObject: lID={1}, shape={2}", LogHeader, _localID, shape.Type); 1213 // m_log.DebugFormat("{0}: CreateObject: lID={1}, shape={2}", LogHeader, _localID, shape.Type);
1212 BulletSimAPI.CreateObject(_scene.WorldID, shape); 1214 bool ret = BulletSimAPI.CreateObject(_scene.WorldID, shape);
1213 1215
1214 // the CreateObject() may have recreated the rigid body. Make sure we have the latest. 1216 // the CreateObject() may have recreated the rigid body. Make sure we have the latest.
1215 m_body.Ptr = BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID); 1217 m_body.Ptr = BulletSimAPI.GetBodyHandle2(_scene.World.Ptr, LocalID);
1218
1219 return ret;
1216 } 1220 }
1217 1221
1218 // Copy prim's info into the BulletSim shape description structure 1222 // Copy prim's info into the BulletSim shape description structure
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index fe705cc..0ffbc94 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -87,12 +87,12 @@ public struct ShapeData
87 public System.UInt64 MeshKey; 87 public System.UInt64 MeshKey;
88 public float Friction; 88 public float Friction;
89 public float Restitution; 89 public float Restitution;
90 public int Collidable; 90 public float Collidable; // true of things bump into this
91 public int Static; // true if a static object. Otherwise gravity, etc. 91 public float Static; // true if a static object. Otherwise gravity, etc.
92 92
93 // note that bools are passed as ints since bool size changes by language and architecture 93 // note that bools are passed as floats since bool size changes by language and architecture
94 public const int numericTrue = 1; 94 public const float numericTrue = 1f;
95 public const int numericFalse = 0; 95 public const float numericFalse = 0f;
96} 96}
97[StructLayout(LayoutKind.Sequential)] 97[StructLayout(LayoutKind.Sequential)]
98public struct SweepHit 98public struct SweepHit