diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.Region/Scenes/ScenePresence.cs | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs index e2e30b9..ffec3e5 100644 --- a/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs +++ b/OpenSim/OpenSim.Region/Scenes/ScenePresence.cs | |||
@@ -223,26 +223,23 @@ namespace OpenSim.Region.Scenes | |||
223 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | 223 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); |
224 | if (((movementflag & 1) == 0) || (q != this.bodyRot)) | 224 | if (((movementflag & 1) == 0) || (q != this.bodyRot)) |
225 | { | 225 | { |
226 | //we should add a new force to the list | ||
227 | // but for now we will deal with velocities | ||
228 | NewForce newVelocity = new NewForce(); | ||
229 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); | 226 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); |
230 | Axiom.MathLib.Vector3 direc = q * v3; | 227 | this.AddNewMovement(v3, q); |
231 | direc.Normalize(); | ||
232 | |||
233 | //work out velocity for sim physics system | ||
234 | direc = direc * ((0.03f) * 128f); | ||
235 | if (this._physActor.Flying) | ||
236 | direc *= 4; | ||
237 | |||
238 | newVelocity.X = direc.x; | ||
239 | newVelocity.Y = direc.y; | ||
240 | newVelocity.Z = direc.z; | ||
241 | this.forcesList.Add(newVelocity); | ||
242 | movementflag = 1; | 228 | movementflag = 1; |
243 | this.bodyRot = q; | 229 | this.bodyRot = q; |
244 | } | 230 | } |
245 | } | 231 | } |
232 | else if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG) != 0) | ||
233 | { | ||
234 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | ||
235 | if (((movementflag & 2) == 0) || (q != this.bodyRot)) | ||
236 | { | ||
237 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0); | ||
238 | this.AddNewMovement(v3, q); | ||
239 | movementflag = 2; | ||
240 | this.bodyRot = q; | ||
241 | } | ||
242 | } | ||
246 | else | 243 | else |
247 | { | 244 | { |
248 | if ((movementflag) != 0) | 245 | if ((movementflag) != 0) |
@@ -257,6 +254,23 @@ namespace OpenSim.Region.Scenes | |||
257 | } | 254 | } |
258 | 255 | ||
259 | } | 256 | } |
257 | |||
258 | protected void AddNewMovement(Axiom.MathLib.Vector3 vec, Axiom.MathLib.Quaternion rotation) | ||
259 | { | ||
260 | NewForce newVelocity = new NewForce(); | ||
261 | Axiom.MathLib.Vector3 direc = rotation * vec; | ||
262 | direc.Normalize(); | ||
263 | |||
264 | direc = direc * ((0.03f) * 128f); | ||
265 | if (this._physActor.Flying) | ||
266 | direc *= 4; | ||
267 | |||
268 | newVelocity.X = direc.x; | ||
269 | newVelocity.Y = direc.y; | ||
270 | newVelocity.Z = direc.z; | ||
271 | this.forcesList.Add(newVelocity); | ||
272 | } | ||
273 | |||
260 | #endregion | 274 | #endregion |
261 | 275 | ||
262 | #region Overridden Methods | 276 | #region Overridden Methods |