aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs83
1 files changed, 76 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
index 22a1126..f29522f 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs
@@ -28,14 +28,17 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using OpenMetaverse; 30using OpenMetaverse;
31using OpenMetaverse.Packets;
31using OpenSim.Framework; 32using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
33using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; 34using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object;
34using OpenSim.Region.Physics.Manager; 35using OpenSim.Region.Physics.Manager;
36using PrimType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.PrimType;
37using SculptType=OpenSim.Region.OptionalModules.Scripting.Minimodule.Object.SculptType;
35 38
36namespace OpenSim.Region.OptionalModules.Scripting.Minimodule 39namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
37{ 40{
38 class SOPObject : MarshalByRefObject, IObject, IObjectPhysics 41 class SOPObject : MarshalByRefObject, IObject, IObjectPhysics, IObjectShape
39 { 42 {
40 private readonly Scene m_rootScene; 43 private readonly Scene m_rootScene;
41 private readonly uint m_localID; 44 private readonly uint m_localID;
@@ -282,12 +285,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
282 set { throw new System.NotImplementedException(); } 285 set { throw new System.NotImplementedException(); }
283 } 286 }
284 287
285 public PrimType PrimShape
286 {
287 get { return (PrimType) getScriptPrimType(GetSOP().Shape); }
288 set { throw new System.NotImplementedException(); }
289 }
290
291 public PhysicsMaterial PhysicsMaterial 288 public PhysicsMaterial PhysicsMaterial
292 { 289 {
293 get { throw new System.NotImplementedException(); } 290 get { throw new System.NotImplementedException(); }
@@ -299,6 +296,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
299 get { return this; } 296 get { return this; }
300 } 297 }
301 298
299 public IObjectShape Shape
300 {
301 get { return this; }
302 }
303
302 #region Public Functions 304 #region Public Functions
303 305
304 public void Say(string msg) 306 public void Say(string msg)
@@ -569,5 +571,72 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
569 } 571 }
570 572
571 #endregion 573 #endregion
574
575 #region Implementation of IObjectShape
576
577 private UUID m_sculptMap = UUID.Zero;
578
579 public UUID SculptMap
580 {
581 get { return m_sculptMap; }
582 set
583 {
584 m_sculptMap = value;
585 SetPrimitiveSculpted(SculptMap, (byte) SculptType);
586 }
587 }
588
589 private SculptType m_sculptType = Object.SculptType.Default;
590
591 public SculptType SculptType
592 {
593 get { return m_sculptType; }
594 set
595 {
596 m_sculptType = value;
597 SetPrimitiveSculpted(SculptMap, (byte) SculptType);
598 }
599 }
600
601 public HoleShape HoleType
602 {
603 get { throw new System.NotImplementedException(); }
604 set { throw new System.NotImplementedException(); }
605 }
606
607 public double HoleSize
608 {
609 get { throw new System.NotImplementedException(); }
610 set { throw new System.NotImplementedException(); }
611 }
612
613 public PrimType PrimType
614 {
615 get { return (PrimType)getScriptPrimType(GetSOP().Shape); }
616 set { throw new System.NotImplementedException(); }
617 }
618
619 private void SetPrimitiveSculpted(UUID map, byte type)
620 {
621 ObjectShapePacket.ObjectDataBlock shapeBlock = new ObjectShapePacket.ObjectDataBlock();
622
623 SceneObjectPart part = GetSOP();
624
625 UUID sculptId = map;
626
627 shapeBlock.ObjectLocalID = part.LocalId;
628 shapeBlock.PathScaleX = 100;
629 shapeBlock.PathScaleY = 150;
630
631 // retain pathcurve
632 shapeBlock.PathCurve = part.Shape.PathCurve;
633
634 part.Shape.SetSculptData((byte)type, sculptId);
635 part.Shape.SculptEntry = true;
636 part.UpdateShape(shapeBlock);
637 }
638
639
640 #endregion
572 } 641 }
573} 642}