opensim – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | eva | 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 OpenSimulator 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 | using System; |
||
29 | using System.Reflection; |
||
30 | using System.Runtime.Serialization; |
||
31 | using System.Security.Permissions; |
||
32 | using log4net; |
||
33 | using OpenSim.Framework; |
||
34 | using OpenMetaverse; |
||
35 | |||
36 | namespace OpenSim.Region.Framework.Scenes |
||
37 | { |
||
38 | public abstract class EntityBase : ISceneEntity |
||
39 | { |
||
40 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
||
41 | |||
42 | /// <summary> |
||
43 | /// The scene to which this entity belongs |
||
44 | /// </summary> |
||
45 | public Scene Scene |
||
46 | { |
||
47 | get { return m_scene; } |
||
48 | } |
||
49 | protected Scene m_scene; |
||
50 | |||
51 | protected UUID m_uuid; |
||
52 | |||
53 | public virtual UUID UUID |
||
54 | { |
||
55 | get { return m_uuid; } |
||
56 | set { m_uuid = value; } |
||
57 | } |
||
58 | |||
59 | protected string m_name; |
||
60 | |||
61 | /// <summary> |
||
62 | /// The name of this entity |
||
63 | /// </summary> |
||
64 | public virtual string Name |
||
65 | { |
||
66 | get { return m_name; } |
||
67 | set { m_name = value; } |
||
68 | } |
||
69 | |||
70 | /// <summary> |
||
71 | /// Signals whether this entity was in a scene but has since been removed from it. |
||
72 | /// </summary> |
||
73 | public bool IsDeleted { get; protected internal set; } |
||
74 | |||
75 | protected Vector3 m_pos; |
||
76 | |||
77 | /// <summary> |
||
78 | /// Absolute position of this entity in a scene. |
||
79 | /// </summary> |
||
80 | public virtual Vector3 AbsolutePosition |
||
81 | { |
||
82 | get { return m_pos; } |
||
83 | set |
||
84 | { |
||
85 | m_pos = value; |
||
86 | } |
||
87 | } |
||
88 | |||
89 | protected Vector3 m_velocity; |
||
90 | protected Vector3 m_rotationalvelocity; |
||
91 | |||
92 | /// <summary> |
||
93 | /// Current velocity of the entity. |
||
94 | /// </summary> |
||
95 | public virtual Vector3 Velocity |
||
96 | { |
||
97 | get { return m_velocity; } |
||
98 | set { m_velocity = value; } |
||
99 | } |
||
100 | |||
101 | protected uint m_localId; |
||
102 | |||
103 | public virtual uint LocalId |
||
104 | { |
||
105 | get { return m_localId; } |
||
106 | set |
||
107 | { |
||
108 | m_localId = value; |
||
109 | // m_log.DebugFormat("[ENTITY BASE]: Set part {0} to local id {1}", Name, m_localId); |
||
110 | } |
||
111 | } |
||
112 | |||
113 | /// <summary> |
||
114 | /// Creates a new Entity (should not occur on it's own) |
||
115 | /// </summary> |
||
116 | public EntityBase() |
||
117 | { |
||
118 | m_name = "(basic entity)"; |
||
119 | } |
||
120 | |||
121 | /// <summary> |
||
122 | /// Performs any updates that need to be done at each frame, as opposed to immediately. |
||
123 | /// These included scheduled updates and updates that occur due to physics processing. |
||
124 | /// </summary> |
||
125 | public abstract void Update(); |
||
126 | |||
127 | /// <summary> |
||
128 | /// Copies the entity |
||
129 | /// </summary> |
||
130 | /// <returns></returns> |
||
131 | public virtual EntityBase Copy() |
||
132 | { |
||
133 | return (EntityBase) MemberwiseClone(); |
||
134 | } |
||
135 | } |
||
136 | |||
137 | //Nested Classes |
||
138 | public class EntityIntersection |
||
139 | { |
||
140 | public Vector3 ipoint = new Vector3(0, 0, 0); |
||
141 | public Vector3 normal = new Vector3(0, 0, 0); |
||
142 | public Vector3 AAfaceNormal = new Vector3(0, 0, 0); |
||
143 | public int face = -1; |
||
144 | public bool HitTF = false; |
||
145 | public SceneObjectPart obj; |
||
146 | public float distance = 0; |
||
147 | |||
148 | public EntityIntersection() |
||
149 | { |
||
150 | } |
||
151 | |||
152 | public EntityIntersection(Vector3 _ipoint, Vector3 _normal, bool _HitTF) |
||
153 | { |
||
154 | ipoint = _ipoint; |
||
155 | normal = _normal; |
||
156 | HitTF = _HitTF; |
||
157 | } |
||
158 | } |
||
159 | } |