aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs30
1 files changed, 5 insertions, 25 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 8dd48ca..8ce960d 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -171,6 +171,10 @@ public sealed class BSPrim : BSPhysObject
171 ForceBodyShapeRebuild(false); 171 ForceBodyShapeRebuild(false);
172 } 172 }
173 } 173 }
174 // Whatever the linkset wants is what I want.
175 public override ShapeData.PhysicsShapeType PreferredPhysicalShape
176 { get { return Linkset.PreferredPhysicalShape; } }
177
174 public override bool ForceBodyShapeRebuild(bool inTaintTime) 178 public override bool ForceBodyShapeRebuild(bool inTaintTime)
175 { 179 {
176 LastAssetBuildFailed = false; 180 LastAssetBuildFailed = false;
@@ -1310,34 +1314,11 @@ public sealed class BSPrim : BSPhysObject
1310 }// end CalculateMass 1314 }// end CalculateMass
1311 #endregion Mass Calculation 1315 #endregion Mass Calculation
1312 1316
1313 // Copy prim's info into the BulletSim shape description structure
1314 public void FillShapeInfo(out ShapeData shape)
1315 {
1316 shape.ID = LocalID;
1317 shape.Type = ShapeData.PhysicsShapeType.SHAPE_UNKNOWN;
1318 shape.Position = _position;
1319 shape.Rotation = _orientation;
1320 shape.Velocity = _velocity;
1321 shape.Size = _size;
1322 shape.Scale = Scale;
1323 shape.Mass = _isPhysical ? _mass : 0f;
1324 shape.Buoyancy = _buoyancy;
1325 shape.HullKey = 0;
1326 shape.MeshKey = 0;
1327 shape.Friction = _friction;
1328 shape.Restitution = _restitution;
1329 shape.Collidable = (!IsPhantom) ? ShapeData.numericTrue : ShapeData.numericFalse;
1330 shape.Static = _isPhysical ? ShapeData.numericFalse : ShapeData.numericTrue;
1331 shape.Solid = IsSolid ? ShapeData.numericFalse : ShapeData.numericTrue;
1332 }
1333 // Rebuild the geometry and object. 1317 // Rebuild the geometry and object.
1334 // This is called when the shape changes so we need to recreate the mesh/hull. 1318 // This is called when the shape changes so we need to recreate the mesh/hull.
1335 // Called at taint-time!!! 1319 // Called at taint-time!!!
1336 private void CreateGeomAndObject(bool forceRebuild) 1320 private void CreateGeomAndObject(bool forceRebuild)
1337 { 1321 {
1338 ShapeData shapeData;
1339 FillShapeInfo(out shapeData);
1340
1341 // If this prim is part of a linkset, we must remove and restore the physical 1322 // If this prim is part of a linkset, we must remove and restore the physical
1342 // links if the body is rebuilt. 1323 // links if the body is rebuilt.
1343 bool needToRestoreLinkset = false; 1324 bool needToRestoreLinkset = false;
@@ -1346,8 +1327,7 @@ public sealed class BSPrim : BSPhysObject
1346 // Updates BSBody and BSShape with the new information. 1327 // Updates BSBody and BSShape with the new information.
1347 // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary. 1328 // Ignore 'forceRebuild'. This routine makes the right choices and changes of necessary.
1348 // Returns 'true' if either the body or the shape was changed. 1329 // Returns 'true' if either the body or the shape was changed.
1349 PhysicsScene.Shapes.GetBodyAndShape(false, PhysicsScene.World, this, shapeData, BaseShape, 1330 PhysicsScene.Shapes.GetBodyAndShape(false, PhysicsScene.World, this, null, delegate(BulletBody dBody)
1350 null, delegate(BulletBody dBody)
1351 { 1331 {
1352 // Called if the current prim body is about to be destroyed. 1332 // Called if the current prim body is about to be destroyed.
1353 // Remove all the physical dependencies on the old body. 1333 // Remove all the physical dependencies on the old body.