diff options
author | KittoFlora | 2009-10-27 22:42:55 +0100 |
---|---|---|
committer | KittoFlora | 2009-10-27 22:42:55 +0100 |
commit | 1113b3b6ebba3e358326a7be90b338d8c95af688 (patch) | |
tree | d923340600e5a2699ceaceeb52fd6c45994f334a /OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |
parent | llRotLookAt Pt 2 (diff) | |
parent | Merge branch 'master' into vehicles (diff) | |
download | opensim-SC_OLD-1113b3b6ebba3e358326a7be90b338d8c95af688.zip opensim-SC_OLD-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.gz opensim-SC_OLD-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.bz2 opensim-SC_OLD-1113b3b6ebba3e358326a7be90b338d8c95af688.tar.xz |
Merge branch 'vehicles' into tests
Conflicts:
OpenSim/Region/Physics/Manager/PhysicsActor.cs
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
Diffstat (limited to 'OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 14b8f39..0b3cee7 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -52,14 +52,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
52 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 52 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
53 | 53 | ||
54 | //Vector3 | 54 | //Vector3 |
55 | public static Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector) | 55 | public static Vector3 PhysicsVectorToXnaVector3(OpenMetaverse.Vector3 physicsVector) |
56 | { | 56 | { |
57 | return new Vector3(physicsVector.X, physicsVector.Y, physicsVector.Z); | 57 | return new Vector3(physicsVector.X, physicsVector.Y, physicsVector.Z); |
58 | } | 58 | } |
59 | 59 | ||
60 | public static PhysicsVector XnaVector3ToPhysicsVector(Vector3 xnaVector3) | 60 | public static OpenMetaverse.Vector3 XnaVector3ToPhysicsVector(Vector3 xnaVector3) |
61 | { | 61 | { |
62 | return new PhysicsVector(xnaVector3.X, xnaVector3.Y, xnaVector3.Z); | 62 | return new OpenMetaverse.Vector3(xnaVector3.X, xnaVector3.Y, xnaVector3.Z); |
63 | } | 63 | } |
64 | 64 | ||
65 | //Quaternion | 65 | //Quaternion |
@@ -349,7 +349,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
349 | vertexBase = new Vector3[iVertexCount]; | 349 | vertexBase = new Vector3[iVertexCount]; |
350 | for (int i = 0; i < iVertexCount; i++) | 350 | for (int i = 0; i < iVertexCount; i++) |
351 | { | 351 | { |
352 | PhysicsVector v = mesh.getVertexList()[i]; | 352 | OpenMetaverse.Vector3 v = mesh.getVertexList()[i]; |
353 | if (v != null) // Note, null has special meaning. See meshing code for details | 353 | if (v != null) // Note, null has special meaning. See meshing code for details |
354 | vertexBase[i] = BulletXMaths.PhysicsVectorToXnaVector3(v); | 354 | vertexBase[i] = BulletXMaths.PhysicsVectorToXnaVector3(v); |
355 | else | 355 | else |
@@ -392,7 +392,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
392 | private int preCheckCollision(BulletXActor actA, Vector3 vNormal, float fDist) | 392 | private int preCheckCollision(BulletXActor actA, Vector3 vNormal, float fDist) |
393 | { | 393 | { |
394 | float fstartSide; | 394 | float fstartSide; |
395 | PhysicsVector v = actA.Position; | 395 | OpenMetaverse.Vector3 v = actA.Position; |
396 | Vector3 v3 = BulletXMaths.PhysicsVectorToXnaVector3(v); | 396 | Vector3 v3 = BulletXMaths.PhysicsVectorToXnaVector3(v); |
397 | 397 | ||
398 | fstartSide = Vector3.Dot(vNormal, v3) - fDist; | 398 | fstartSide = Vector3.Dot(vNormal, v3) - fDist; |
@@ -404,7 +404,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
404 | { | 404 | { |
405 | Vector3 perPlaneNormal; | 405 | Vector3 perPlaneNormal; |
406 | float fPerPlaneDist; | 406 | float fPerPlaneDist; |
407 | PhysicsVector v = actA.Position; | 407 | OpenMetaverse.Vector3 v = actA.Position; |
408 | Vector3 v3 = BulletXMaths.PhysicsVectorToXnaVector3(v); | 408 | Vector3 v3 = BulletXMaths.PhysicsVectorToXnaVector3(v); |
409 | //check AB | 409 | //check AB |
410 | Vector3 v1; | 410 | Vector3 v1; |
@@ -573,9 +573,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
573 | 573 | ||
574 | } | 574 | } |
575 | 575 | ||
576 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position, PhysicsVector size, bool isFlying) | 576 | public override PhysicsActor AddAvatar(string avName, OpenMetaverse.Vector3 position, OpenMetaverse.Vector3 size, bool isFlying) |
577 | { | 577 | { |
578 | PhysicsVector pos = new PhysicsVector(); | 578 | OpenMetaverse.Vector3 pos = OpenMetaverse.Vector3.Zero; |
579 | pos.X = position.X; | 579 | pos.X = position.X; |
580 | pos.Y = position.Y; | 580 | pos.Y = position.Y; |
581 | pos.Z = position.Z + 20; | 581 | pos.Z = position.Z + 20; |
@@ -611,14 +611,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
611 | } | 611 | } |
612 | } | 612 | } |
613 | 613 | ||
614 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, | 614 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, |
615 | PhysicsVector size, OpenMetaverse.Quaternion rotation) | 615 | OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation) |
616 | { | 616 | { |
617 | return AddPrimShape(primName, pbs, position, size, rotation, false); | 617 | return AddPrimShape(primName, pbs, position, size, rotation, false); |
618 | } | 618 | } |
619 | 619 | ||
620 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position, | 620 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, OpenMetaverse.Vector3 position, |
621 | PhysicsVector size, OpenMetaverse.Quaternion rotation, bool isPhysical) | 621 | OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, bool isPhysical) |
622 | { | 622 | { |
623 | PhysicsActor result; | 623 | PhysicsActor result; |
624 | 624 | ||
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
645 | return result; | 645 | return result; |
646 | } | 646 | } |
647 | 647 | ||
648 | public PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, OpenMetaverse.Quaternion rotation, | 648 | public PhysicsActor AddPrim(String name, OpenMetaverse.Vector3 position, OpenMetaverse.Vector3 size, OpenMetaverse.Quaternion rotation, |
649 | IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) | 649 | IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) |
650 | { | 650 | { |
651 | BulletXPrim newPrim = null; | 651 | BulletXPrim newPrim = null; |
@@ -879,12 +879,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
879 | { | 879 | { |
880 | protected bool flying = false; | 880 | protected bool flying = false; |
881 | protected bool _physical = false; | 881 | protected bool _physical = false; |
882 | protected PhysicsVector _position; | 882 | protected OpenMetaverse.Vector3 _position; |
883 | protected PhysicsVector _velocity; | 883 | protected OpenMetaverse.Vector3 _velocity; |
884 | protected PhysicsVector _size; | 884 | protected OpenMetaverse.Vector3 _size; |
885 | protected PhysicsVector _acceleration; | 885 | protected OpenMetaverse.Vector3 _acceleration; |
886 | protected OpenMetaverse.Quaternion _orientation; | 886 | protected OpenMetaverse.Quaternion _orientation; |
887 | protected PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; | 887 | protected OpenMetaverse.Vector3 m_rotationalVelocity; |
888 | protected RigidBody rigidBody; | 888 | protected RigidBody rigidBody; |
889 | protected int m_PhysicsActorType; | 889 | protected int m_PhysicsActorType; |
890 | private Boolean iscolliding = false; | 890 | private Boolean iscolliding = false; |
@@ -900,7 +900,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
900 | get { return false; } | 900 | get { return false; } |
901 | } | 901 | } |
902 | 902 | ||
903 | public override PhysicsVector Position | 903 | public override OpenMetaverse.Vector3 Position |
904 | { | 904 | { |
905 | get { return _position; } | 905 | get { return _position; } |
906 | set | 906 | set |
@@ -913,13 +913,13 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
913 | } | 913 | } |
914 | } | 914 | } |
915 | 915 | ||
916 | public override PhysicsVector RotationalVelocity | 916 | public override OpenMetaverse.Vector3 RotationalVelocity |
917 | { | 917 | { |
918 | get { return m_rotationalVelocity; } | 918 | get { return m_rotationalVelocity; } |
919 | set { m_rotationalVelocity = value; } | 919 | set { m_rotationalVelocity = value; } |
920 | } | 920 | } |
921 | 921 | ||
922 | public override PhysicsVector Velocity | 922 | public override OpenMetaverse.Vector3 Velocity |
923 | { | 923 | { |
924 | get { return _velocity; } | 924 | get { return _velocity; } |
925 | set | 925 | set |
@@ -934,7 +934,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
934 | } | 934 | } |
935 | else | 935 | else |
936 | { | 936 | { |
937 | _velocity = new PhysicsVector(); | 937 | _velocity = OpenMetaverse.Vector3.Zero; |
938 | } | 938 | } |
939 | } | 939 | } |
940 | } | 940 | } |
@@ -944,7 +944,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
944 | get { return 0f; } | 944 | get { return 0f; } |
945 | set { } | 945 | set { } |
946 | } | 946 | } |
947 | public override PhysicsVector Size | 947 | public override OpenMetaverse.Vector3 Size |
948 | { | 948 | { |
949 | get { return _size; } | 949 | get { return _size; } |
950 | set | 950 | set |
@@ -956,9 +956,9 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
956 | } | 956 | } |
957 | } | 957 | } |
958 | 958 | ||
959 | public override PhysicsVector Force | 959 | public override OpenMetaverse.Vector3 Force |
960 | { | 960 | { |
961 | get { return PhysicsVector.Zero; } | 961 | get { return OpenMetaverse.Vector3.Zero; } |
962 | set { return; } | 962 | set { return; } |
963 | } | 963 | } |
964 | 964 | ||
@@ -973,7 +973,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
973 | 973 | ||
974 | } | 974 | } |
975 | 975 | ||
976 | public override void VehicleVectorParam(int param, PhysicsVector value) | 976 | public override void VehicleVectorParam(int param, OpenMetaverse.Vector3 value) |
977 | { | 977 | { |
978 | 978 | ||
979 | } | 979 | } |
@@ -988,14 +988,14 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
988 | 988 | ||
989 | } | 989 | } |
990 | 990 | ||
991 | public override PhysicsVector CenterOfMass | 991 | public override OpenMetaverse.Vector3 CenterOfMass |
992 | { | 992 | { |
993 | get { return PhysicsVector.Zero; } | 993 | get { return OpenMetaverse.Vector3.Zero; } |
994 | } | 994 | } |
995 | 995 | ||
996 | public override PhysicsVector GeometricCenter | 996 | public override OpenMetaverse.Vector3 GeometricCenter |
997 | { | 997 | { |
998 | get { return PhysicsVector.Zero; } | 998 | get { return OpenMetaverse.Vector3.Zero; } |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | public override PrimitiveBaseShape Shape | 1001 | public override PrimitiveBaseShape Shape |
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1009 | set { return; } | 1009 | set { return; } |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | public override PhysicsVector Acceleration | 1012 | public override OpenMetaverse.Vector3 Acceleration |
1013 | { | 1013 | { |
1014 | get { return _acceleration; } | 1014 | get { return _acceleration; } |
1015 | } | 1015 | } |
@@ -1036,7 +1036,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1036 | 1036 | ||
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | public override void LockAngularMotion(PhysicsVector axis) | 1039 | public override void LockAngularMotion(OpenMetaverse.Vector3 axis) |
1040 | { | 1040 | { |
1041 | 1041 | ||
1042 | } | 1042 | } |
@@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1129 | set { return; } | 1129 | set { return; } |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | public virtual void SetAcceleration(PhysicsVector accel) | 1132 | public virtual void SetAcceleration(OpenMetaverse.Vector3 accel) |
1133 | { | 1133 | { |
1134 | lock (BulletXScene.BulletXLock) | 1134 | lock (BulletXScene.BulletXLock) |
1135 | { | 1135 | { |
@@ -1143,19 +1143,19 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1143 | set { } | 1143 | set { } |
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | public override void AddForce(PhysicsVector force, bool pushforce) | 1146 | public override void AddForce(OpenMetaverse.Vector3 force, bool pushforce) |
1147 | { | 1147 | { |
1148 | } | 1148 | } |
1149 | public override PhysicsVector Torque | 1149 | public override OpenMetaverse.Vector3 Torque |
1150 | { | 1150 | { |
1151 | get { return PhysicsVector.Zero; } | 1151 | get { return OpenMetaverse.Vector3.Zero; } |
1152 | set { return; } | 1152 | set { return; } |
1153 | } | 1153 | } |
1154 | public override void AddAngularForce(PhysicsVector force, bool pushforce) | 1154 | public override void AddAngularForce(OpenMetaverse.Vector3 force, bool pushforce) |
1155 | { | 1155 | { |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | public override void SetMomentum(PhysicsVector momentum) | 1158 | public override void SetMomentum(OpenMetaverse.Vector3 momentum) |
1159 | { | 1159 | { |
1160 | } | 1160 | } |
1161 | 1161 | ||
@@ -1174,7 +1174,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1174 | Translate(_position); | 1174 | Translate(_position); |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | protected internal void Translate(PhysicsVector _newPos) | 1177 | protected internal void Translate(OpenMetaverse.Vector3 _newPos) |
1178 | { | 1178 | { |
1179 | Vector3 _translation; | 1179 | Vector3 _translation; |
1180 | _translation = BulletXMaths.PhysicsVectorToXnaVector3(_newPos) - rigidBody.CenterOfMassPosition; | 1180 | _translation = BulletXMaths.PhysicsVectorToXnaVector3(_newPos) - rigidBody.CenterOfMassPosition; |
@@ -1186,7 +1186,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1186 | Speed(_velocity); | 1186 | Speed(_velocity); |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | protected internal void Speed(PhysicsVector _newSpeed) | 1189 | protected internal void Speed(OpenMetaverse.Vector3 _newSpeed) |
1190 | { | 1190 | { |
1191 | Vector3 _speed; | 1191 | Vector3 _speed; |
1192 | _speed = BulletXMaths.PhysicsVectorToXnaVector3(_newSpeed); | 1192 | _speed = BulletXMaths.PhysicsVectorToXnaVector3(_newSpeed); |
@@ -1212,7 +1212,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1212 | ReSize(_size); | 1212 | ReSize(_size); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | protected internal virtual void ReSize(PhysicsVector _newSize) | 1215 | protected internal virtual void ReSize(OpenMetaverse.Vector3 _newSize) |
1216 | { | 1216 | { |
1217 | } | 1217 | } |
1218 | 1218 | ||
@@ -1227,7 +1227,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1227 | { | 1227 | { |
1228 | 1228 | ||
1229 | } | 1229 | } |
1230 | public override PhysicsVector PIDTarget { set { return; } } | 1230 | public override OpenMetaverse.Vector3 PIDTarget { set { return; } } |
1231 | public override bool PIDActive { set { return; } } | 1231 | public override bool PIDActive { set { return; } } |
1232 | public override float PIDTau { set { return; } } | 1232 | public override float PIDTau { set { return; } } |
1233 | 1233 | ||
@@ -1276,19 +1276,19 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1276 | /// </summary> | 1276 | /// </summary> |
1277 | public class BulletXCharacter : BulletXActor | 1277 | public class BulletXCharacter : BulletXActor |
1278 | { | 1278 | { |
1279 | public BulletXCharacter(BulletXScene parent_scene, PhysicsVector pos) | 1279 | public BulletXCharacter(BulletXScene parent_scene, OpenMetaverse.Vector3 pos) |
1280 | : this(String.Empty, parent_scene, pos) | 1280 | : this(String.Empty, parent_scene, pos) |
1281 | { | 1281 | { |
1282 | } | 1282 | } |
1283 | 1283 | ||
1284 | public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos) | 1284 | public BulletXCharacter(String avName, BulletXScene parent_scene, OpenMetaverse.Vector3 pos) |
1285 | : this(avName, parent_scene, pos, new PhysicsVector(), new PhysicsVector(), new PhysicsVector(), | 1285 | : this(avName, parent_scene, pos, OpenMetaverse.Vector3.Zero, OpenMetaverse.Vector3.Zero, OpenMetaverse.Vector3.Zero, |
1286 | OpenMetaverse.Quaternion.Identity) | 1286 | OpenMetaverse.Quaternion.Identity) |
1287 | { | 1287 | { |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | public BulletXCharacter(String avName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, | 1290 | public BulletXCharacter(String avName, BulletXScene parent_scene, OpenMetaverse.Vector3 pos, OpenMetaverse.Vector3 velocity, |
1291 | PhysicsVector size, PhysicsVector acceleration, OpenMetaverse.Quaternion orientation) | 1291 | OpenMetaverse.Vector3 size, OpenMetaverse.Vector3 acceleration, OpenMetaverse.Quaternion orientation) |
1292 | : base(avName) | 1292 | : base(avName) |
1293 | { | 1293 | { |
1294 | //This fields will be removed. They're temporal | 1294 | //This fields will be removed. They're temporal |
@@ -1343,25 +1343,25 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1343 | set { return; } | 1343 | set { return; } |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | public override PhysicsVector Position | 1346 | public override OpenMetaverse.Vector3 Position |
1347 | { | 1347 | { |
1348 | get { return base.Position; } | 1348 | get { return base.Position; } |
1349 | set { base.Position = value; } | 1349 | set { base.Position = value; } |
1350 | } | 1350 | } |
1351 | 1351 | ||
1352 | public override PhysicsVector Velocity | 1352 | public override OpenMetaverse.Vector3 Velocity |
1353 | { | 1353 | { |
1354 | get { return base.Velocity; } | 1354 | get { return base.Velocity; } |
1355 | set { base.Velocity = value; } | 1355 | set { base.Velocity = value; } |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | public override PhysicsVector Size | 1358 | public override OpenMetaverse.Vector3 Size |
1359 | { | 1359 | { |
1360 | get { return base.Size; } | 1360 | get { return base.Size; } |
1361 | set { base.Size = value; } | 1361 | set { base.Size = value; } |
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | public override PhysicsVector Acceleration | 1364 | public override OpenMetaverse.Vector3 Acceleration |
1365 | { | 1365 | { |
1366 | get { return base.Acceleration; } | 1366 | get { return base.Acceleration; } |
1367 | } | 1367 | } |
@@ -1390,17 +1390,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1390 | set { base.Kinematic = value; } | 1390 | set { base.Kinematic = value; } |
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | public override void SetAcceleration(PhysicsVector accel) | 1393 | public override void SetAcceleration(OpenMetaverse.Vector3 accel) |
1394 | { | 1394 | { |
1395 | base.SetAcceleration(accel); | 1395 | base.SetAcceleration(accel); |
1396 | } | 1396 | } |
1397 | 1397 | ||
1398 | public override void AddForce(PhysicsVector force, bool pushforce) | 1398 | public override void AddForce(OpenMetaverse.Vector3 force, bool pushforce) |
1399 | { | 1399 | { |
1400 | base.AddForce(force, pushforce); | 1400 | base.AddForce(force, pushforce); |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | public override void SetMomentum(PhysicsVector momentum) | 1403 | public override void SetMomentum(OpenMetaverse.Vector3 momentum) |
1404 | { | 1404 | { |
1405 | base.SetMomentum(momentum); | 1405 | base.SetMomentum(momentum); |
1406 | } | 1406 | } |
@@ -1450,7 +1450,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1450 | m.Translation = v3; | 1450 | m.Translation = v3; |
1451 | rigidBody.WorldTransform = m; | 1451 | rigidBody.WorldTransform = m; |
1452 | //When an Avie touch the ground it's vertical velocity it's reduced to ZERO | 1452 | //When an Avie touch the ground it's vertical velocity it's reduced to ZERO |
1453 | Speed(new PhysicsVector(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f)); | 1453 | Speed(new OpenMetaverse.Vector3(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f)); |
1454 | } | 1454 | } |
1455 | } | 1455 | } |
1456 | 1456 | ||
@@ -1472,7 +1472,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1472 | //For now all prims have the same density, all prims are made of water. Be water my friend! :D | 1472 | //For now all prims have the same density, all prims are made of water. Be water my friend! :D |
1473 | private const float _density = 1000.0f; | 1473 | private const float _density = 1000.0f; |
1474 | private BulletXScene _parent_scene; | 1474 | private BulletXScene _parent_scene; |
1475 | private PhysicsVector m_prev_position = new PhysicsVector(0, 0, 0); | 1475 | private OpenMetaverse.Vector3 m_prev_position; |
1476 | private bool m_lastUpdateSent = false; | 1476 | private bool m_lastUpdateSent = false; |
1477 | //added by jed zhu | 1477 | //added by jed zhu |
1478 | private IMesh _mesh; | 1478 | private IMesh _mesh; |
@@ -1480,17 +1480,17 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1480 | 1480 | ||
1481 | 1481 | ||
1482 | 1482 | ||
1483 | public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector size, | 1483 | public BulletXPrim(String primName, BulletXScene parent_scene, OpenMetaverse.Vector3 pos, OpenMetaverse.Vector3 size, |
1484 | OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) | 1484 | OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isPhysical) |
1485 | : this( | 1485 | : this( |
1486 | primName, parent_scene, pos, new PhysicsVector(), size, new PhysicsVector(), rotation, mesh, pbs, | 1486 | primName, parent_scene, pos, OpenMetaverse.Vector3.Zero, size, OpenMetaverse.Vector3.Zero, rotation, mesh, pbs, |
1487 | isPhysical) | 1487 | isPhysical) |
1488 | { | 1488 | { |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | public BulletXPrim(String primName, BulletXScene parent_scene, PhysicsVector pos, PhysicsVector velocity, | 1491 | public BulletXPrim(String primName, BulletXScene parent_scene, OpenMetaverse.Vector3 pos, OpenMetaverse.Vector3 velocity, |
1492 | PhysicsVector size, | 1492 | OpenMetaverse.Vector3 size, |
1493 | PhysicsVector acceleration, OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, | 1493 | OpenMetaverse.Vector3 acceleration, OpenMetaverse.Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, |
1494 | bool isPhysical) | 1494 | bool isPhysical) |
1495 | : base(primName) | 1495 | : base(primName) |
1496 | { | 1496 | { |
@@ -1501,7 +1501,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1501 | 1501 | ||
1502 | _position = pos; | 1502 | _position = pos; |
1503 | _physical = isPhysical; | 1503 | _physical = isPhysical; |
1504 | _velocity = _physical ? velocity : new PhysicsVector(); | 1504 | _velocity = _physical ? velocity : OpenMetaverse.Vector3.Zero; |
1505 | _size = size; | 1505 | _size = size; |
1506 | _acceleration = acceleration; | 1506 | _acceleration = acceleration; |
1507 | _orientation = rotation; | 1507 | _orientation = rotation; |
@@ -1517,19 +1517,19 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1517 | set { return; } | 1517 | set { return; } |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | public override PhysicsVector Position | 1520 | public override OpenMetaverse.Vector3 Position |
1521 | { | 1521 | { |
1522 | get { return base.Position; } | 1522 | get { return base.Position; } |
1523 | set { base.Position = value; } | 1523 | set { base.Position = value; } |
1524 | } | 1524 | } |
1525 | 1525 | ||
1526 | public override PhysicsVector Velocity | 1526 | public override OpenMetaverse.Vector3 Velocity |
1527 | { | 1527 | { |
1528 | get { return base.Velocity; } | 1528 | get { return base.Velocity; } |
1529 | set { base.Velocity = value; } | 1529 | set { base.Velocity = value; } |
1530 | } | 1530 | } |
1531 | 1531 | ||
1532 | public override PhysicsVector Size | 1532 | public override OpenMetaverse.Vector3 Size |
1533 | { | 1533 | { |
1534 | get { return _size; } | 1534 | get { return _size; } |
1535 | set | 1535 | set |
@@ -1542,7 +1542,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1542 | } | 1542 | } |
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | public override PhysicsVector Acceleration | 1545 | public override OpenMetaverse.Vector3 Acceleration |
1546 | { | 1546 | { |
1547 | get { return base.Acceleration; } | 1547 | get { return base.Acceleration; } |
1548 | } | 1548 | } |
@@ -1603,7 +1603,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1603 | set { base.Kinematic = value; } | 1603 | set { base.Kinematic = value; } |
1604 | } | 1604 | } |
1605 | 1605 | ||
1606 | public override void SetAcceleration(PhysicsVector accel) | 1606 | public override void SetAcceleration(OpenMetaverse.Vector3 accel) |
1607 | { | 1607 | { |
1608 | lock (BulletXScene.BulletXLock) | 1608 | lock (BulletXScene.BulletXLock) |
1609 | { | 1609 | { |
@@ -1611,12 +1611,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1611 | } | 1611 | } |
1612 | } | 1612 | } |
1613 | 1613 | ||
1614 | public override void AddForce(PhysicsVector force, bool pushforce) | 1614 | public override void AddForce(OpenMetaverse.Vector3 force, bool pushforce) |
1615 | { | 1615 | { |
1616 | base.AddForce(force,pushforce); | 1616 | base.AddForce(force,pushforce); |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | public override void SetMomentum(PhysicsVector momentum) | 1619 | public override void SetMomentum(OpenMetaverse.Vector3 momentum) |
1620 | { | 1620 | { |
1621 | base.SetMomentum(momentum); | 1621 | base.SetMomentum(momentum); |
1622 | } | 1622 | } |
@@ -1633,7 +1633,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1633 | //When a Prim touch the ground it's vertical velocity it's reduced to ZERO | 1633 | //When a Prim touch the ground it's vertical velocity it's reduced to ZERO |
1634 | //Static objects don't have linear velocity | 1634 | //Static objects don't have linear velocity |
1635 | if (_physical) | 1635 | if (_physical) |
1636 | Speed(new PhysicsVector(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f)); | 1636 | Speed(new OpenMetaverse.Vector3(rigidBody.LinearVelocity.X, rigidBody.LinearVelocity.Y, 0.0f)); |
1637 | } | 1637 | } |
1638 | } | 1638 | } |
1639 | 1639 | ||
@@ -1652,7 +1652,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1652 | { | 1652 | { |
1653 | if (!m_lastUpdateSent) | 1653 | if (!m_lastUpdateSent) |
1654 | { | 1654 | { |
1655 | _velocity = new PhysicsVector(0, 0, 0); | 1655 | _velocity = OpenMetaverse.Vector3.Zero; |
1656 | base.ScheduleTerseUpdate(); | 1656 | base.ScheduleTerseUpdate(); |
1657 | m_lastUpdateSent = true; | 1657 | m_lastUpdateSent = true; |
1658 | } | 1658 | } |
@@ -1674,8 +1674,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1674 | 1674 | ||
1675 | #region Methods for updating values of RigidBody | 1675 | #region Methods for updating values of RigidBody |
1676 | 1676 | ||
1677 | protected internal void CreateRigidBody(BulletXScene parent_scene, IMesh mesh, PhysicsVector pos, | 1677 | protected internal void CreateRigidBody(BulletXScene parent_scene, IMesh mesh, OpenMetaverse.Vector3 pos, |
1678 | PhysicsVector size) | 1678 | OpenMetaverse.Vector3 size) |
1679 | { | 1679 | { |
1680 | //For RigidBody Constructor. The next values might change | 1680 | //For RigidBody Constructor. The next values might change |
1681 | float _linearDamping = 0.0f; | 1681 | float _linearDamping = 0.0f; |
@@ -1703,7 +1703,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1703 | Vector3[] v3Vertices = new Vector3[iVertexCount]; | 1703 | Vector3[] v3Vertices = new Vector3[iVertexCount]; |
1704 | for (int i = 0; i < iVertexCount; i++) | 1704 | for (int i = 0; i < iVertexCount; i++) |
1705 | { | 1705 | { |
1706 | PhysicsVector v = mesh.getVertexList()[i]; | 1706 | OpenMetaverse.Vector3 v = mesh.getVertexList()[i]; |
1707 | if (v != null) // Note, null has special meaning. See meshing code for details | 1707 | if (v != null) // Note, null has special meaning. See meshing code for details |
1708 | v3Vertices[i] = BulletXMaths.PhysicsVectorToXnaVector3(v); | 1708 | v3Vertices[i] = BulletXMaths.PhysicsVectorToXnaVector3(v); |
1709 | else | 1709 | else |
@@ -1729,7 +1729,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1729 | } | 1729 | } |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | protected internal void ReCreateRigidBody(PhysicsVector size) | 1732 | protected internal void ReCreateRigidBody(OpenMetaverse.Vector3 size) |
1733 | { | 1733 | { |
1734 | //There is a bug when trying to remove a rigidBody that is colliding with something.. | 1734 | //There is a bug when trying to remove a rigidBody that is colliding with something.. |
1735 | try | 1735 | try |
@@ -1749,7 +1749,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1749 | GC.Collect(); | 1749 | GC.Collect(); |
1750 | } | 1750 | } |
1751 | 1751 | ||
1752 | protected internal override void ReSize(PhysicsVector _newSize) | 1752 | protected internal override void ReSize(OpenMetaverse.Vector3 _newSize) |
1753 | { | 1753 | { |
1754 | //I wonder to know how to resize with a simple instruction in BulletX. It seems that for now there isn't | 1754 | //I wonder to know how to resize with a simple instruction in BulletX. It seems that for now there isn't |
1755 | //so i have to do it manually. That's recreating rigidbody | 1755 | //so i have to do it manually. That's recreating rigidbody |
@@ -1764,8 +1764,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1764 | /// </summary> | 1764 | /// </summary> |
1765 | internal class BulletXPlanet | 1765 | internal class BulletXPlanet |
1766 | { | 1766 | { |
1767 | private PhysicsVector _staticPosition; | 1767 | private OpenMetaverse.Vector3 _staticPosition; |
1768 | // private PhysicsVector _staticVelocity; | 1768 | // private Vector3 _staticVelocity; |
1769 | // private OpenMetaverse.Quaternion _staticOrientation; | 1769 | // private OpenMetaverse.Quaternion _staticOrientation; |
1770 | private float _mass; | 1770 | private float _mass; |
1771 | // private BulletXScene _parentscene; | 1771 | // private BulletXScene _parentscene; |
@@ -1779,7 +1779,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
1779 | 1779 | ||
1780 | internal BulletXPlanet(BulletXScene parent_scene, float[] heightField) | 1780 | internal BulletXPlanet(BulletXScene parent_scene, float[] heightField) |
1781 | { | 1781 | { |
1782 | _staticPosition = new PhysicsVector(BulletXScene.MaxXY/2, BulletXScene.MaxXY/2, 0); | 1782 | _staticPosition = new OpenMetaverse.Vector3(BulletXScene.MaxXY / 2, BulletXScene.MaxXY / 2, 0); |
1783 | // _staticVelocity = new PhysicsVector(); | 1783 | // _staticVelocity = new PhysicsVector(); |
1784 | // _staticOrientation = OpenMetaverse.Quaternion.Identity; | 1784 | // _staticOrientation = OpenMetaverse.Quaternion.Identity; |
1785 | _mass = 0; //No active | 1785 | _mass = 0; //No active |