aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
diff options
context:
space:
mode:
authorgareth2007-03-22 10:11:15 +0000
committergareth2007-03-22 10:11:15 +0000
commit7daa3955bc3a1918e40962851f9e8d38597a245e (patch)
treebee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
parentLoad XML for neighbourinfo from grid (diff)
downloadopensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.zip
opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz
opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2
opensim-SC-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz
brought zircon branch into trunk
Diffstat (limited to '')
-rw-r--r--OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs (renamed from src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs)69
1 files changed, 65 insertions, 4 deletions
diff --git a/src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs b/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
index 9576a40..043c2f1 100644
--- a/src/physics/RealPhysX/RealPhysXplugin/RealPhysX.cs
+++ b/OpenSim.Physics/PhysXPlugin/PhysXPlugin.cs
@@ -52,10 +52,10 @@
52*/ 52*/
53using System; 53using System;
54using System.Collections.Generic; 54using System.Collections.Generic;
55using PhysicsSystem; 55using OpenSim.Physics.Manager;
56using PhysXWrapper; 56using PhysXWrapper;
57 57
58namespace PhysXplugin 58namespace OpenSim.Physics.PhysXPlugin
59{ 59{
60 /// <summary> 60 /// <summary>
61 /// Will be the PhysX plugin but for now will be a very basic physics engine 61 /// Will be the PhysX plugin but for now will be a very basic physics engine
@@ -105,6 +105,7 @@ namespace PhysXplugin
105 public PhysXScene() 105 public PhysXScene()
106 { 106 {
107 mySdk = NxPhysicsSDK.CreateSDK(); 107 mySdk = NxPhysicsSDK.CreateSDK();
108 Console.WriteLine("Sdk created - now creating scene");
108 scene = mySdk.CreateScene(); 109 scene = mySdk.CreateScene();
109 110
110 } 111 }
@@ -179,6 +180,7 @@ namespace PhysXplugin
179 private PhysicsVector _acceleration; 180 private PhysicsVector _acceleration;
180 private NxCharacter _character; 181 private NxCharacter _character;
181 private bool flying; 182 private bool flying;
183 private float gravityAccel;
182 184
183 public PhysXCharacter(NxCharacter character) 185 public PhysXCharacter(NxCharacter character)
184 { 186 {
@@ -224,6 +226,30 @@ namespace PhysXplugin
224 } 226 }
225 } 227 }
226 228
229 public override bool Kinematic
230 {
231 get
232 {
233 return false;
234 }
235 set
236 {
237
238 }
239 }
240
241 public override Axiom.MathLib.Quaternion Orientation
242 {
243 get
244 {
245 return Axiom.MathLib.Quaternion.Identity;
246 }
247 set
248 {
249
250 }
251 }
252
227 public override PhysicsVector Acceleration 253 public override PhysicsVector Acceleration
228 { 254 {
229 get 255 get
@@ -258,9 +284,14 @@ namespace PhysXplugin
258 } 284 }
259 else 285 else
260 { 286 {
261 vec.Z = (-9.8f + this._velocity.Z) * timeStep; 287 gravityAccel+= -9.8f;
288 vec.Z = (gravityAccel + this._velocity.Z) * timeStep;
289 }
290 int res = this._character.Move(vec);
291 if(res == 1)
292 {
293 gravityAccel = 0;
262 } 294 }
263 this._character.Move(vec);
264 } 295 }
265 296
266 public void UpdatePosition() 297 public void UpdatePosition()
@@ -332,6 +363,36 @@ namespace PhysXplugin
332 } 363 }
333 } 364 }
334 365
366 public override bool Kinematic
367 {
368 get
369 {
370 return this._prim.Kinematic;
371 }
372 set
373 {
374 this._prim.Kinematic = value;
375 }
376 }
377
378 public override Axiom.MathLib.Quaternion Orientation
379 {
380 get
381 {
382 Axiom.MathLib.Quaternion res = new Axiom.MathLib.Quaternion();
383 PhysXWrapper.Quaternion quat = this._prim.GetOrientation();
384 res.w = quat.W;
385 res.x = quat.X;
386 res.y = quat.Y;
387 res.z = quat.Z;
388 return res;
389 }
390 set
391 {
392
393 }
394 }
395
335 public override PhysicsVector Acceleration 396 public override PhysicsVector Acceleration
336 { 397 {
337 get 398 get