diff options
author | Teravus Ovares | 2008-04-25 01:00:55 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-25 01:00:55 +0000 |
commit | 9468917b5f6ba6556bd9605e88227ea79e43d94e (patch) | |
tree | 7e175b228a221dfcf2f16a2d86a5f3f50f0b2a1e /OpenSim/Region/ScriptEngine | |
parent | * Tuned the llMove2Target PID controller to be more reasonable and not oversh... (diff) | |
download | opensim-SC-9468917b5f6ba6556bd9605e88227ea79e43d94e.zip opensim-SC-9468917b5f6ba6556bd9605e88227ea79e43d94e.tar.gz opensim-SC-9468917b5f6ba6556bd9605e88227ea79e43d94e.tar.bz2 opensim-SC-9468917b5f6ba6556bd9605e88227ea79e43d94e.tar.xz |
* Implements llTarget, llTargetRemove, at_target(), not_at_target()
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
4 files changed, 17 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 35f8ee0..79b13cf 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -1181,14 +1181,14 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1181 | public int llTarget(LSL_Types.Vector3 position, double range) | 1181 | public int llTarget(LSL_Types.Vector3 position, double range) |
1182 | { | 1182 | { |
1183 | m_host.AddScriptLPS(1); | 1183 | m_host.AddScriptLPS(1); |
1184 | NotImplemented("llTarget"); | 1184 | return m_host.registerTargetWaypoint(new LLVector3((float)position.x, (float)position.y, (float)position.z), (float)range); |
1185 | return 0; | 1185 | |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | public void llTargetRemove(int number) | 1188 | public void llTargetRemove(int number) |
1189 | { | 1189 | { |
1190 | m_host.AddScriptLPS(1); | 1190 | m_host.AddScriptLPS(1); |
1191 | NotImplemented("llTargetRemove"); | 1191 | m_host.unregisterTargetWaypoint(number); |
1192 | } | 1192 | } |
1193 | 1193 | ||
1194 | public int llRotTarget(LSL_Types.Quaternion rot, double error) | 1194 | public int llRotTarget(LSL_Types.Quaternion rot, double error) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index d3e9948..ce9f445 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -70,6 +70,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
70 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; | 70 | myScriptEngine.World.EventManager.OnRezScript += OnRezScript; |
71 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; | 71 | myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; |
72 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | 72 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; |
73 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | ||
74 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | ||
75 | |||
73 | // TODO: HOOK ALL EVENTS UP TO SERVER! | 76 | // TODO: HOOK ALL EVENTS UP TO SERVER! |
74 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | 77 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); |
75 | if(money != null) | 78 | if(money != null) |
@@ -222,14 +225,14 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
222 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email", EventQueueManager.llDetectNull); | 225 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email", EventQueueManager.llDetectNull); |
223 | } | 226 | } |
224 | 227 | ||
225 | public void at_target(uint localID, LLUUID itemID) | 228 | public void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos) |
226 | { | 229 | { |
227 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target", EventQueueManager.llDetectNull); | 230 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "at_target", EventQueueManager.llDetectNull, new object[] { (int)handle, new LSL_Types.Vector3(targetpos.X,targetpos.Y,targetpos.Z), new LSL_Types.Vector3(atpos.X,atpos.Y,atpos.Z) }); |
228 | } | 231 | } |
229 | 232 | ||
230 | public void not_at_target(uint localID, LLUUID itemID) | 233 | public void not_at_target(uint localID) |
231 | { | 234 | { |
232 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target", EventQueueManager.llDetectNull); | 235 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "not_at_target", EventQueueManager.llDetectNull); |
233 | } | 236 | } |
234 | 237 | ||
235 | public void at_rot_target(uint localID, LLUUID itemID) | 238 | public void at_rot_target(uint localID, LLUUID itemID) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index ea17e20..1c85646 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | |||
@@ -57,8 +57,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
57 | void control(uint localID, LLUUID itemID); | 57 | void control(uint localID, LLUUID itemID); |
58 | void money(uint LocalID, LLUUID agentID, int amount); | 58 | void money(uint LocalID, LLUUID agentID, int amount); |
59 | void email(uint localID, LLUUID itemID); | 59 | void email(uint localID, LLUUID itemID); |
60 | void at_target(uint localID, LLUUID itemID); | 60 | void at_target(uint localID, uint handle, LLVector3 targetpos, LLVector3 atpos); |
61 | void not_at_target(uint localID, LLUUID itemID); | 61 | void not_at_target(uint localID); |
62 | void at_rot_target(uint localID, LLUUID itemID); | 62 | void at_rot_target(uint localID, LLUUID itemID); |
63 | void not_at_rot_target(uint localID, LLUUID itemID); | 63 | void not_at_rot_target(uint localID, LLUUID itemID); |
64 | void run_time_permissions(uint localID, LLUUID itemID); | 64 | void run_time_permissions(uint localID, LLUUID itemID); |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs index 50bc892..a766ea2 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs | |||
@@ -419,8 +419,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
419 | // case "at_rot_target": | 419 | // case "at_rot_target": |
420 | //return (long)scriptEvents.at_rot_target; | 420 | //return (long)scriptEvents.at_rot_target; |
421 | //break; | 421 | //break; |
422 | //case "at_target": | 422 | case "at_target": |
423 | //return (long)scriptEvents.at_target; | 423 | return scriptEvents.at_target; |
424 | //break; | 424 | //break; |
425 | //case "changed": | 425 | //case "changed": |
426 | //return (long)scriptEvents.changed; | 426 | //return (long)scriptEvents.changed; |
@@ -455,8 +455,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
455 | case "land_collision_start": | 455 | case "land_collision_start": |
456 | return scriptEvents.land_collision_start; | 456 | return scriptEvents.land_collision_start; |
457 | // break; | 457 | // break; |
458 | case "link_message": | 458 | //case "link_message": |
459 | return scriptEvents.link_message; | 459 | //return scriptEvents.link_message; |
460 | // break; | 460 | // break; |
461 | case "listen": | 461 | case "listen": |
462 | return scriptEvents.listen; | 462 | return scriptEvents.listen; |
@@ -534,7 +534,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
534 | land_collision = 2048, | 534 | land_collision = 2048, |
535 | land_collision_end = 4096, | 535 | land_collision_end = 4096, |
536 | land_collision_start = 8192, | 536 | land_collision_start = 8192, |
537 | link_message = 16384, | 537 | at_target = 16384, |
538 | listen = 32768, | 538 | listen = 32768, |
539 | money = 65536, | 539 | money = 65536, |
540 | moving_end = 131072, | 540 | moving_end = 131072, |