mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Merge branch 'vehicles' into tests
Conflicts: OpenSim/Region/Physics/Manager/PhysicsActor.cs OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
This commit is contained in:
@@ -137,11 +137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (cmdHandlerThread == null)
|
||||
{
|
||||
// Start the thread that will be doing the work
|
||||
cmdHandlerThread = new Thread(CmdHandlerThreadLoop);
|
||||
cmdHandlerThread.Name = "AsyncLSLCmdHandlerThread";
|
||||
cmdHandlerThread.Priority = ThreadPriority.BelowNormal;
|
||||
cmdHandlerThread.IsBackground = true;
|
||||
cmdHandlerThread.Start();
|
||||
cmdHandlerThread = Watchdog.StartThread(CmdHandlerThreadLoop, "AsyncLSLCmdHandlerThread", ThreadPriority.Normal, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +181,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
Thread.Sleep(cmdHandlerThreadCycleSleepms);
|
||||
|
||||
DoOneCmdHandlerPass();
|
||||
|
||||
Watchdog.UpdateThread();
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -1267,12 +1267,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
protected void SetScale(SceneObjectPart part, LSL_Vector scale)
|
||||
{
|
||||
// TODO: this needs to trigger a persistance save as well
|
||||
|
||||
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01)
|
||||
return;
|
||||
if (scale.x < 0.01)
|
||||
scale.x = 0.01;
|
||||
if (scale.y < 0.01)
|
||||
scale.y = 0.01;
|
||||
if (scale.z < 0.01)
|
||||
scale.z = 0.01;
|
||||
|
||||
if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
|
||||
{
|
||||
@@ -1283,12 +1285,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (scale.z > World.m_maxPhys)
|
||||
scale.z = World.m_maxPhys;
|
||||
}
|
||||
|
||||
if (scale.x > World.m_maxNonphys)
|
||||
scale.x = World.m_maxNonphys;
|
||||
if (scale.y > World.m_maxNonphys)
|
||||
scale.y = World.m_maxNonphys;
|
||||
if (scale.z > World.m_maxNonphys)
|
||||
scale.z = World.m_maxNonphys;
|
||||
|
||||
Vector3 tmp = part.Scale;
|
||||
tmp.X = (float)scale.x;
|
||||
tmp.Y = (float)scale.y;
|
||||
@@ -2043,7 +2047,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (local != 0)
|
||||
force *= llGetRot();
|
||||
|
||||
m_host.ParentGroup.RootPart.SetForce(new PhysicsVector((float)force.x, (float)force.y, (float)force.z));
|
||||
m_host.ParentGroup.RootPart.SetForce(new Vector3((float)force.x, (float)force.y, (float)force.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2058,7 +2062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
if (!m_host.ParentGroup.IsDeleted)
|
||||
{
|
||||
PhysicsVector tmpForce = m_host.ParentGroup.RootPart.GetForce();
|
||||
Vector3 tmpForce = m_host.ParentGroup.RootPart.GetForce();
|
||||
force.x = tmpForce.X;
|
||||
force.y = tmpForce.Y;
|
||||
force.z = tmpForce.Z;
|
||||
@@ -4180,7 +4184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
applied_linear_impulse *= m_host.GetWorldRotation();
|
||||
}
|
||||
pusheeav.PhysicsActor.AddForce(new PhysicsVector(applied_linear_impulse.X, applied_linear_impulse.Y, applied_linear_impulse.Z), true);
|
||||
pusheeav.PhysicsActor.AddForce(applied_linear_impulse, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6088,7 +6092,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (!m_host.ParentGroup.IsDeleted)
|
||||
{
|
||||
m_host.ParentGroup.RootPart.SetVehicleVectorParam(param,
|
||||
new PhysicsVector((float)vec.x, (float)vec.y, (float)vec.z));
|
||||
new Vector3((float)vec.x, (float)vec.y, (float)vec.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7227,13 +7231,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public LSL_Integer llGetNumberOfPrims()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
List<ScenePresence> presences = World.GetScenePresences();
|
||||
if (presences.Count == 0)
|
||||
ScenePresence[] presences = World.GetScenePresences();
|
||||
if (presences.Length == 0)
|
||||
return 0;
|
||||
|
||||
int avatarCount = 0;
|
||||
foreach (ScenePresence presence in presences)
|
||||
for (int i = 0; i < presences.Length; i++)
|
||||
{
|
||||
ScenePresence presence = presences[i];
|
||||
|
||||
if (!presence.IsChildAgent && presence.ParentID != 0)
|
||||
{
|
||||
if (m_host.ParentGroup.HasChildPrim(presence.ParentID))
|
||||
|
||||
@@ -404,7 +404,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
|
||||
private List<SensedEntity> doAgentSensor(SenseRepeatClass ts)
|
||||
{
|
||||
List<ScenePresence> Presences;
|
||||
List<ScenePresence> presences;
|
||||
List<SensedEntity> sensedEntities = new List<SensedEntity>();
|
||||
|
||||
// If this is an avatar sense by key try to get them directly
|
||||
@@ -414,16 +414,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
ScenePresence p = m_CmdManager.m_ScriptEngine.World.GetScenePresence(ts.keyID);
|
||||
if (p == null)
|
||||
return sensedEntities;
|
||||
Presences = new List<ScenePresence>();
|
||||
Presences.Add(p);
|
||||
presences = new List<ScenePresence>();
|
||||
presences.Add(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
Presences = m_CmdManager.m_ScriptEngine.World.GetScenePresences();
|
||||
presences = new List<ScenePresence>(m_CmdManager.m_ScriptEngine.World.GetScenePresences());
|
||||
}
|
||||
|
||||
// If nobody about quit fast
|
||||
if (Presences.Count == 0)
|
||||
if (presences.Count == 0)
|
||||
return sensedEntities;
|
||||
|
||||
SceneObjectPart SensePoint = ts.host;
|
||||
@@ -440,8 +440,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
Vector3 toRegionPos;
|
||||
double dis;
|
||||
|
||||
foreach (ScenePresence presence in Presences)
|
||||
for (int i = 0; i < presences.Count; i++)
|
||||
{
|
||||
ScenePresence presence = presences[i];
|
||||
bool keep = true;
|
||||
|
||||
if (presence.IsDeleted)
|
||||
@@ -515,16 +516,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
{
|
||||
List<Object> data = new List<Object>();
|
||||
|
||||
foreach (SenseRepeatClass ts in SenseRepeaters)
|
||||
lock (SenseRepeatListLock)
|
||||
{
|
||||
if (ts.itemID == itemID)
|
||||
foreach (SenseRepeatClass ts in SenseRepeaters)
|
||||
{
|
||||
data.Add(ts.interval);
|
||||
data.Add(ts.name);
|
||||
data.Add(ts.keyID);
|
||||
data.Add(ts.type);
|
||||
data.Add(ts.range);
|
||||
data.Add(ts.arc);
|
||||
if (ts.itemID == itemID)
|
||||
{
|
||||
data.Add(ts.interval);
|
||||
data.Add(ts.name);
|
||||
data.Add(ts.keyID);
|
||||
data.Add(ts.type);
|
||||
data.Add(ts.range);
|
||||
data.Add(ts.arc);
|
||||
}
|
||||
}
|
||||
}
|
||||
return data.ToArray();
|
||||
|
||||
Reference in New Issue
Block a user