From 27e028752600921deac57e281f1df6d8c7310c5d Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 19 Dec 2007 22:42:06 +0000 Subject: * Re-did the mass calculations in ODE for Prim * Exposed the mass as a PhysicsActor read only property (so scripts can get at it - hint hint -) * Hollow and Path Cuts affect the prim mass (all Hollow Types are supported in this calculation (sphere,square,triangle)) * Prim no longer sink into the ground. --- .../Region/Physics/BulletXPlugin/BulletXPlugin.cs | 46 ++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/BulletXPlugin') diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 1760e50..5602301 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -511,10 +511,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin GC.Collect(); } } + public override void AddPhysicsActorTaint(PhysicsActor prim) { } + public override float Simulate(float timeStep) { float fps = 0; @@ -735,11 +737,13 @@ namespace OpenSim.Region.Physics.BulletXPlugin } } } + public override PhysicsVector RotationalVelocity { get { return m_rotationalVelocity; } set { m_rotationalVelocity = value; } } + public override PhysicsVector Velocity { get { return _velocity; } @@ -760,12 +764,28 @@ namespace OpenSim.Region.Physics.BulletXPlugin } } } + public override PhysicsVector Size { get { return _size; } set { lock (BulletXScene.BulletXLock) { _size = value; } } } + public override PhysicsVector Force + { + get { return PhysicsVector.Zero; } + } + + public override PhysicsVector CenterOfMass + { + get { return PhysicsVector.Zero; } + } + + public override PhysicsVector GeometricCenter + { + get { return PhysicsVector.Zero; } + } + public override PrimitiveBaseShape Shape { set @@ -773,15 +793,18 @@ namespace OpenSim.Region.Physics.BulletXPlugin return; } } + public override bool SetAlwaysRun { get { return false; } set { return; } } + public override PhysicsVector Acceleration { get { return _acceleration; } } + public override AxiomQuaternion Orientation { get { return _orientation; } @@ -794,10 +817,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin } } } - public virtual float Mass + + public override float Mass { - get { return 0; } + get { return ActorMass; } + } + + public virtual float ActorMass + { + get { return 0; } } + public override int PhysicsActorType { get { return (int) m_PhysicsActorType; } @@ -808,6 +838,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin { get { return rigidBody; } } + public Vector3 RigidBodyPosition { get { return this.rigidBody.CenterOfMassPosition; } @@ -829,21 +860,25 @@ namespace OpenSim.Region.Physics.BulletXPlugin get { return false; } set { return; } } + public override bool IsColliding { get { return iscolliding; } set { iscolliding = value; } } + public override bool CollidingGround { get { return false; } set { return; } } + public override bool CollidingObj { get { return false; } set { return; } } + public virtual void SetAcceleration(PhysicsVector accel) { lock (BulletXScene.BulletXLock) @@ -851,6 +886,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin _acceleration = accel; } } + public override bool Kinematic { get @@ -862,16 +898,20 @@ namespace OpenSim.Region.Physics.BulletXPlugin } } + public override void AddForce(PhysicsVector force) { } + public override void SetMomentum(PhysicsVector momentum) { } + internal virtual void ValidateHeight(float heighmapPositionValue) { } + internal virtual void UpdateKinetics() { } @@ -1176,7 +1216,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin get { return base.Orientation; } set { base.Orientation = value; } } - public override float Mass + public override float ActorMass { get { -- cgit v1.1