diff options
author | Jeff Ames | 2009-08-26 12:58:37 +0900 |
---|---|---|
committer | Jeff Ames | 2009-08-26 14:02:01 +0900 |
commit | 256624566f4708fc6e3280c240393d0abdb7beb6 (patch) | |
tree | 2b0005a270e4dad39f888f8c760ad0ada3635798 /OpenSim/Region/Physics/POSPlugin | |
parent | A slightly modified version of (diff) | |
download | opensim-SC_OLD-256624566f4708fc6e3280c240393d0abdb7beb6.zip opensim-SC_OLD-256624566f4708fc6e3280c240393d0abdb7beb6.tar.gz opensim-SC_OLD-256624566f4708fc6e3280c240393d0abdb7beb6.tar.bz2 opensim-SC_OLD-256624566f4708fc6e3280c240393d0abdb7beb6.tar.xz |
Formatting cleanup, minor refactoring.
Diffstat (limited to 'OpenSim/Region/Physics/POSPlugin')
-rw-r--r-- | OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Physics/POSPlugin/POSScene.cs | 14 |
2 files changed, 8 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs index 1973adf..35fc616 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSCharacter.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
43 | private PhysicsVector _acceleration; | 43 | private PhysicsVector _acceleration; |
44 | private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; | 44 | private PhysicsVector m_rotationalVelocity = PhysicsVector.Zero; |
45 | private bool flying; | 45 | private bool flying; |
46 | private bool iscolliding; | 46 | private bool isColliding; |
47 | 47 | ||
48 | public POSCharacter() | 48 | public POSCharacter() |
49 | { | 49 | { |
@@ -116,8 +116,8 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
116 | 116 | ||
117 | public override bool IsColliding | 117 | public override bool IsColliding |
118 | { | 118 | { |
119 | get { return iscolliding; } | 119 | get { return isColliding; } |
120 | set { iscolliding = value; } | 120 | set { isColliding = value; } |
121 | } | 121 | } |
122 | 122 | ||
123 | public override bool CollidingGround | 123 | public override bool CollidingGround |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/Physics/POSPlugin/POSScene.cs index 5361be0..fa8cc70 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSScene.cs | |||
@@ -113,20 +113,16 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
113 | c.Position.Z - p.Position.Z) * Quaternion.Inverse(p.Orientation); | 113 | c.Position.Z - p.Position.Z) * Quaternion.Inverse(p.Orientation); |
114 | Vector3 avatarSize = new Vector3(c.Size.X, c.Size.Y, c.Size.Z) * Quaternion.Inverse(p.Orientation); | 114 | Vector3 avatarSize = new Vector3(c.Size.X, c.Size.Y, c.Size.Z) * Quaternion.Inverse(p.Orientation); |
115 | 115 | ||
116 | if (Math.Abs(rotatedPos.X) >= (p.Size.X*0.5 + Math.Abs(avatarSize.X)) || | 116 | return (Math.Abs(rotatedPos.X) < (p.Size.X*0.5 + Math.Abs(avatarSize.X)) && |
117 | Math.Abs(rotatedPos.Y) >= (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) || | 117 | Math.Abs(rotatedPos.Y) < (p.Size.Y*0.5 + Math.Abs(avatarSize.Y)) && |
118 | Math.Abs(rotatedPos.Z) >= (p.Size.Z*0.5 + Math.Abs(avatarSize.Z))) | 118 | Math.Abs(rotatedPos.Z) < (p.Size.Z*0.5 + Math.Abs(avatarSize.Z))); |
119 | { | ||
120 | return false; | ||
121 | } | ||
122 | return true; | ||
123 | } | 119 | } |
124 | 120 | ||
125 | private bool isCollidingWithPrim(POSCharacter c) | 121 | private bool isCollidingWithPrim(POSCharacter c) |
126 | { | 122 | { |
127 | for (int i = 0; i < _prims.Count; ++i) | 123 | foreach (POSPrim p in _prims) |
128 | { | 124 | { |
129 | if (isColliding(c, _prims[i])) | 125 | if (isColliding(c, p)) |
130 | { | 126 | { |
131 | return true; | 127 | return true; |
132 | } | 128 | } |