ODEPlugin

* Added osSetPrimFloatOnWater(BOOL) to make Physical prim float at the water level.   
* osSetPrimFloatOnWater(TRUE); or osSetPrimFloatOnWater(FALSE);
* By default, prim do not float at the water level.
* More work is needed on the floating, but it's a start.
0.6.0-stable
Teravus Ovares 2008-03-10 05:56:58 +00:00
parent 8bea3dbdb9
commit d0123a796b
11 changed files with 111 additions and 0 deletions

View File

@ -942,6 +942,22 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void SetFloatOnWater(int floatYN)
{
if (PhysActor != null)
{
if (floatYN == 1)
{
PhysActor.FloatOnWater = true;
}
else
{
PhysActor.FloatOnWater = false;
}
}
}
public LLVector3 GetSitTargetPositionLL()
{
return new LLVector3(m_sitTargetPosition.x, m_sitTargetPosition.y, m_sitTargetPosition.z);

View File

@ -254,6 +254,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }

View File

@ -930,6 +930,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public virtual void SetAcceleration(PhysicsVector accel)
{
lock (BulletXScene.BulletXLock)

View File

@ -204,6 +204,8 @@ namespace OpenSim.Region.Physics.Manager
public abstract bool CollidingGround { get; set; }
public abstract bool CollidingObj { get; set; }
public abstract bool FloatOnWater { set; }
public abstract PhysicsVector RotationalVelocity { get; set; }
public abstract bool Kinematic { get; set; }
@ -256,6 +258,12 @@ namespace OpenSim.Region.Physics.Manager
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool CollidingGround
{
get { return false; }

View File

@ -185,6 +185,11 @@ namespace OpenSim.Region.Physics.OdePlugin
set { m_buoyancy = value; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }

View File

@ -73,6 +73,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public bool m_disabled = false;
public bool m_taintadd = false;
public bool m_taintselected = false;
public bool m_taintCollidesWater = false;
public uint m_localID = 0;
@ -739,6 +740,11 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_taintparent != _parent)
changelink(timestep);
if (m_taintCollidesWater != m_collidesWater)
changefloatonwater(timestep);
}
else
{
@ -1333,6 +1339,24 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintsize = _size;
}
public void changefloatonwater(float timestep)
{
m_collidesWater = m_taintCollidesWater;
if (prim_geom != (IntPtr)0)
{
if (m_collidesWater)
{
m_collisionFlags |= CollisionCategories.Water;
}
else
{
m_collisionFlags &= ~CollisionCategories.Water;
}
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
}
}
public void changeshape(float timestamp)
{
@ -1895,6 +1919,14 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public override bool FloatOnWater
{
set {
m_taintCollidesWater = value;
_parent_scene.AddPhysicsActorTaint(this);
}
}
public override void SetMomentum(PhysicsVector momentum)
{
}

View File

@ -383,6 +383,11 @@ namespace OpenSim.Region.Physics.POSPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }
@ -622,6 +627,11 @@ namespace OpenSim.Region.Physics.POSPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override PhysicsVector Velocity
{
get { return _velocity; }

View File

@ -253,6 +253,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool IsPhysical
{
get { return false; }
@ -484,6 +489,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
set { return; }
}
public override bool FloatOnWater
{
set { return; }
}
public override bool ThrottleUpdates
{
get { return false; }

View File

@ -1897,6 +1897,11 @@ namespace OpenSim.Region.ScriptEngine.Common
m_LSL_Functions.osSetParcelMediaURL(url);
}
public void osSetPrimFloatOnWater(int floatYN)
{
m_LSL_Functions.osSetPrimFloatOnWater(floatYN);
}
public double llList2Float(LSL_Types.list src, int index)
{
return m_LSL_Functions.llList2Float(src, index);

View File

@ -1508,6 +1508,8 @@ namespace OpenSim.Region.ScriptEngine.Common
}
}
public void llSetHoverHeight(double height, int water, double tau)
{
m_host.AddScriptLPS(1);
@ -4405,6 +4407,18 @@ namespace OpenSim.Region.ScriptEngine.Common
return false;
}
public void osSetPrimFloatOnWater(int floatYN)
{
m_host.AddScriptLPS(1);
if (m_host.ParentGroup != null)
{
if (m_host.ParentGroup.RootPart != null)
{
m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN);
}
}
}
private void NotImplemented(string command)
{
m_host.AddScriptLPS(1);

View File

@ -648,6 +648,7 @@ namespace OpenSim.Region.ScriptEngine.Common
void osRegionNotice(string msg);
bool osConsoleCommand(string Command);
void osSetParcelMediaURL(string url);
void osSetPrimFloatOnWater(int floatYN);
}
}