aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
diff options
context:
space:
mode:
authordan miller2007-09-29 03:56:36 +0000
committerdan miller2007-09-29 03:56:36 +0000
commita0265300aa09be0bdd2d4629d6a22394d5b219be (patch)
tree80653af30e29c664e4336896f8df239165073958 /OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
parent* Restored trunk (diff)
downloadopensim-SC_OLD-a0265300aa09be0bdd2d4629d6a22394d5b219be.zip
opensim-SC_OLD-a0265300aa09be0bdd2d4629d6a22394d5b219be.tar.gz
opensim-SC_OLD-a0265300aa09be0bdd2d4629d6a22394d5b219be.tar.bz2
opensim-SC_OLD-a0265300aa09be0bdd2d4629d6a22394d5b219be.tar.xz
Hollow prims (box only), thanks Gerard! Enjoy
Diffstat (limited to 'OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs')
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 6d8e1a8..af13d02 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -30,6 +30,7 @@
30#region References 30#region References
31using System; 31using System;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using OpenSim.Framework.Types;
33using OpenSim.Region.Physics.Manager; 34using OpenSim.Region.Physics.Manager;
34using Axiom.Math; 35using Axiom.Math;
35using AxiomQuaternion = Axiom.Math.Quaternion; 36using AxiomQuaternion = Axiom.Math.Quaternion;
@@ -252,7 +253,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
252 253
253 this._heightmap = new float[65536]; 254 this._heightmap = new float[65536];
254 } 255 }
255 public override PhysicsActor AddAvatar(PhysicsVector position) 256 public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
256 { 257 {
257 PhysicsVector pos = new PhysicsVector(); 258 PhysicsVector pos = new PhysicsVector();
258 pos.X = position.X; 259 pos.X = position.X;
@@ -276,7 +277,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
276 } 277 }
277 } 278 }
278 } 279 }
279 public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation) 280 PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation)
280 { 281 {
281 BulletXPrim newPrim = null; 282 BulletXPrim newPrim = null;
282 lock (BulletXLock) 283 lock (BulletXLock)
@@ -286,6 +287,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
286 } 287 }
287 return newPrim; 288 return newPrim;
288 } 289 }
290 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, PhysicsVector size, AxiomQuaternion rotation)
291 {
292 return AddPrim(position, size, rotation);
293 }
294
289 public override void RemovePrim(PhysicsActor prim) 295 public override void RemovePrim(PhysicsActor prim)
290 { 296 {
291 if (prim is BulletXPrim) 297 if (prim is BulletXPrim)
@@ -709,7 +715,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
709 { 715 {
710 _startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(pos); 716 _startTransform.Translation = BulletXMaths.PhysicsVectorToXnaVector3(pos);
711 //For now all prims are boxes 717 //For now all prims are boxes
712 CollisionShape _collisionShape = new BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_size) / 2.0f); 718 CollisionShape _collisionShape = new XnaDevRu.BulletX.BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_size) / 2.0f);
713 DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset); 719 DefaultMotionState _motionState = new DefaultMotionState(_startTransform, _centerOfMassOffset);
714 MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3(); 720 MonoXnaCompactMaths.Vector3 _localInertia = new MonoXnaCompactMaths.Vector3();
715 _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0 721 _collisionShape.CalculateLocalInertia(Mass, out _localInertia); //Always when mass > 0
@@ -912,7 +918,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
912 MonoXnaCompactMaths.Vector3 _newsize; 918 MonoXnaCompactMaths.Vector3 _newsize;
913 _newsize = BulletXMaths.PhysicsVectorToXnaVector3(_newSize); 919 _newsize = BulletXMaths.PhysicsVectorToXnaVector3(_newSize);
914 //For now all prims are Boxes 920 //For now all prims are Boxes
915 rigidBody.CollisionShape = new BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_newSize) / 2.0f); 921 rigidBody.CollisionShape = new XnaDevRu.BulletX.BoxShape(BulletXMaths.PhysicsVectorToXnaVector3(_newSize) / 2.0f);
916 } 922 }
917 private void ReOrient() 923 private void ReOrient()
918 { 924 {