Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork

avinationmerge
Melanie 2012-09-28 00:15:58 +02:00
commit f05ca1a0fe
5 changed files with 147 additions and 57 deletions

View File

@ -75,6 +75,10 @@ namespace OpenSim.Framework.Servers.Tests
/// </summary> /// </summary>
public event EventHandler<RequestEventArgs> RequestReceived = delegate { }; public event EventHandler<RequestEventArgs> RequestReceived = delegate { };
public bool CanSend { get { return true; } }
public string RemoteEndPoint { get { return ""; } }
public string RemoteEndPointAddress { get { return ""; } }
public string RemoteEndPointPort { get { return ""; } }
} }
public class TestHttpRequest: IHttpRequest public class TestHttpRequest: IHttpRequest

View File

@ -161,9 +161,6 @@ namespace OpenSim.Region.Physics.OdePlugin
private List<OdePrim> childrenPrim = new List<OdePrim>(); private List<OdePrim> childrenPrim = new List<OdePrim>();
// private bool m_throttleUpdates;
// private int throttleCounter;
public float m_collisionscore; public float m_collisionscore;
private int m_colliderfilter = 0; private int m_colliderfilter = 0;
@ -175,7 +172,7 @@ namespace OpenSim.Region.Physics.OdePlugin
private bool m_lastUpdateSent; private bool m_lastUpdateSent;
public IntPtr Body = IntPtr.Zero; public IntPtr Body = IntPtr.Zero;
// public String Name { get; private set; }
private Vector3 _target_velocity; private Vector3 _target_velocity;
public Vector3 primOOBsize; // prim real dimensions from mesh public Vector3 primOOBsize; // prim real dimensions from mesh
@ -366,12 +363,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public override bool ThrottleUpdates {get;set;} public override bool ThrottleUpdates {get;set;}
/*
{
get { return m_throttleUpdates; }
set { m_throttleUpdates = value; }
}
*/
public override bool Stopped public override bool Stopped
{ {
get { return _zeroFlag; } get { return _zeroFlag; }
@ -418,7 +410,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public override Vector3 Force public override Vector3 Force
{ {
//get { return Vector3.Zero; }
get { return m_force; } get { return m_force; }
set set
{ {
@ -673,7 +664,7 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return m_buoyancy; } get { return m_buoyancy; }
set set
{ {
m_buoyancy = value; AddChange(changes.Buoyancy,value);
} }
} }
@ -691,28 +682,35 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
if (value.IsFinite()) if (value.IsFinite())
{ {
m_PIDTarget = value; AddChange(changes.PIDTarget,value);
} }
else else
m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name); m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name);
} }
} }
public override bool PIDActive { set { m_usePID = value; } } public override bool PIDActive
{
set
{
AddChange(changes.PIDActive,value);
}
}
public override float PIDTau public override float PIDTau
{ {
set set
{ {
if (value <= 0) float tmp = 0;
m_PIDTau = 0; if (value > 0)
else
{ {
float mint = (0.05f > m_timeStep ? 0.05f : m_timeStep); float mint = (0.05f > m_timeStep ? 0.05f : m_timeStep);
if (value < mint) if (value < mint)
m_PIDTau = mint; tmp = mint;
else else
m_PIDTau = value; tmp = value;
} }
AddChange(changes.PIDTau,tmp);
} }
} }
@ -720,27 +718,39 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
set set
{ {
m_PIDHoverHeight = value; AddChange(changes.PIDHoverHeight,value);
if (value == 0)
m_useHoverPID = false;
} }
} }
public override bool PIDHoverActive { set { m_useHoverPID = value; } } public override bool PIDHoverActive
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } } {
set
{
AddChange(changes.PIDHoverActive, value);
}
}
public override PIDHoverType PIDHoverType
{
set
{
AddChange(changes.PIDHoverType,value);
}
}
public override float PIDHoverTau public override float PIDHoverTau
{ {
set set
{ {
if (value <= 0) float tmp =0;
m_PIDHoverTau = 0; if (value > 0)
else
{ {
float mint = (0.05f > m_timeStep ? 0.05f : m_timeStep); float mint = (0.05f > m_timeStep ? 0.05f : m_timeStep);
if (value < mint) if (value < mint)
m_PIDHoverTau = mint; tmp = mint;
else else
m_PIDHoverTau = value; tmp = value;
} }
AddChange(changes.PIDHoverTau, tmp);
} }
} }
@ -981,7 +991,6 @@ namespace OpenSim.Region.Physics.OdePlugin
return false; return false;
} }
public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size,
Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID) Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID)
{ {
@ -3099,7 +3108,6 @@ namespace OpenSim.Region.Physics.OdePlugin
resetCollisionAccounting(); resetCollisionAccounting();
} }
private void changeDisable(bool disable) private void changeDisable(bool disable)
{ {
if (disable) if (disable)
@ -3250,7 +3258,6 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodyEnable(Body); d.BodyEnable(Body);
} }
private void changeAddForce(Vector3 theforce) private void changeAddForce(Vector3 theforce)
{ {
m_forceacc += theforce; m_forceacc += theforce;
@ -3267,7 +3274,6 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodyEnable(Body); d.BodyEnable(Body);
} }
} }
m_collisionscore = 0; m_collisionscore = 0;
} }
} }
@ -3317,7 +3323,6 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity = newVel; _velocity = newVel;
} }
private void changeangvelocity(Vector3 newAngVel) private void changeangvelocity(Vector3 newAngVel)
{ {
float len = newAngVel.LengthSquared(); float len = newAngVel.LengthSquared();
@ -3384,6 +3389,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_vehicle = new ODEDynamics(this); m_vehicle = new ODEDynamics(this);
m_vehicle.DoSetVehicle(vdata); m_vehicle.DoSetVehicle(vdata);
} }
private void changeVehicleType(int value) private void changeVehicleType(int value)
{ {
if (value == (int)Vehicle.TYPE_NONE) if (value == (int)Vehicle.TYPE_NONE)
@ -3429,6 +3435,48 @@ namespace OpenSim.Region.Physics.OdePlugin
m_vehicle.ProcessVehicleFlags(bp.param, bp.value); m_vehicle.ProcessVehicleFlags(bp.param, bp.value);
} }
private void changeBuoyancy(float b)
{
m_buoyancy = b;
}
private void changePIDTarget(Vector3 trg)
{
m_PIDTarget = trg;
}
private void changePIDTau(float tau)
{
m_PIDTau = tau;
}
private void changePIDActive(bool val)
{
m_usePID = val;
}
private void changePIDHoverHeight(float val)
{
m_PIDHoverHeight = val;
if (val == 0)
m_useHoverPID = false;
}
private void changePIDHoverType(PIDHoverType type)
{
m_PIDHoverType = type;
}
private void changePIDHoverTau(float tau)
{
m_PIDHoverTau = tau;
}
private void changePIDHoverActive(bool active)
{
m_useHoverPID = active;
}
#endregion #endregion
public void Move() public void Move()
@ -3987,6 +4035,39 @@ namespace OpenSim.Region.Physics.OdePlugin
case changes.SetVehicle: case changes.SetVehicle:
changeSetVehicle((VehicleData) arg); changeSetVehicle((VehicleData) arg);
break; break;
case changes.Buoyancy:
changeBuoyancy((float)arg);
break;
case changes.PIDTarget:
changePIDTarget((Vector3)arg);
break;
case changes.PIDTau:
changePIDTau((float)arg);
break;
case changes.PIDActive:
changePIDActive((bool)arg);
break;
case changes.PIDHoverHeight:
changePIDHoverHeight((float)arg);
break;
case changes.PIDHoverType:
changePIDHoverType((PIDHoverType)arg);
break;
case changes.PIDHoverTau:
changePIDHoverTau((float)arg);
break;
case changes.PIDHoverActive:
changePIDHoverActive((bool)arg);
break;
case changes.Null: case changes.Null:
donullchange(); donullchange();
break; break;

View File

@ -134,6 +134,17 @@ namespace OpenSim.Region.Physics.OdePlugin
AddAngForce, AddAngForce,
AngLock, AngLock,
Buoyancy,
PIDTarget,
PIDTau,
PIDActive,
PIDHoverHeight,
PIDHoverType,
PIDHoverTau,
PIDHoverActive,
Size, Size,
Shape, Shape,

View File

@ -10599,31 +10599,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID key = new UUID(); UUID key = new UUID();
if (UUID.TryParse(id, out key)) if (UUID.TryParse(id, out key))
{ {
try // return total object mass
{ SceneObjectPart part = World.GetSceneObjectPart(key);
/* if (part != null)
SceneObjectPart obj = World.GetSceneObjectPart(World.Entities[key].LocalId); return part.ParentGroup.GetMass();
if (obj != null)
return (double)obj.GetMass();
*/
// return total object mass
SceneObjectGroup obj = World.GetGroupByPrim(World.Entities[key].LocalId);
if (obj != null)
return obj.GetMass();
// the object is null so the key is for an avatar // the object is null so the key is for an avatar
ScenePresence avatar = World.GetScenePresence(key); ScenePresence avatar = World.GetScenePresence(key);
if (avatar != null) if (avatar != null)
if (avatar.IsChildAgent)
// reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
// child agents have a mass of 1.0
return 1;
else
return (double)avatar.GetMass();
}
catch (KeyNotFoundException)
{ {
return 0; // The Object/Agent not in the region so just return zero if (avatar.IsChildAgent)
{
// reference http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetObjectMass
// child agents have a mass of 1.0
return 1;
}
else
{
return (double)avatar.GetMass();
}
} }
} }
return 0; return 0;

Binary file not shown.