diff options
author | SignpostMarv | 2012-07-31 14:45:23 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-02 22:14:46 +0100 |
commit | 35b7c80e0ba876649c606d5d047fcb59754372ea (patch) | |
tree | 127ca02385e606d3c6dea61fe9646104c410409a /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | string format arguments in wrong order (diff) | |
download | opensim-SC_OLD-35b7c80e0ba876649c606d5d047fcb59754372ea.zip opensim-SC_OLD-35b7c80e0ba876649c606d5d047fcb59754372ea.tar.gz opensim-SC_OLD-35b7c80e0ba876649c606d5d047fcb59754372ea.tar.bz2 opensim-SC_OLD-35b7c80e0ba876649c606d5d047fcb59754372ea.tar.xz |
implementing osDropAttachment & osDropAttachmentAt
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
3 files changed, 53 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 8b73cd9..fec8a67 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3549,6 +3549,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3549 | if (m_UrlModule != null) | 3549 | if (m_UrlModule != null) |
3550 | m_UrlModule.HttpContentType(new UUID(id),type); | 3550 | m_UrlModule.HttpContentType(new UUID(id),type); |
3551 | } | 3551 | } |
3552 | 3552 | ||
3553 | } | 3553 | public void osDropAttachment() |
3554 | { | ||
3555 | CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); | ||
3556 | m_host.AddScriptLPS(1); | ||
3557 | |||
3558 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3559 | ScenePresence sp = attachmentsModule == null ? null : m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.OwnerID); | ||
3560 | |||
3561 | if (attachmentsModule != null && sp != null) | ||
3562 | { | ||
3563 | attachmentsModule.DetachSingleAttachmentToGround(sp, m_host.ParentGroup.LocalId); | ||
3564 | } | ||
3565 | } | ||
3566 | |||
3567 | public void osDropAttachmentAt(LSL_Vector pos, LSL_Rotation rot) | ||
3568 | { | ||
3569 | CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); | ||
3570 | m_host.AddScriptLPS(1); | ||
3571 | |||
3572 | IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; | ||
3573 | ScenePresence sp = attachmentsModule == null ? null : m_host.ParentGroup.Scene.GetScenePresence(m_host.ParentGroup.OwnerID); | ||
3574 | |||
3575 | if (attachmentsModule != null && sp != null) | ||
3576 | { | ||
3577 | Vector3 omvPos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z); | ||
3578 | Quaternion omvRot = LSL_Api.Rot2Quaternion(rot); | ||
3579 | attachmentsModule.DetachSingleAttachmentToGround(sp, m_host.ParentGroup.LocalId, omvPos, omvRot); | ||
3580 | } | ||
3581 | } | ||
3582 | } | ||
3554 | } \ No newline at end of file | 3583 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 3985e66..e28473d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -394,5 +394,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
394 | /// </summary> | 394 | /// </summary> |
395 | /// <returns></returns> | 395 | /// <returns></returns> |
396 | void osSetContentType(LSL_Key id, string type); | 396 | void osSetContentType(LSL_Key id, string type); |
397 | |||
398 | /// <summary> | ||
399 | /// Attempts to drop an attachment to the ground | ||
400 | /// </summary> | ||
401 | void osDropAttachment(); | ||
402 | |||
403 | /// <summary> | ||
404 | /// Attempts to drop an attachment at the specified coordinates. | ||
405 | /// </summary> | ||
406 | /// <param name="pos"></param> | ||
407 | /// <param name="rot"></param> | ||
408 | void osDropAttachmentAt(vector pos, rotation rot); | ||
397 | } | 409 | } |
398 | } | 410 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 52ca3da..bae5594 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -972,5 +972,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
972 | { | 972 | { |
973 | m_OSSL_Functions.osSetContentType(id,type); | 973 | m_OSSL_Functions.osSetContentType(id,type); |
974 | } | 974 | } |
975 | |||
976 | public void osDropAttachment() | ||
977 | { | ||
978 | m_OSSL_Functions.osDropAttachment(); | ||
979 | } | ||
980 | |||
981 | public void osDropAttachmentAt(vector pos, rotation rot) | ||
982 | { | ||
983 | m_OSSL_Functions.osDropAttachmentAt(pos, rot); | ||
984 | } | ||
975 | } | 985 | } |
976 | } | 986 | } |