aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorJeff Ames2007-11-19 04:46:05 +0000
committerJeff Ames2007-11-19 04:46:05 +0000
commitc261812e39a9a3543e0370ef725bde0553609c34 (patch)
tree684e197506e9ccc19c54e530ec42c608e06942ea /OpenSim/Region/Physics
parent* Split space array structure into a two dimentional array instead of a singl... (diff)
downloadopensim-SC-c261812e39a9a3543e0370ef725bde0553609c34.zip
opensim-SC-c261812e39a9a3543e0370ef725bde0553609c34.tar.gz
opensim-SC-c261812e39a9a3543e0370ef725bde0553609c34.tar.bz2
opensim-SC-c261812e39a9a3543e0370ef725bde0553609c34.tar.xz
added rotation support to POS
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index 2e0f2e3..e13cedd 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -135,15 +135,19 @@ namespace OpenSim.Region.Physics.POSPlugin
135 " absX: " + Math.Abs(p.Position.X - c.Position.X) + 135 " absX: " + Math.Abs(p.Position.X - c.Position.X) +
136 " sizeX: " + p.Size.X * 0.5 + 0.5); 136 " sizeX: " + p.Size.X * 0.5 + 0.5);
137 */ 137 */
138 if (Math.Abs(p.Position.X - c.Position.X) >= (p.Size.X * 0.5 + 0.5)) 138
139 Vector3 rotatedPos = p.Orientation.Inverse() * new Vector3(c.Position.X - p.Position.X, c.Position.Y - p.Position.Y, c.Position.Z - p.Position.Z);;
140 Vector3 avatarSize = p.Orientation.Inverse() * new Vector3(c.Size.X, c.Size.Y, c.Size.Z);
141
142 if (Math.Abs(rotatedPos.x) >= (p.Size.X * 0.5 + avatarSize.x))
139 { 143 {
140 return false; 144 return false;
141 } 145 }
142 if (Math.Abs(p.Position.Y - c.Position.Y) >= (p.Size.Y * 0.5 + 0.5)) 146 if (Math.Abs(rotatedPos.y) >= (p.Size.Y * 0.5 + avatarSize.y))
143 { 147 {
144 return false; 148 return false;
145 } 149 }
146 if (Math.Abs(p.Position.Z - c.Position.Z) >= (p.Size.Z * 0.5 + 1.0)) 150 if (Math.Abs(rotatedPos.z) >= (p.Size.Z * 0.5 + avatarSize.z))
147 { 151 {
148 return false; 152 return false;
149 } 153 }
@@ -338,7 +342,7 @@ namespace OpenSim.Region.Physics.POSPlugin
338 342
339 public override PhysicsVector Size 343 public override PhysicsVector Size
340 { 344 {
341 get { return new PhysicsVector(0, 0, 0); } 345 get { return new PhysicsVector(0.5f, 0.5f, 1.0f); }
342 set { } 346 set { }
343 } 347 }
344 348