From 27508c1ad87786935dbf28aa217bcbe55a9aa645 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 23 Feb 2008 11:42:55 +0000 Subject: * Added Support within the ODEPlugin for Selected. Which means that; * When you select a physical prim, it stops while you've got it selected. * When you move or alter a prim in some manner, it doesn't become collidable until you de-select it * When you select a prim, it doesn't become temporarily 'phantom' until you make some change to it while it's selected. (this prevents accidental selections in prim floor from causing it to go phantom on you(but don't move it or you'll fall)) * There's one major difference, and that's a physical object won't stop if you don't have permission to edit it. This prevents people who don't have edit permissions on a prim from stopping it while it's moving. --- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 499422f..2efca3b 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -87,6 +87,8 @@ namespace OpenSim.Region.Physics.OdePlugin private bool m_hackSentFall = false; private bool m_hackSentFly = false; private bool m_foundDebian = false; + public uint m_localID = 0; + private CollisionLocker ode; private string m_name = String.Empty; @@ -94,6 +96,15 @@ namespace OpenSim.Region.Physics.OdePlugin private bool[] m_colliderarr = new bool[11]; private bool[] m_colliderGroundarr = new bool[11]; + // Default we're a Character + private CollisionCategories m_collisionCategories = (CollisionCategories.Character); + + // Default, Collide with Other Geometries, spaces, bodies and characters. + private CollisionCategories m_collisionFlags = (CollisionCategories.Geom + | CollisionCategories.Space + | CollisionCategories.Body + | CollisionCategories.Character + | CollisionCategories.Land); private bool jumping = false; //private float gravityAccel; @@ -157,6 +168,11 @@ namespace OpenSim.Region.Physics.OdePlugin set { m_alwaysRun = value; } } + public override uint LocalID + { + set { m_localID = value; } + } + public override bool Grabbed { set { return; } @@ -404,6 +420,10 @@ namespace OpenSim.Region.Physics.OdePlugin int dAMotorEuler = 1; _parent_scene.waitForSpaceUnlock(_parent_scene.space); Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); + + d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); + d.GeomSetCollideBits(Shell, (int)m_collisionFlags); + d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); Body = d.BodyCreate(_parent_scene.world); d.BodySetPosition(Body, npositionX, npositionY, npositionZ); -- cgit v1.1