aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsVector.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-25 23:16:12 -0700
committerJohn Hurliman2009-10-26 18:23:43 -0700
commitd199767e6991d6f368661fce9c5a072e564b8a4b (patch)
treed9347b8a424c0164e208f908613aa8fe1511444b /OpenSim/Region/Physics/Manager/PhysicsVector.cs
parent* Double the priority on avatar bake texture requests to get avatars rezzing ... (diff)
downloadopensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.zip
opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.gz
opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.bz2
opensim-SC_OLD-d199767e6991d6f368661fce9c5a072e564b8a4b.tar.xz
Experimental change of PhysicsVector to Vector3. Untested
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsVector.cs')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsVector.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs
index d6f4d0d..f60a636 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs
@@ -29,24 +29,24 @@ using System;
29 29
30namespace OpenSim.Region.Physics.Manager 30namespace OpenSim.Region.Physics.Manager
31{ 31{
32 public class PhysicsVector 32 /*public class PhysicsVector
33 { 33 {
34 public float X; 34 public float X;
35 public float Y; 35 public float Y;
36 public float Z; 36 public float Z;
37 37
38 public PhysicsVector() 38 public Vector3()
39 { 39 {
40 } 40 }
41 41
42 public PhysicsVector(float x, float y, float z) 42 public Vector3(float x, float y, float z)
43 { 43 {
44 X = x; 44 X = x;
45 Y = y; 45 Y = y;
46 Z = z; 46 Z = z;
47 } 47 }
48 48
49 public PhysicsVector(PhysicsVector pv) : this(pv.X, pv.Y, pv.Z) 49 public Vector3(Vector3 pv) : this(pv.X, pv.Y, pv.Z)
50 { 50 {
51 } 51 }
52 52
@@ -115,17 +115,17 @@ namespace OpenSim.Region.Physics.Manager
115 } 115 }
116 116
117 // Operations 117 // Operations
118 public static PhysicsVector operator +(PhysicsVector a, PhysicsVector b) 118 public static PhysicsVector operator +(Vector3 a, Vector3 b)
119 { 119 {
120 return new PhysicsVector(a.X + b.X, a.Y + b.Y, a.Z + b.Z); 120 return new PhysicsVector(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
121 } 121 }
122 122
123 public static PhysicsVector operator -(PhysicsVector a, PhysicsVector b) 123 public static PhysicsVector operator -(Vector3 a, Vector3 b)
124 { 124 {
125 return new PhysicsVector(a.X - b.X, a.Y - b.Y, a.Z - b.Z); 125 return new PhysicsVector(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
126 } 126 }
127 127
128 public static PhysicsVector cross(PhysicsVector a, PhysicsVector b) 128 public static PhysicsVector cross(Vector3 a, Vector3 b)
129 { 129 {
130 return new PhysicsVector(a.Y*b.Z - a.Z*b.Y, a.Z*b.X - a.X*b.Z, a.X*b.Y - a.Y*b.X); 130 return new PhysicsVector(a.Y*b.Z - a.Z*b.Y, a.Z*b.X - a.X*b.Z, a.X*b.Y - a.Y*b.X);
131 } 131 }
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Physics.Manager
135 return (float) Math.Sqrt(X*X + Y*Y + Z*Z); 135 return (float) Math.Sqrt(X*X + Y*Y + Z*Z);
136 } 136 }
137 137
138 public static float GetDistanceTo(PhysicsVector a, PhysicsVector b) 138 public static float GetDistanceTo(Vector3 a, Vector3 b)
139 { 139 {
140 float dx = a.X - b.X; 140 float dx = a.X - b.X;
141 float dy = a.Y - b.Y; 141 float dy = a.Y - b.Y;
@@ -143,22 +143,22 @@ namespace OpenSim.Region.Physics.Manager
143 return (float) Math.Sqrt(dx * dx + dy * dy + dz * dz); 143 return (float) Math.Sqrt(dx * dx + dy * dy + dz * dz);
144 } 144 }
145 145
146 public static PhysicsVector operator /(PhysicsVector v, float f) 146 public static PhysicsVector operator /(Vector3 v, float f)
147 { 147 {
148 return new PhysicsVector(v.X/f, v.Y/f, v.Z/f); 148 return new PhysicsVector(v.X/f, v.Y/f, v.Z/f);
149 } 149 }
150 150
151 public static PhysicsVector operator *(PhysicsVector v, float f) 151 public static PhysicsVector operator *(Vector3 v, float f)
152 { 152 {
153 return new PhysicsVector(v.X*f, v.Y*f, v.Z*f); 153 return new PhysicsVector(v.X*f, v.Y*f, v.Z*f);
154 } 154 }
155 155
156 public static PhysicsVector operator *(float f, PhysicsVector v) 156 public static PhysicsVector operator *(float f, Vector3 v)
157 { 157 {
158 return v*f; 158 return v*f;
159 } 159 }
160 160
161 public static bool isFinite(PhysicsVector v) 161 public static bool isFinite(Vector3 v)
162 { 162 {
163 if (v == null) 163 if (v == null)
164 return false; 164 return false;
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Physics.Manager
172 return true; 172 return true;
173 } 173 }
174 174
175 public virtual bool IsIdentical(PhysicsVector v, float tolerance) 175 public virtual bool IsIdentical(Vector3 v, float tolerance)
176 { 176 {
177 PhysicsVector diff = this - v; 177 PhysicsVector diff = this - v;
178 float d = diff.length(); 178 float d = diff.length();
@@ -182,5 +182,5 @@ namespace OpenSim.Region.Physics.Manager
182 return false; 182 return false;
183 } 183 }
184 184
185 } 185 }*/
186} 186}