diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs new file mode 100644 index 0000000..55365ac --- /dev/null +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/PointMetaEntity.cs | |||
@@ -0,0 +1,81 @@ | |||
1 | // PointMetaEntity.cs created with MonoDevelop | ||
2 | // User: bongiojp at 3:03 PMĀ 8/6/2008 | ||
3 | // | ||
4 | // To change standard headers go to Edit->Preferences->Coding->Standard Headers | ||
5 | // | ||
6 | |||
7 | using System; | ||
8 | using System.Collections.Generic; | ||
9 | using System.Drawing; | ||
10 | using libsecondlife; | ||
11 | using Nini.Config; | ||
12 | using OpenSim.Framework; | ||
13 | using OpenSim.Region.Environment.Interfaces; | ||
14 | using OpenSim.Region.Environment.Scenes; | ||
15 | using log4net; | ||
16 | using OpenSim.Region.Physics.Manager; | ||
17 | using Axiom.Math; | ||
18 | |||
19 | namespace OpenSim.Region.Environment.Modules.ContentManagement | ||
20 | { | ||
21 | |||
22 | |||
23 | public class PointMetaEntity : MetaEntity | ||
24 | { | ||
25 | |||
26 | public PointMetaEntity(Scene scene, uint LocalId, LLVector3 groupPos, float transparency) : base() | ||
27 | { | ||
28 | CreatePointEntity(scene, LLUUID.Random(), LocalId, groupPos); | ||
29 | SetPartTransparency(m_Entity.RootPart, transparency); | ||
30 | } | ||
31 | |||
32 | public PointMetaEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos, float transparency) : base() | ||
33 | { | ||
34 | CreatePointEntity(scene, uuid, LocalId, groupPos); | ||
35 | SetPartTransparency(m_Entity.RootPart, transparency); | ||
36 | } | ||
37 | |||
38 | private void CreatePointEntity(Scene scene, LLUUID uuid, uint LocalId, LLVector3 groupPos) | ||
39 | { | ||
40 | SceneObjectGroup x = new SceneObjectGroup(); | ||
41 | SceneObjectPart y = new SceneObjectPart(); | ||
42 | |||
43 | //Initialize part | ||
44 | y.Name = "Very Small Point"; | ||
45 | y.RegionHandle = scene.RegionInfo.RegionHandle; | ||
46 | y.CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
47 | y.OwnerID = LLUUID.Zero; | ||
48 | y.CreatorID = LLUUID.Zero; | ||
49 | y.LastOwnerID = LLUUID.Zero; | ||
50 | y.UUID = uuid; | ||
51 | |||
52 | y.LocalId = LocalId; | ||
53 | |||
54 | y.Shape = PrimitiveBaseShape.CreateBox(); | ||
55 | y.Scale = new LLVector3(0.01f,0.01f,0.01f); | ||
56 | y.LastOwnerID = LLUUID.Zero; | ||
57 | y.GroupPosition = groupPos; | ||
58 | y.OffsetPosition = new LLVector3(0, 0, 0); | ||
59 | y.RotationOffset = new LLQuaternion(0,0,0,0); | ||
60 | y.Velocity = new LLVector3(0, 0, 0); | ||
61 | y.RotationalVelocity = new LLVector3(0, 0, 0); | ||
62 | y.AngularVelocity = new LLVector3(0, 0, 0); | ||
63 | y.Acceleration = new LLVector3(0, 0, 0); | ||
64 | |||
65 | y.Flags = 0; | ||
66 | y.TrimPermissions(); | ||
67 | |||
68 | //Initialize group and add part as root part | ||
69 | x.SetScene(scene); | ||
70 | y.SetParent(x); | ||
71 | y.ParentID = 0; | ||
72 | y.LinkNum = 0; | ||
73 | x.Children.Add(y.UUID, y); | ||
74 | x.RootPart = y; | ||
75 | x.RegionHandle = scene.RegionInfo.RegionHandle; | ||
76 | x.SetScene(scene); | ||
77 | |||
78 | m_Entity = x; | ||
79 | } | ||
80 | } | ||
81 | } | ||