aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs29
1 files changed, 21 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
index 4266fda..b9bb06e 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -115,12 +115,10 @@ namespace OpenSim.Region.Physics.OdePlugin
115 private CollisionCategories m_collisionCategories = (CollisionCategories.Character); 115 private CollisionCategories m_collisionCategories = (CollisionCategories.Character);
116 116
117 // Default, Collide with Other Geometries, spaces, bodies and characters. 117 // Default, Collide with Other Geometries, spaces, bodies and characters.
118 private CollisionCategories m_collisionFlags = (CollisionCategories.Geom 118 private CollisionCategories m_collisionFlags = (CollisionCategories.Character
119 | CollisionCategories.Space 119 | CollisionCategories.Geom
120 | CollisionCategories.Body
121 | CollisionCategories.Character
122 ); 120 );
123 // we do land collisions not ode | CollisionCategories.Land); 121 // we do land collisions not ode | CollisionCategories.Land);
124 public IntPtr Body = IntPtr.Zero; 122 public IntPtr Body = IntPtr.Zero;
125 private OdeScene _parent_scene; 123 private OdeScene _parent_scene;
126 public IntPtr Shell = IntPtr.Zero; 124 public IntPtr Shell = IntPtr.Zero;
@@ -639,6 +637,8 @@ namespace OpenSim.Region.Physics.OdePlugin
639 637
640 public override void SetMomentum(Vector3 momentum) 638 public override void SetMomentum(Vector3 momentum)
641 { 639 {
640 if (momentum.IsFinite())
641 AddChange(changes.Momentum, momentum);
642 } 642 }
643 643
644 644
@@ -663,8 +663,8 @@ namespace OpenSim.Region.Physics.OdePlugin
663 } 663 }
664 Shell = d.CreateCapsule(_parent_scene.ActiveSpace, CAPSULE_RADIUS, CAPSULE_LENGTH); 664 Shell = d.CreateCapsule(_parent_scene.ActiveSpace, CAPSULE_RADIUS, CAPSULE_LENGTH);
665 665
666 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); 666 d.GeomSetCategoryBits(Shell, (uint)m_collisionCategories);
667 d.GeomSetCollideBits(Shell, (int)m_collisionFlags); 667 d.GeomSetCollideBits(Shell, (uint)m_collisionFlags);
668 668
669 d.MassSetCapsule(out ShellMass, m_density, 3, CAPSULE_RADIUS, CAPSULE_LENGTH); 669 d.MassSetCapsule(out ShellMass, m_density, 3, CAPSULE_RADIUS, CAPSULE_LENGTH);
670 670
@@ -759,7 +759,6 @@ namespace OpenSim.Region.Physics.OdePlugin
759 _parent_scene.geom_name_map.Remove(Shell); 759 _parent_scene.geom_name_map.Remove(Shell);
760 _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); 760 _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace);
761 d.GeomDestroy(Shell); 761 d.GeomDestroy(Shell);
762 _parent_scene.geom_name_map.Remove(Shell);
763 Shell = IntPtr.Zero; 762 Shell = IntPtr.Zero;
764 } 763 }
765 } 764 }
@@ -1324,6 +1323,16 @@ namespace OpenSim.Region.Physics.OdePlugin
1324 } 1323 }
1325 } 1324 }
1326 1325
1326 // for now momentum is actually velocity
1327 private void changeMomentum(Vector3 newmomentum)
1328 {
1329 _velocity = newmomentum;
1330 _target_velocity = newmomentum;
1331 m_pidControllerActive = true;
1332 if (Body != IntPtr.Zero)
1333 d.BodySetLinearVel(Body, newmomentum.X, newmomentum.Y, newmomentum.Z);
1334 }
1335
1327 private void donullchange() 1336 private void donullchange()
1328 { 1337 {
1329 } 1338 }
@@ -1395,6 +1404,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1395 case changes.Size: 1404 case changes.Size:
1396 changeSize((Vector3)arg); 1405 changeSize((Vector3)arg);
1397 break; 1406 break;
1407
1408 case changes.Momentum:
1409 changeMomentum((Vector3)arg);
1410 break;
1398/* not in use for now 1411/* not in use for now
1399 case changes.Shape: 1412 case changes.Shape:
1400 changeShape((PrimitiveBaseShape)arg); 1413 changeShape((PrimitiveBaseShape)arg);