Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
resolved Conflicts: OpenSim/Region/Framework/Interfaces/ISnmpModule.csavinationmerge
commit
7ecd9b3f1a
|
@ -5200,7 +5200,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
args.Channel = ch;
|
args.Channel = ch;
|
||||||
args.From = String.Empty;
|
args.From = String.Empty;
|
||||||
args.Message = Utils.BytesToString(msg);
|
args.Message = Utils.BytesToString(msg);
|
||||||
args.Type = ChatTypeEnum.Shout;
|
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
|
||||||
args.Position = new Vector3();
|
args.Position = new Vector3();
|
||||||
args.Scene = Scene;
|
args.Scene = Scene;
|
||||||
args.Sender = this;
|
args.Sender = this;
|
||||||
|
|
|
@ -73,8 +73,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource);
|
void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource);
|
||||||
|
|
||||||
ArrayList GetScriptErrors(UUID itemID);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop all the scripts in this entity.
|
/// Stop all the scripts in this entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -104,6 +102,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// <param name="stateSource"></param>
|
/// <param name="stateSource"></param>
|
||||||
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||||
|
|
||||||
|
ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop a script which is in this prim's inventory.
|
/// Stop a script which is in this prim's inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -271,8 +271,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// Needs to determine which engine was running it and use that
|
// Needs to determine which engine was running it and use that
|
||||||
//
|
//
|
||||||
part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||||
errors = part.Inventory.GetScriptErrors(item.ItemID);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -158,6 +158,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public IXfer XferManager;
|
public IXfer XferManager;
|
||||||
|
|
||||||
|
protected ISnmpModule m_snmpService = null;
|
||||||
|
public ISnmpModule SnmpService
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (m_snmpService == null)
|
||||||
|
{
|
||||||
|
m_snmpService = RequestModuleInterface<ISnmpModule>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_snmpService;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected IAssetService m_AssetService;
|
protected IAssetService m_AssetService;
|
||||||
protected IAuthorizationService m_AuthorizationService;
|
protected IAuthorizationService m_AuthorizationService;
|
||||||
|
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public bool WaitForCallback(UUID id)
|
public bool WaitForCallback(UUID id)
|
||||||
{
|
{
|
||||||
int count = 200;
|
int count = 400;
|
||||||
while (m_agentsInTransit.Contains(id) && count-- > 0)
|
while (m_agentsInTransit.Contains(id) && count-- > 0)
|
||||||
{
|
{
|
||||||
//m_log.Debug(" >>> Waiting... " + count);
|
//m_log.Debug(" >>> Waiting... " + count);
|
||||||
|
|
|
@ -46,6 +46,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private string m_inventoryFileName = String.Empty;
|
private string m_inventoryFileName = String.Empty;
|
||||||
private int m_inventoryFileNameSerial = 0;
|
private int m_inventoryFileNameSerial = 0;
|
||||||
|
|
||||||
|
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
|
||||||
|
|
||||||
/// <value>
|
/// <value>
|
||||||
/// The part to which the inventory belongs.
|
/// The part to which the inventory belongs.
|
||||||
|
@ -211,7 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList GetScriptErrors(UUID itemID)
|
private ArrayList GetScriptErrors(UUID itemID)
|
||||||
{
|
{
|
||||||
ArrayList ret = new ArrayList();
|
ArrayList ret = new ArrayList();
|
||||||
|
|
||||||
|
@ -270,7 +272,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// item.Name, item.ItemID, Name, UUID);
|
// item.Name, item.ItemID, Name, UUID);
|
||||||
|
|
||||||
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||||
|
{
|
||||||
|
StoreScriptError(item.ItemID, "no permission");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_part.AddFlag(PrimFlags.Scripted);
|
m_part.AddFlag(PrimFlags.Scripted);
|
||||||
|
|
||||||
|
@ -285,6 +290,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_items.LockItemsForWrite(false);
|
m_items.LockItemsForWrite(false);
|
||||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||||
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
|
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
|
||||||
|
StoreScriptErrors(item.ItemID, GetScriptErrors(item.ItemID));
|
||||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||||
m_part.ScheduleFullUpdate();
|
m_part.ScheduleFullUpdate();
|
||||||
return;
|
return;
|
||||||
|
@ -294,11 +300,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (null == asset)
|
if (null == asset)
|
||||||
{
|
{
|
||||||
|
string msg = String.Format("asset ID {0} could not be found", item.AssetID);
|
||||||
|
StoreScriptError(item.ItemID, msg);
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[PRIM INVENTORY]: " +
|
"[PRIM INVENTORY]: " +
|
||||||
"Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
|
"Couldn't start script {0}, {1} at {2} in {3} since {4}",
|
||||||
item.Name, item.ItemID, m_part.AbsolutePosition,
|
item.Name, item.ItemID, m_part.AbsolutePosition,
|
||||||
m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID);
|
m_part.ParentGroup.Scene.RegionInfo.RegionName, msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -311,11 +319,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
string script = Utils.BytesToString(asset.Data);
|
string script = Utils.BytesToString(asset.Data);
|
||||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||||
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
||||||
|
StoreScriptErrors(item.ItemID, GetScriptErrors(item.ItemID));
|
||||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||||
m_part.ScheduleFullUpdate();
|
m_part.ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StoreScriptError(item.ItemID, "scripts disabled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RestoreSavedScriptState(UUID oldID, UUID newID)
|
private void RestoreSavedScriptState(UUID oldID, UUID newID)
|
||||||
|
@ -392,24 +405,71 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_items.LockItemsForRead(false);
|
m_items.LockItemsForRead(false);
|
||||||
|
string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
|
||||||
|
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||||
|
StoreScriptError(itemId, msg);
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[PRIM INVENTORY]: " +
|
"[PRIM INVENTORY]: " +
|
||||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
"Couldn't start script with ID {0} since it {1}", itemId, msg);
|
||||||
itemId, m_part.Name, m_part.UUID,
|
|
||||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_items.LockItemsForRead(false);
|
m_items.LockItemsForRead(false);
|
||||||
|
string msg = String.Format("couldn't be found for prim {0}, {1}", m_part.Name, m_part.UUID);
|
||||||
|
StoreScriptError(itemId, msg);
|
||||||
m_log.ErrorFormat(
|
m_log.ErrorFormat(
|
||||||
"[PRIM INVENTORY]: " +
|
"[PRIM INVENTORY]: " +
|
||||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
|
"Couldn't start script with ID {0} since it {1}", itemId, msg);
|
||||||
itemId, m_part.Name, m_part.UUID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||||
|
{
|
||||||
|
ArrayList errors;
|
||||||
|
|
||||||
|
lock (m_scriptErrors)
|
||||||
|
{
|
||||||
|
m_scriptErrors.Remove(itemId);
|
||||||
|
}
|
||||||
|
CreateScriptInstance(itemId, startParam, postOnRez, engine, stateSource);
|
||||||
|
lock (m_scriptErrors)
|
||||||
|
{
|
||||||
|
while (!m_scriptErrors.TryGetValue(itemId, out errors))
|
||||||
|
{
|
||||||
|
if (!System.Threading.Monitor.Wait(m_scriptErrors, 15000))
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[PRIM INVENTORY]: " +
|
||||||
|
"timedout waiting for script {0} errors", itemId);
|
||||||
|
if (!m_scriptErrors.TryGetValue(itemId, out errors))
|
||||||
|
{
|
||||||
|
errors = new ArrayList(1);
|
||||||
|
errors.Add("timedout waiting for errors");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_scriptErrors.Remove(itemId);
|
||||||
|
}
|
||||||
|
return errors;
|
||||||
|
}
|
||||||
|
private void StoreScriptErrors(UUID itemId, ArrayList errors)
|
||||||
|
{
|
||||||
|
lock (m_scriptErrors)
|
||||||
|
{
|
||||||
|
m_scriptErrors[itemId] = errors;
|
||||||
|
System.Threading.Monitor.PulseAll(m_scriptErrors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void StoreScriptError(UUID itemId, string message)
|
||||||
|
{
|
||||||
|
ArrayList errors = new ArrayList(1);
|
||||||
|
errors.Add(message);
|
||||||
|
StoreScriptErrors(itemId, errors);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stop a script which is in this prim's inventory.
|
/// Stop a script which is in this prim's inventory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -85,6 +85,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
|
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();
|
||||||
|
foreach (ScenePresence avatar in World.GetAvatars())
|
||||||
|
{
|
||||||
|
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>
|
/// <summary>
|
||||||
/// Get the current Windlight scene
|
/// Get the current Windlight scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -229,10 +251,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules)
|
private RegionMeta7WindlightData getWindlightProfileFromRules(LSL_List rules)
|
||||||
{
|
{
|
||||||
RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
|
RegionMeta7WindlightData wl = (RegionMeta7WindlightData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone();
|
||||||
|
|
||||||
LSL_List values = new LSL_List();
|
LSL_List values = new LSL_List();
|
||||||
|
@ -244,9 +266,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
LSL_Types.Vector3 iV;
|
LSL_Types.Vector3 iV;
|
||||||
switch (rule)
|
switch (rule)
|
||||||
{
|
{
|
||||||
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
case (int)ScriptBaseClass.WL_SUN_MOON_POSITION:
|
||||||
idx++;
|
idx++;
|
||||||
wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
|
wl.sunMoonPosition = (float)rules.GetLSLFloatItem(idx);
|
||||||
break;
|
break;
|
||||||
case (int)ScriptBaseClass.WL_AMBIENT:
|
case (int)ScriptBaseClass.WL_AMBIENT:
|
||||||
idx++;
|
idx++;
|
||||||
|
@ -419,58 +441,58 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
CMShoutError("Careminster functions are not enabled.");
|
CMShoutError("Careminster functions are not enabled.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
||||||
{
|
{
|
||||||
CMShoutError("cmSetWindlightScene can only be used by estate managers or owners.");
|
CMShoutError("cmSetWindlightScene can only be used by estate managers or owners.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int success = 0;
|
int success = 0;
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
if (Meta7WindlightModule.EnableWindlight)
|
if (Meta7WindlightModule.EnableWindlight)
|
||||||
{
|
{
|
||||||
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
||||||
m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
|
m_host.ParentGroup.Scene.StoreWindlightProfile(wl);
|
||||||
success = 1;
|
success = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CMShoutError("Windlight module is disabled");
|
CMShoutError("Windlight module is disabled");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Set the current Windlight scene to a target avatar
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="rules"></param>
|
||||||
|
/// <returns>success: true or false</returns>
|
||||||
|
public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
|
||||||
|
{
|
||||||
|
if (!m_CMFunctionsEnabled)
|
||||||
|
{
|
||||||
|
CMShoutError("Careminster functions are not enabled.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
||||||
|
{
|
||||||
|
CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int success = 0;
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
if (Meta7WindlightModule.EnableWindlight)
|
||||||
|
{
|
||||||
|
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
||||||
|
World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
|
||||||
|
success = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CMShoutError("Windlight module is disabled");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Set the current Windlight scene to a target avatar
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="rules"></param>
|
|
||||||
/// <returns>success: true or false</returns>
|
|
||||||
public int cmSetWindlightSceneTargeted(LSL_List rules, LSL_Key target)
|
|
||||||
{
|
|
||||||
if (!m_CMFunctionsEnabled)
|
|
||||||
{
|
|
||||||
CMShoutError("Careminster functions are not enabled.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200)
|
|
||||||
{
|
|
||||||
CMShoutError("cmSetWindlightSceneTargeted can only be used by estate managers or owners.");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int success = 0;
|
|
||||||
m_host.AddScriptLPS(1);
|
|
||||||
if (Meta7WindlightModule.EnableWindlight)
|
|
||||||
{
|
|
||||||
RegionMeta7WindlightData wl = getWindlightProfileFromRules(rules);
|
|
||||||
World.EventManager.TriggerOnSendNewWindlightProfileTargeted(wl, new UUID(target.m_string));
|
|
||||||
success = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CMShoutError("Windlight module is disabled");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2881,6 +2881,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public void llLookAt(LSL_Vector target, double strength, double damping)
|
public void llLookAt(LSL_Vector target, double strength, double damping)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
// Determine where we are looking from
|
// Determine where we are looking from
|
||||||
LSL_Vector from = llGetPos();
|
LSL_Vector from = llGetPos();
|
||||||
|
@ -2900,12 +2901,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
// the angles of rotation in radians into rotation value
|
// the angles of rotation in radians into rotation value
|
||||||
|
|
||||||
LSL_Types.Quaternion rot = llEuler2Rot(angle);
|
LSL_Types.Quaternion rot = llEuler2Rot(angle);
|
||||||
/*
|
|
||||||
Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
|
// This would only work if your physics system contains an APID controller:
|
||||||
m_host.startLookAt(rotation, (float)damping, (float)strength);
|
// Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
|
||||||
This would only work if your physics system contains an APID controller */
|
// m_host.startLookAt(rotation, (float)damping, (float)strength);
|
||||||
|
|
||||||
// Orient the object to the angle calculated
|
// Orient the object to the angle calculated
|
||||||
llSetRot(rot);
|
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)
|
public void llRotLookAt(LSL_Rotation target, double strength, double damping)
|
||||||
|
@ -6195,6 +6207,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
tempf = (float)rules.GetLSLFloatItem(i + 1);
|
||||||
prules.OuterAngle = (float)tempf;
|
prules.OuterAngle = (float)tempf;
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
{
|
{
|
||||||
// Windlight Functions
|
// Windlight Functions
|
||||||
LSL_List cmGetWindlightScene(LSL_List rules);
|
LSL_List cmGetWindlightScene(LSL_List rules);
|
||||||
int cmSetWindlightScene(LSL_List rules);
|
int cmSetWindlightScene(LSL_List rules);
|
||||||
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
|
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
|
||||||
|
LSL_List cmGetAvatarList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,11 +66,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
public int cmSetWindlightScene(LSL_List rules)
|
public int cmSetWindlightScene(LSL_List rules)
|
||||||
{
|
{
|
||||||
return m_CM_Functions.cmSetWindlightScene(rules);
|
return m_CM_Functions.cmSetWindlightScene(rules);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int cmSetWindlightSceneTargeted(LSL_List rules, key target)
|
public int cmSetWindlightSceneTargeted(LSL_List rules, key target)
|
||||||
{
|
{
|
||||||
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
|
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_ALLOWED_DROP = 64;
|
||||||
public const int CHANGED_OWNER = 128;
|
public const int CHANGED_OWNER = 128;
|
||||||
public const int CHANGED_REGION_RESTART = 256;
|
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_REGION = 512;
|
||||||
public const int CHANGED_TELEPORT = 1024;
|
public const int CHANGED_TELEPORT = 1024;
|
||||||
public const int CHANGED_ANIMATION = 16384;
|
public const int CHANGED_ANIMATION = 16384;
|
||||||
|
|
Loading…
Reference in New Issue