diff options
author | Teravus Ovares | 2009-07-10 00:13:42 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-07-10 00:13:42 +0000 |
commit | e15ffe31e38fe201f9c346703f5c1a2d86cfc809 (patch) | |
tree | 07f8009fbd362d9f9c07889d97c74a212546f557 /OpenSim/Region/Framework | |
parent | Thank you kindly, Godfrey, for a patch that: (diff) | |
download | opensim-SC_OLD-e15ffe31e38fe201f9c346703f5c1a2d86cfc809.zip opensim-SC_OLD-e15ffe31e38fe201f9c346703f5c1a2d86cfc809.tar.gz opensim-SC_OLD-e15ffe31e38fe201f9c346703f5c1a2d86cfc809.tar.bz2 opensim-SC_OLD-e15ffe31e38fe201f9c346703f5c1a2d86cfc809.tar.xz |
* Commit some BinBVH rotation convenience. Calculates the W element of the joint rotation quaternion and provides a property so consumer doesn't have to.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs index 367e8d8..1dd9613 100644 --- a/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs +++ b/OpenSim/Region/Framework/Scenes/BinBVHAnimation.cs | |||
@@ -345,6 +345,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
345 | // argh! floats into two bytes!.. bad bad bad bad | 345 | // argh! floats into two bytes!.. bad bad bad bad |
346 | // After fighting with it for a while.. -1, to 1 seems to give the best results | 346 | // After fighting with it for a while.. -1, to 1 seems to give the best results |
347 | rotations = readKeys(data, ref i, rotationkeys, -1f, 1f); | 347 | rotations = readKeys(data, ref i, rotationkeys, -1f, 1f); |
348 | for (int iter = 0; iter < rotations.Length; iter++) | ||
349 | { | ||
350 | rotations[iter].W = 1f - | ||
351 | (rotations[iter].key_element.X + rotations[iter].key_element.Y + | ||
352 | rotations[iter].key_element.Z); | ||
353 | } | ||
348 | 354 | ||
349 | 355 | ||
350 | if (!BitConverter.IsLittleEndian) | 356 | if (!BitConverter.IsLittleEndian) |
@@ -481,6 +487,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
481 | /// </summary> | 487 | /// </summary> |
482 | public Vector3 key_element; | 488 | public Vector3 key_element; |
483 | 489 | ||
490 | public float W; | ||
491 | |||
484 | public void WriteBytesToStream(BinaryWriter iostream, float InPoint, float OutPoint, float min, float max) | 492 | public void WriteBytesToStream(BinaryWriter iostream, float InPoint, float OutPoint, float min, float max) |
485 | { | 493 | { |
486 | iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(time, InPoint, OutPoint)))); | 494 | iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(time, InPoint, OutPoint)))); |