aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs')
-rw-r--r--OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs116
1 files changed, 116 insertions, 0 deletions
diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs
new file mode 100644
index 0000000..22f09fd
--- /dev/null
+++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/PointMetaEntity.cs
@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#region Header
29
30// PointMetaEntity.cs created with MonoDevelop
31// User: bongiojp at 3:03 PMĀ 8/6/2008
32//
33// To change standard headers go to Edit->Preferences->Coding->Standard Headers
34//
35
36#endregion Header
37
38using System;
39using System.Collections.Generic;
40using System.Drawing;
41
42using OpenMetaverse;
43
44using Nini.Config;
45
46using OpenSim.Framework;
47using OpenSim.Region.Framework.Interfaces;
48using OpenSim.Region.Framework.Scenes;
49using OpenSim.Region.Physics.Manager;
50
51using log4net;
52
53namespace OpenSim.Region.OptionalModules.ContentManagement
54{
55 public class PointMetaEntity : MetaEntity
56 {
57 #region Constructors
58
59 public PointMetaEntity(Scene scene, Vector3 groupPos, float transparency)
60 : base()
61 {
62 CreatePointEntity(scene, UUID.Random(), groupPos);
63 SetPartTransparency(m_Entity.RootPart, transparency);
64 }
65
66 public PointMetaEntity(Scene scene, UUID uuid, Vector3 groupPos, float transparency)
67 : base()
68 {
69 CreatePointEntity(scene, uuid, groupPos);
70 SetPartTransparency(m_Entity.RootPart, transparency);
71 }
72
73 #endregion Constructors
74
75 #region Private Methods
76
77 private void CreatePointEntity(Scene scene, UUID uuid, Vector3 groupPos)
78 {
79 SceneObjectGroup x = new SceneObjectGroup();
80 SceneObjectPart y = new SceneObjectPart();
81
82 //Initialize part
83 y.Name = "Very Small Point";
84 y.RegionHandle = scene.RegionInfo.RegionHandle;
85 y.CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
86 y.OwnerID = UUID.Zero;
87 y.CreatorID = UUID.Zero;
88 y.LastOwnerID = UUID.Zero;
89 y.UUID = uuid;
90
91 y.Shape = PrimitiveBaseShape.CreateBox();
92 y.Scale = new Vector3(0.01f,0.01f,0.01f);
93 y.LastOwnerID = UUID.Zero;
94 y.GroupPosition = groupPos;
95 y.OffsetPosition = new Vector3(0, 0, 0);
96 y.RotationOffset = new Quaternion(0,0,0,0);
97 y.Velocity = new Vector3(0, 0, 0);
98 y.RotationalVelocity = new Vector3(0, 0, 0);
99 y.AngularVelocity = new Vector3(0, 0, 0);
100 y.Acceleration = new Vector3(0, 0, 0);
101
102 y.Flags = 0;
103 y.TrimPermissions();
104
105 //Initialize group and add part as root part
106 x.SetScene(scene);
107 x.SetRootPart(y);
108 x.RegionHandle = scene.RegionInfo.RegionHandle;
109 x.SetScene(scene);
110
111 m_Entity = x;
112 }
113
114 #endregion Private Methods
115 }
116}