Whitespace cleanup

mysql-performance
Melanie 2010-01-11 02:04:05 +00:00
parent a0859754c0
commit 2320b17ca9
6 changed files with 183 additions and 183 deletions

View File

@ -181,14 +181,14 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void ScriptNotAtTargetEvent(uint localID); public delegate void ScriptNotAtTargetEvent(uint localID);
public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent;
public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot); public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot);
public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent; public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent;
public delegate void ScriptNotAtRotTargetEvent(uint localID); public delegate void ScriptNotAtRotTargetEvent(uint localID);
public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent; public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent;
public delegate void ScriptColliding(uint localID, ColliderArgs colliders); public delegate void ScriptColliding(uint localID, ColliderArgs colliders);
@ -391,8 +391,8 @@ namespace OpenSim.Region.Framework.Scenes
private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent; private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent;
private ScriptAtTargetEvent handlerScriptAtTargetEvent = null; private ScriptAtTargetEvent handlerScriptAtTargetEvent = null;
private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null; private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null;
private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null; private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null;
private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null; private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null;
private ClientMovement handlerClientMovement = null; //OnClientMovement; private ClientMovement handlerClientMovement = null; //OnClientMovement;
private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError; private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError;
@ -859,24 +859,24 @@ namespace OpenSim.Region.Framework.Scenes
{ {
handlerScriptNotAtTargetEvent(localID); handlerScriptNotAtTargetEvent(localID);
} }
} }
public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot)
{ {
handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent;
if (handlerScriptAtRotTargetEvent != null) if (handlerScriptAtRotTargetEvent != null)
{ {
handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot); handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot);
} }
} }
public void TriggerNotAtRotTargetEvent(uint localID) public void TriggerNotAtRotTargetEvent(uint localID)
{ {
handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent;
if (handlerScriptNotAtRotTargetEvent != null) if (handlerScriptNotAtRotTargetEvent != null)
{ {
handlerScriptNotAtRotTargetEvent(localID); handlerScriptNotAtRotTargetEvent(localID);
} }
} }
public void TriggerRequestChangeWaterHeight(float height) public void TriggerRequestChangeWaterHeight(float height)

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.Framework.Scenes
land_collision = 2048, land_collision = 2048,
land_collision_end = 4096, land_collision_end = 4096,
land_collision_start = 8192, land_collision_start = 8192,
at_target = 16384, at_target = 16384,
at_rot_target = 16777216, at_rot_target = 16777216,
listen = 32768, listen = 32768,
money = 65536, money = 65536,
@ -80,13 +80,13 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 targetPos; public Vector3 targetPos;
public float tolerance; public float tolerance;
public uint handle; public uint handle;
} }
struct scriptRotTarget struct scriptRotTarget
{ {
public Quaternion targetRot; public Quaternion targetRot;
public float tolerance; public float tolerance;
public uint handle; public uint handle;
} }
public delegate void PrimCountTaintedDelegate(); public delegate void PrimCountTaintedDelegate();
@ -173,13 +173,13 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneObjectPart m_rootPart; protected SceneObjectPart m_rootPart;
// private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>();
private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>();
private Dictionary<uint, scriptRotTarget> m_rotTargets = new Dictionary<uint, scriptRotTarget>(); private Dictionary<uint, scriptRotTarget> m_rotTargets = new Dictionary<uint, scriptRotTarget>();
private bool m_scriptListens_atTarget = false; private bool m_scriptListens_atTarget = false;
private bool m_scriptListens_notAtTarget = false; private bool m_scriptListens_notAtTarget = false;
private bool m_scriptListens_atRotTarget = false; private bool m_scriptListens_atRotTarget = false;
private bool m_scriptListens_notAtRotTarget = false; private bool m_scriptListens_notAtRotTarget = false;
internal Dictionary<UUID, string> m_savedScriptState = null; internal Dictionary<UUID, string> m_savedScriptState = null;
@ -1273,15 +1273,15 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_targets) lock (m_targets)
m_targets.Clear(); m_targets.Clear();
m_scene.RemoveGroupTarget(this); m_scene.RemoveGroupTarget(this);
} }
m_scriptListens_atRotTarget = ((aggregateScriptEvents & scriptEvents.at_rot_target) != 0); m_scriptListens_atRotTarget = ((aggregateScriptEvents & scriptEvents.at_rot_target) != 0);
m_scriptListens_notAtRotTarget = ((aggregateScriptEvents & scriptEvents.not_at_rot_target) != 0); m_scriptListens_notAtRotTarget = ((aggregateScriptEvents & scriptEvents.not_at_rot_target) != 0);
if (!m_scriptListens_atRotTarget && !m_scriptListens_notAtRotTarget) if (!m_scriptListens_atRotTarget && !m_scriptListens_notAtRotTarget)
{ {
lock (m_rotTargets) lock (m_rotTargets)
m_rotTargets.Clear(); m_rotTargets.Clear();
m_scene.RemoveGroupTarget(this); m_scene.RemoveGroupTarget(this);
} }
ScheduleGroupForFullUpdate(); ScheduleGroupForFullUpdate();
@ -3178,30 +3178,30 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
public int registerRotTargetWaypoint(Quaternion target, float tolerance) public int registerRotTargetWaypoint(Quaternion target, float tolerance)
{ {
scriptRotTarget waypoint = new scriptRotTarget(); scriptRotTarget waypoint = new scriptRotTarget();
waypoint.targetRot = target; waypoint.targetRot = target;
waypoint.tolerance = tolerance; waypoint.tolerance = tolerance;
uint handle = m_scene.AllocateLocalId(); uint handle = m_scene.AllocateLocalId();
waypoint.handle = handle; waypoint.handle = handle;
lock (m_rotTargets) lock (m_rotTargets)
{ {
m_rotTargets.Add(handle, waypoint); m_rotTargets.Add(handle, waypoint);
} }
m_scene.AddGroupTarget(this); m_scene.AddGroupTarget(this);
return (int)handle; return (int)handle;
} }
public void unregisterRotTargetWaypoint(int handle) public void unregisterRotTargetWaypoint(int handle)
{ {
lock (m_targets) lock (m_targets)
{ {
m_rotTargets.Remove((uint)handle); m_rotTargets.Remove((uint)handle);
if (m_targets.Count == 0) if (m_targets.Count == 0)
m_scene.RemoveGroupTarget(this); m_scene.RemoveGroupTarget(this);
} }
} }
public int registerTargetWaypoint(Vector3 target, float tolerance) public int registerTargetWaypoint(Vector3 target, float tolerance)
@ -3308,85 +3308,85 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
} }
if (m_scriptListens_atRotTarget || m_scriptListens_notAtRotTarget) if (m_scriptListens_atRotTarget || m_scriptListens_notAtRotTarget)
{ {
if (m_rotTargets.Count > 0) if (m_rotTargets.Count > 0)
{ {
bool at_Rottarget = false; bool at_Rottarget = false;
Dictionary<uint, scriptRotTarget> atRotTargets = new Dictionary<uint, scriptRotTarget>(); Dictionary<uint, scriptRotTarget> atRotTargets = new Dictionary<uint, scriptRotTarget>();
lock (m_rotTargets) lock (m_rotTargets)
{ {
foreach (uint idx in m_rotTargets.Keys) foreach (uint idx in m_rotTargets.Keys)
{ {
scriptRotTarget target = m_rotTargets[idx]; scriptRotTarget target = m_rotTargets[idx];
double angle = Math.Acos(target.targetRot.X * m_rootPart.RotationOffset.X + target.targetRot.Y * m_rootPart.RotationOffset.Y + target.targetRot.Z * m_rootPart.RotationOffset.Z + target.targetRot.W * m_rootPart.RotationOffset.W) * 2; double angle = Math.Acos(target.targetRot.X * m_rootPart.RotationOffset.X + target.targetRot.Y * m_rootPart.RotationOffset.Y + target.targetRot.Z * m_rootPart.RotationOffset.Z + target.targetRot.W * m_rootPart.RotationOffset.W) * 2;
if (angle < 0) angle = -angle; if (angle < 0) angle = -angle;
if (angle > Math.PI) angle = (Math.PI * 2 - angle); if (angle > Math.PI) angle = (Math.PI * 2 - angle);
if (angle <= target.tolerance) if (angle <= target.tolerance)
{ {
// trigger at_rot_target // trigger at_rot_target
if (m_scriptListens_atRotTarget) if (m_scriptListens_atRotTarget)
{ {
at_Rottarget = true; at_Rottarget = true;
scriptRotTarget att = new scriptRotTarget(); scriptRotTarget att = new scriptRotTarget();
att.targetRot = target.targetRot; att.targetRot = target.targetRot;
att.tolerance = target.tolerance; att.tolerance = target.tolerance;
att.handle = target.handle; att.handle = target.handle;
atRotTargets.Add(idx, att); atRotTargets.Add(idx, att);
} }
} }
} }
} }
if (atRotTargets.Count > 0) if (atRotTargets.Count > 0)
{ {
uint[] localids = new uint[0]; uint[] localids = new uint[0];
lock (m_parts) lock (m_parts)
{ {
localids = new uint[m_parts.Count]; localids = new uint[m_parts.Count];
int cntr = 0; int cntr = 0;
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
localids[cntr] = part.LocalId; localids[cntr] = part.LocalId;
cntr++; cntr++;
} }
} }
for (int ctr = 0; ctr < localids.Length; ctr++) for (int ctr = 0; ctr < localids.Length; ctr++)
{ {
foreach (uint target in atRotTargets.Keys) foreach (uint target in atRotTargets.Keys)
{ {
scriptRotTarget att = atRotTargets[target]; scriptRotTarget att = atRotTargets[target];
m_scene.EventManager.TriggerAtRotTargetEvent( m_scene.EventManager.TriggerAtRotTargetEvent(
localids[ctr], att.handle, att.targetRot, m_rootPart.RotationOffset); localids[ctr], att.handle, att.targetRot, m_rootPart.RotationOffset);
} }
} }
return; return;
} }
if (m_scriptListens_notAtRotTarget && !at_Rottarget) if (m_scriptListens_notAtRotTarget && !at_Rottarget)
{ {
//trigger not_at_target //trigger not_at_target
uint[] localids = new uint[0]; uint[] localids = new uint[0];
lock (m_parts) lock (m_parts)
{ {
localids = new uint[m_parts.Count]; localids = new uint[m_parts.Count];
int cntr = 0; int cntr = 0;
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
localids[cntr] = part.LocalId; localids[cntr] = part.LocalId;
cntr++; cntr++;
} }
} }
for (int ctr = 0; ctr < localids.Length; ctr++) for (int ctr = 0; ctr < localids.Length; ctr++)
{ {
m_scene.EventManager.TriggerNotAtRotTargetEvent(localids[ctr]); m_scene.EventManager.TriggerNotAtRotTargetEvent(localids[ctr]);
} }
} }
} }
} }
} }

View File

@ -4078,23 +4078,23 @@ namespace OpenSim.Region.Framework.Scenes
{ {
m_parentGroup.unregisterTargetWaypoint(handle); m_parentGroup.unregisterTargetWaypoint(handle);
} }
} }
public int registerRotTargetWaypoint(Quaternion target, float tolerance) public int registerRotTargetWaypoint(Quaternion target, float tolerance)
{ {
if (m_parentGroup != null) if (m_parentGroup != null)
{ {
return m_parentGroup.registerRotTargetWaypoint(target, tolerance); return m_parentGroup.registerRotTargetWaypoint(target, tolerance);
} }
return 0; return 0;
} }
public void unregisterRotTargetWaypoint(int handle) public void unregisterRotTargetWaypoint(int handle)
{ {
if (m_parentGroup != null) if (m_parentGroup != null)
{ {
m_parentGroup.unregisterRotTargetWaypoint(handle); m_parentGroup.unregisterRotTargetWaypoint(handle);
} }
} }
public void SetCameraAtOffset(Vector3 v) public void SetCameraAtOffset(Vector3 v)

View File

@ -2108,13 +2108,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llRotTarget(LSL_Rotation rot, double error) public LSL_Integer llRotTarget(LSL_Rotation rot, double error)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
return m_host.registerRotTargetWaypoint(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error); return m_host.registerRotTargetWaypoint(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error);
} }
public void llRotTargetRemove(int number) public void llRotTargetRemove(int number)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.unregisterRotTargetWaypoint(number); m_host.unregisterRotTargetWaypoint(number);
} }

View File

@ -61,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
land_collision = 2048, land_collision = 2048,
land_collision_end = 4096, land_collision_end = 4096,
land_collision_start = 8192, land_collision_start = 8192,
at_target = 16384, at_target = 16384,
at_rot_target = 16777216, at_rot_target = 16777216,
listen = 32768, listen = 32768,
money = 65536, money = 65536,
@ -203,7 +203,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return; return;
} }
m_eventFlagsMap.Add("attach", scriptEvents.attach); m_eventFlagsMap.Add("attach", scriptEvents.attach);
m_eventFlagsMap.Add("at_rot_target", scriptEvents.at_rot_target); m_eventFlagsMap.Add("at_rot_target", scriptEvents.at_rot_target);
m_eventFlagsMap.Add("at_target", scriptEvents.at_target); m_eventFlagsMap.Add("at_target", scriptEvents.at_target);
// m_eventFlagsMap.Add("changed",(long)scriptEvents.changed); // m_eventFlagsMap.Add("changed",(long)scriptEvents.changed);

View File

@ -58,9 +58,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end;
myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; myScriptEngine.World.EventManager.OnScriptChangedEvent += changed;
myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target;
myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target;
myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target;
myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target;
myScriptEngine.World.EventManager.OnScriptControlEvent += control; myScriptEngine.World.EventManager.OnScriptControlEvent += control;
myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start;
myScriptEngine.World.EventManager.OnScriptColliding += collision; myScriptEngine.World.EventManager.OnScriptColliding += collision;
@ -390,16 +390,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
myScriptEngine.PostObjectEvent(localID, new EventParams( myScriptEngine.PostObjectEvent(localID, new EventParams(
"not_at_target",new object[0], "not_at_target",new object[0],
new DetectParams[0])); new DetectParams[0]));
} }
public void at_rot_target(uint localID, uint handle, Quaternion targetrot, public void at_rot_target(uint localID, uint handle, Quaternion targetrot,
Quaternion atrot) Quaternion atrot)
{ {
myScriptEngine.PostObjectEvent(localID, new EventParams( myScriptEngine.PostObjectEvent(localID, new EventParams(
"at_rot_target", new object[] { "at_rot_target", new object[] {
new LSL_Types.LSLInteger(handle), new LSL_Types.LSLInteger(handle),
new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W),
new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) },
new DetectParams[0])); new DetectParams[0]));
} }