diff options
Diffstat (limited to '')
-rw-r--r-- | src/physics/AssemblyInfo.cs | 52 | ||||
-rw-r--r-- | src/physics/PhysicsManager.cs | 119 | ||||
-rw-r--r-- | src/physics/plugins/AssemblyInfo.cs | 52 |
3 files changed, 46 insertions, 177 deletions
diff --git a/src/physics/AssemblyInfo.cs b/src/physics/AssemblyInfo.cs index 57a8913..1cc3ee1 100644 --- a/src/physics/AssemblyInfo.cs +++ b/src/physics/AssemblyInfo.cs | |||
@@ -1,31 +1,21 @@ | |||
1 | using System.Reflection; | 1 | using System; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Reflection; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // Information about this assembly is defined by the following | 5 | // ------------------------------------------------------------------------------ |
6 | // attributes. | 6 | // <autogenerated> |
7 | // | 7 | // This code was generated by a tool. |
8 | // change them to the information which is associated with the assembly | 8 | // Mono Runtime Version: 2.0.50727.42 |
9 | // you compile. | 9 | // |
10 | 10 | // Changes to this file may cause incorrect behavior and will be lost if | |
11 | [assembly: AssemblyTitle("PhysicsManager")] | 11 | // the code is regenerated. |
12 | [assembly: AssemblyDescription("")] | 12 | // </autogenerated> |
13 | [assembly: AssemblyConfiguration("")] | 13 | // ------------------------------------------------------------------------------ |
14 | [assembly: AssemblyCompany("")] | 14 | |
15 | [assembly: AssemblyProduct("PhysicsManager")] | 15 | [assembly: ComVisibleAttribute(false)] |
16 | [assembly: AssemblyCopyright("")] | 16 | [assembly: CLSCompliantAttribute(false)] |
17 | [assembly: AssemblyTrademark("")] | 17 | [assembly: AssemblyVersionAttribute("0.1.*.191")] |
18 | [assembly: AssemblyCulture("")] | 18 | [assembly: AssemblyTitleAttribute("opensim-physicsmanager")] |
19 | 19 | [assembly: AssemblyDescriptionAttribute("Handles physics plugins")] | |
20 | // This sets the default COM visibility of types in the assembly to invisible. | 20 | [assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")] |
21 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | 21 | |
22 | [assembly: ComVisible(false)] | ||
23 | |||
24 | // The assembly version has following format : | ||
25 | // | ||
26 | // Major.Minor.Build.Revision | ||
27 | // | ||
28 | // You can specify all values by your own or you can build default build and revision | ||
29 | // numbers with the '*' character (the default): | ||
30 | |||
31 | [assembly: AssemblyVersion("1.0.*")] | ||
diff --git a/src/physics/PhysicsManager.cs b/src/physics/PhysicsManager.cs index 1fee628..e5d5bd6 100644 --- a/src/physics/PhysicsManager.cs +++ b/src/physics/PhysicsManager.cs | |||
@@ -46,21 +46,15 @@ namespace PhysicsSystem | |||
46 | 46 | ||
47 | public PhysicsScene GetPhysicsScene(string engineName) | 47 | public PhysicsScene GetPhysicsScene(string engineName) |
48 | { | 48 | { |
49 | if( String.IsNullOrEmpty( engineName ) ) | 49 | if(_plugins.ContainsKey(engineName)) |
50 | { | ||
51 | return new NullPhysicsScene(); | ||
52 | } | ||
53 | |||
54 | if(_plugins.ContainsKey(engineName)) | ||
55 | { | 50 | { |
56 | ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName); | 51 | ServerConsole.MainConsole.Instance.WriteLine("creating "+engineName); |
57 | return _plugins[engineName].GetScene(); | 52 | return _plugins[engineName].GetScene(); |
58 | } | 53 | } |
59 | else | 54 | else |
60 | { | 55 | { |
61 | string error = String.Format("couldn't find physicsEngine: {0}", engineName); | 56 | ServerConsole.MainConsole.Instance.WriteLine("couldn't find physicsEngine: "+ engineName); |
62 | ServerConsole.MainConsole.Instance.WriteLine( error ); | 57 | return null; |
63 | throw new ArgumentException( error ); | ||
64 | } | 58 | } |
65 | } | 59 | } |
66 | 60 | ||
@@ -114,14 +108,6 @@ namespace PhysicsSystem | |||
114 | 108 | ||
115 | public abstract class PhysicsScene | 109 | public abstract class PhysicsScene |
116 | { | 110 | { |
117 | public static PhysicsScene Null | ||
118 | { | ||
119 | get | ||
120 | { | ||
121 | return new NullPhysicsScene(); | ||
122 | } | ||
123 | } | ||
124 | |||
125 | public abstract PhysicsActor AddAvatar(PhysicsVector position); | 111 | public abstract PhysicsActor AddAvatar(PhysicsVector position); |
126 | 112 | ||
127 | public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size); | 113 | public abstract PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size); |
@@ -138,49 +124,8 @@ namespace PhysicsSystem | |||
138 | } | 124 | } |
139 | } | 125 | } |
140 | 126 | ||
141 | public class NullPhysicsScene : PhysicsScene | ||
142 | { | ||
143 | private static int m_workIndicator; | ||
144 | |||
145 | public override PhysicsActor AddAvatar(PhysicsVector position) | ||
146 | { | ||
147 | ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position ); | ||
148 | return PhysicsActor.Null; | ||
149 | } | ||
150 | |||
151 | public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) | ||
152 | { | ||
153 | ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size ); | ||
154 | return PhysicsActor.Null; | ||
155 | } | ||
156 | |||
157 | public override void Simulate(float timeStep) | ||
158 | { | ||
159 | m_workIndicator = ( m_workIndicator + 1 ) % 10; | ||
160 | |||
161 | ServerConsole.MainConsole.Instance.SetStatus( m_workIndicator.ToString() ); | ||
162 | } | ||
163 | |||
164 | public override void GetResults() | ||
165 | { | ||
166 | ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()" ); | ||
167 | } | ||
168 | |||
169 | public override void SetTerrain(float[] heightMap) | ||
170 | { | ||
171 | ServerConsole.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length ); | ||
172 | } | ||
173 | |||
174 | public override bool IsThreaded | ||
175 | { | ||
176 | get { return false; } | ||
177 | } | ||
178 | } | ||
179 | |||
180 | public abstract class PhysicsActor | 127 | public abstract class PhysicsActor |
181 | { | 128 | { |
182 | public static readonly PhysicsActor Null = new NullPhysicsActor(); | ||
183 | |||
184 | public abstract PhysicsVector Position | 129 | public abstract PhysicsVector Position |
185 | { | 130 | { |
186 | get; | 131 | get; |
@@ -208,61 +153,7 @@ namespace PhysicsSystem | |||
208 | public abstract void SetMomentum(PhysicsVector momentum); | 153 | public abstract void SetMomentum(PhysicsVector momentum); |
209 | } | 154 | } |
210 | 155 | ||
211 | public class NullPhysicsActor : PhysicsActor | 156 | public class PhysicsVector |
212 | { | ||
213 | public override PhysicsVector Position | ||
214 | { | ||
215 | get | ||
216 | { | ||
217 | return PhysicsVector.Zero; | ||
218 | } | ||
219 | set | ||
220 | { | ||
221 | return; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | public override PhysicsVector Velocity | ||
226 | { | ||
227 | get | ||
228 | { | ||
229 | return PhysicsVector.Zero; | ||
230 | } | ||
231 | set | ||
232 | { | ||
233 | return; | ||
234 | } | ||
235 | } | ||
236 | |||
237 | public override PhysicsVector Acceleration | ||
238 | { | ||
239 | get { return PhysicsVector.Zero; } | ||
240 | } | ||
241 | |||
242 | public override bool Flying | ||
243 | { | ||
244 | get | ||
245 | { | ||
246 | return false; | ||
247 | } | ||
248 | set | ||
249 | { | ||
250 | return; | ||
251 | } | ||
252 | } | ||
253 | |||
254 | public override void AddForce(PhysicsVector force) | ||
255 | { | ||
256 | return; | ||
257 | } | ||
258 | |||
259 | public override void SetMomentum(PhysicsVector momentum) | ||
260 | { | ||
261 | return; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | public class PhysicsVector | ||
266 | { | 157 | { |
267 | public float X; | 158 | public float X; |
268 | public float Y; | 159 | public float Y; |
@@ -279,7 +170,5 @@ namespace PhysicsSystem | |||
279 | Y = y; | 170 | Y = y; |
280 | Z = z; | 171 | Z = z; |
281 | } | 172 | } |
282 | |||
283 | public static readonly PhysicsVector Zero = new PhysicsVector(0f, 0f, 0f); | ||
284 | } | 173 | } |
285 | } | 174 | } |
diff --git a/src/physics/plugins/AssemblyInfo.cs b/src/physics/plugins/AssemblyInfo.cs index 0c9c06c..2c12da4 100644 --- a/src/physics/plugins/AssemblyInfo.cs +++ b/src/physics/plugins/AssemblyInfo.cs | |||
@@ -1,31 +1,21 @@ | |||
1 | using System.Reflection; | 1 | using System; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Reflection; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // Information about this assembly is defined by the following | 5 | // ------------------------------------------------------------------------------ |
6 | // attributes. | 6 | // <autogenerated> |
7 | // | 7 | // This code was generated by a tool. |
8 | // change them to the information which is associated with the assembly | 8 | // Mono Runtime Version: 2.0.50727.42 |
9 | // you compile. | 9 | // |
10 | 10 | // Changes to this file may cause incorrect behavior and will be lost if | |
11 | [assembly: AssemblyTitle("PhysXplugin")] | 11 | // the code is regenerated. |
12 | [assembly: AssemblyDescription("")] | 12 | // </autogenerated> |
13 | [assembly: AssemblyConfiguration("")] | 13 | // ------------------------------------------------------------------------------ |
14 | [assembly: AssemblyCompany("")] | 14 | |
15 | [assembly: AssemblyProduct("PhysXplugin")] | 15 | [assembly: ComVisibleAttribute(false)] |
16 | [assembly: AssemblyCopyright("")] | 16 | [assembly: CLSCompliantAttribute(false)] |
17 | [assembly: AssemblyTrademark("")] | 17 | [assembly: AssemblyVersionAttribute("0.1.*.191")] |
18 | [assembly: AssemblyCulture("")] | 18 | [assembly: AssemblyTitleAttribute("opensim-physicsmanager-physx")] |
19 | 19 | [assembly: AssemblyDescriptionAttribute("PhysX plugin for OpenSim")] | |
20 | // This sets the default COM visibility of types in the assembly to invisible. | 20 | [assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")] |
21 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | 21 | |
22 | [assembly: ComVisible(false)] | ||
23 | |||
24 | // The assembly version has following format : | ||
25 | // | ||
26 | // Major.Minor.Build.Revision | ||
27 | // | ||
28 | // You can specify all values by your own or you can build default build and revision | ||
29 | // numbers with the '*' character (the default): | ||
30 | |||
31 | [assembly: AssemblyVersion("1.0.*")] | ||