mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Merge branch 'careminster' into careminster-presence-refactor
This commit is contained in:
@@ -112,6 +112,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Like osGetAgents but returns enough info for a radar
|
||||
/// </summary>
|
||||
/// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
|
||||
public LSL_List cmGetAvatarList()
|
||||
{
|
||||
LSL_List result = new LSL_List();
|
||||
World.ForEachScenePresence(delegate (ScenePresence avatar)
|
||||
{
|
||||
if (avatar.UUID != m_host.OwnerID)
|
||||
{
|
||||
if (avatar.IsChildAgent == false)
|
||||
{
|
||||
result.Add(avatar.UUID);
|
||||
result.Add(avatar.PhysicsActor.Position);
|
||||
result.Add(avatar.Name);
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current Windlight scene
|
||||
/// </summary>
|
||||
|
||||
@@ -2881,6 +2881,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
public void llLookAt(LSL_Vector target, double strength, double damping)
|
||||
{
|
||||
/*
|
||||
m_host.AddScriptLPS(1);
|
||||
// Determine where we are looking from
|
||||
LSL_Vector from = llGetPos();
|
||||
@@ -2900,12 +2901,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
// the angles of rotation in radians into rotation value
|
||||
|
||||
LSL_Types.Quaternion rot = llEuler2Rot(angle);
|
||||
/*
|
||||
Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
|
||||
m_host.startLookAt(rotation, (float)damping, (float)strength);
|
||||
This would only work if your physics system contains an APID controller */
|
||||
|
||||
// This would only work if your physics system contains an APID controller:
|
||||
// Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
|
||||
// m_host.startLookAt(rotation, (float)damping, (float)strength);
|
||||
|
||||
// Orient the object to the angle calculated
|
||||
llSetRot(rot);
|
||||
*/
|
||||
|
||||
//The above code, while nice, doesn't replicate the behaviour of SL and tends to "roll" the object.
|
||||
//There's probably a smarter way of doing this, my rotation math-fu is weak.
|
||||
// http://bugs.meta7.com/view.php?id=28
|
||||
// - Tom
|
||||
|
||||
LSL_Rotation newrot = llGetRot() * llRotBetween(new LSL_Vector(1.0d, 0.0d, 0.0d) * llGetRot(), new LSL_Vector(0.0d, 0.0d, -1.0d));
|
||||
llSetRot(newrot * llRotBetween(new LSL_Vector(0.0d,0.0d,1.0d) * newrot, target - llGetPos()));
|
||||
|
||||
}
|
||||
|
||||
public void llRotLookAt(LSL_Rotation target, double strength, double damping)
|
||||
@@ -6222,6 +6234,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.OuterAngle = (float)tempf;
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.InnerAngle = (float)tempf;
|
||||
break;
|
||||
|
||||
case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
|
||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||
prules.OuterAngle = (float)tempf;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_List cmGetWindlightScene(LSL_List rules);
|
||||
int cmSetWindlightScene(LSL_List rules);
|
||||
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
|
||||
LSL_List cmGetAvatarList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
|
||||
}
|
||||
public LSL_List cmGetAvatarList()
|
||||
{
|
||||
return m_CM_Functions.cmGetAvatarList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int CHANGED_ALLOWED_DROP = 64;
|
||||
public const int CHANGED_OWNER = 128;
|
||||
public const int CHANGED_REGION_RESTART = 256;
|
||||
public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART
|
||||
public const int CHANGED_REGION = 512;
|
||||
public const int CHANGED_TELEPORT = 1024;
|
||||
public const int CHANGED_ANIMATION = 16384;
|
||||
|
||||
Reference in New Issue
Block a user