Changed Quaternion to use floats

This commit is contained in:
hondacrx
2017-07-02 00:48:05 -04:00
parent ccee7604da
commit 8b78fc7361
5 changed files with 79 additions and 107 deletions
+2 -2
View File
@@ -796,11 +796,11 @@ namespace Framework.GameMath
{ {
get get
{ {
return this[(row - 1) * 3 + (column - 1)]; return this[row * 3 + column];
} }
set set
{ {
this[(row - 1) * 3 + (column - 1)] = value; this[row * 3 + column] = value;
} }
} }
#endregion #endregion
@@ -44,10 +44,10 @@ namespace Framework.GameMath
public struct Quaternion : ICloneable public struct Quaternion : ICloneable
{ {
#region Private Fields #region Private Fields
private double _w; private float _w;
private double _x; private float _x;
private double _y; private float _y;
private double _z; private float _z;
#endregion #endregion
#region Constructors #region Constructors
@@ -58,7 +58,7 @@ namespace Framework.GameMath
/// <param name="y">The quaternions's Y coordinate.</param> /// <param name="y">The quaternions's Y coordinate.</param>
/// <param name="z">The quaternions's Z coordinate.</param> /// <param name="z">The quaternions's Z coordinate.</param>
/// /// <param name="w">The quaternions's W coordinate.</param> /// /// <param name="w">The quaternions's W coordinate.</param>
public Quaternion(double x, double y, double z, double w) public Quaternion(float x, float y, float z, float w)
{ {
_w = w; _w = w;
_x = x; _x = x;
@@ -83,7 +83,7 @@ namespace Framework.GameMath
// Find the index of the largest diagonal component // Find the index of the largest diagonal component
// These ? operations hopefully compile to conditional // These ? operations hopefully compile to conditional
// move instructions instead of branches. // move instructions instead of branches.
int i = (rot[1, 1] > rot[0, 0]) ? 1 : 0; int i = (rot[1, 1] > rot[0, 0]) ? 2 : 1;
i = (rot[2, 2] > rot[i, i]) ? 2 : i; i = (rot[2, 2] > rot[i, i]) ? 2 : i;
// Find the indices of the other elements // Find the indices of the other elements
@@ -162,7 +162,7 @@ namespace Framework.GameMath
/// Gets or sets the x-coordinate of this quaternion. /// Gets or sets the x-coordinate of this quaternion.
/// </summery> /// </summery>
/// <value>The x-coordinate of this quaternion.</value> /// <value>The x-coordinate of this quaternion.</value>
public double X public float X
{ {
get { return _x; } get { return _x; }
set { _x = value; } set { _x = value; }
@@ -171,7 +171,7 @@ namespace Framework.GameMath
/// Gets or sets the y-coordinate of this quaternion. /// Gets or sets the y-coordinate of this quaternion.
/// </summery> /// </summery>
/// <value>The y-coordinate of this quaternion.</value> /// <value>The y-coordinate of this quaternion.</value>
public double Y public float Y
{ {
get { return _y; } get { return _y; }
set { _y = value; } set { _y = value; }
@@ -180,7 +180,7 @@ namespace Framework.GameMath
/// Gets or sets the z-coordinate of this quaternion. /// Gets or sets the z-coordinate of this quaternion.
/// </summery> /// </summery>
/// <value>The z-coordinate of this quaternion.</value> /// <value>The z-coordinate of this quaternion.</value>
public double Z public float Z
{ {
get { return _z; } get { return _z; }
set { _z = value; } set { _z = value; }
@@ -189,7 +189,7 @@ namespace Framework.GameMath
/// Gets or sets the w-coordinate of this quaternion. /// Gets or sets the w-coordinate of this quaternion.
/// </summery> /// </summery>
/// <value>The w-coordinate of this quaternion.</value> /// <value>The w-coordinate of this quaternion.</value>
public double W public float W
{ {
get { return _w; } get { return _w; }
set { _w = value; } set { _w = value; }
@@ -199,18 +199,18 @@ namespace Framework.GameMath
/// Gets the the modulus of the quaternion. /// Gets the the modulus of the quaternion.
/// </summary> /// </summary>
/// <value>A double-precision floating-point number.</value> /// <value>A double-precision floating-point number.</value>
public double Modulus public float Modulus
{ {
get get
{ {
return System.Math.Sqrt(_w * _w + _x * _x + _y * _y + _z * _z); return (float)System.Math.Sqrt(_w * _w + _x * _x + _y * _y + _z * _z);
} }
} }
/// <summary> /// <summary>
/// Gets the the squared modulus of the quaternion. /// Gets the the squared modulus of the quaternion.
/// </summary> /// </summary>
/// <value>A double-precision floating-point number.</value> /// <value>A double-precision floating-point number.</value>
public double ModulusSquared public float ModulusSquared
{ {
get get
{ {
@@ -266,10 +266,10 @@ namespace Framework.GameMath
if (m.Success) if (m.Success)
{ {
return new Quaternion( return new Quaternion(
double.Parse(m.Result("${x}")), float.Parse(m.Result("${x}")),
double.Parse(m.Result("${y}")), float.Parse(m.Result("${y}")),
double.Parse(m.Result("${z}")), float.Parse(m.Result("${z}")),
double.Parse(m.Result("${w}")) float.Parse(m.Result("${w}"))
); );
} }
else else
@@ -294,10 +294,10 @@ namespace Framework.GameMath
if (m.Success) if (m.Success)
{ {
result = new Quaternion( result = new Quaternion(
double.Parse(m.Result("${x}")), float.Parse(m.Result("${x}")),
double.Parse(m.Result("${y}")), float.Parse(m.Result("${y}")),
double.Parse(m.Result("${z}")), float.Parse(m.Result("${z}")),
double.Parse(m.Result("${w}")) float.Parse(m.Result("${w}"))
); );
return true; return true;
@@ -392,7 +392,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion Multiply(Quaternion quaternion, double scalar) public static Quaternion Multiply(Quaternion quaternion, float scalar)
{ {
Quaternion result = new Quaternion(quaternion); Quaternion result = new Quaternion(quaternion);
result.X *= scalar; result.X *= scalar;
@@ -408,7 +408,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <param name="result">A <see cref="Quaternion"/> instance to hold the result.</param> /// <param name="result">A <see cref="Quaternion"/> instance to hold the result.</param>
public static void Multiply(Quaternion quaternion, double scalar, ref Quaternion result) public static void Multiply(Quaternion quaternion, float scalar, ref Quaternion result)
{ {
result.X = quaternion.X * scalar; result.X = quaternion.X * scalar;
result.Y = quaternion.Y * scalar; result.Y = quaternion.Y * scalar;
@@ -422,7 +422,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion Divide(Quaternion quaternion, double scalar) public static Quaternion Divide(Quaternion quaternion, float scalar)
{ {
if (scalar == 0) if (scalar == 0)
{ {
@@ -443,7 +443,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <param name="result">A <see cref="Quaternion"/> instance to hold the result.</param> /// <param name="result">A <see cref="Quaternion"/> instance to hold the result.</param>
public static void Divide(Quaternion quaternion, double scalar, ref Quaternion result) public static void Divide(Quaternion quaternion, float scalar, ref Quaternion result)
{ {
if (scalar == 0) if (scalar == 0)
{ {
@@ -502,12 +502,12 @@ namespace Framework.GameMath
if (Math.Abs(quaternion.W) < 1.0) if (Math.Abs(quaternion.W) < 1.0)
{ {
double angle = System.Math.Acos(quaternion.W); float angle = (float)System.Math.Acos(quaternion.W);
double sin = System.Math.Sin(angle); float sin = (float)System.Math.Sin(angle);
if (Math.Abs(sin) >= 0) if (Math.Abs(sin) >= 0)
{ {
double coeff = angle / sin; float coeff = angle / sin;
result.X = coeff * quaternion.X; result.X = coeff * quaternion.X;
result.Y = coeff * quaternion.Y; result.Y = coeff * quaternion.Y;
result.Z = coeff * quaternion.Z; result.Z = coeff * quaternion.Z;
@@ -531,12 +531,12 @@ namespace Framework.GameMath
{ {
Quaternion result = new Quaternion(0, 0, 0, 0); Quaternion result = new Quaternion(0, 0, 0, 0);
double angle = System.Math.Sqrt(quaternion.X * quaternion.X + quaternion.Y * quaternion.Y + quaternion.Z * quaternion.Z); float angle = (float)System.Math.Sqrt(quaternion.X * quaternion.X + quaternion.Y * quaternion.Y + quaternion.Z * quaternion.Z);
double sin = System.Math.Sin(angle); float sin = (float)System.Math.Sin(angle);
if (Math.Abs(sin) > 0) if (Math.Abs(sin) > 0)
{ {
double coeff = angle / sin; float coeff = angle / sin;
result.X = coeff * quaternion.X; result.X = coeff * quaternion.X;
result.Y = coeff * quaternion.Y; result.Y = coeff * quaternion.Y;
result.Z = coeff * quaternion.Z; result.Z = coeff * quaternion.Z;
@@ -558,10 +558,10 @@ namespace Framework.GameMath
/// </summary> /// </summary>
public void Inverse() public void Inverse()
{ {
double norm = ModulusSquared; float norm = ModulusSquared;
if (norm > 0) if (norm > 0)
{ {
double invNorm = 1.0 / norm; float invNorm = 1.0f / norm;
_w *= invNorm; _w *= invNorm;
_x *= -invNorm; _x *= -invNorm;
_y *= -invNorm; _y *= -invNorm;
@@ -577,7 +577,7 @@ namespace Framework.GameMath
/// </summary> /// </summary>
public void Normalize() public void Normalize()
{ {
double norm = Modulus; float norm = Modulus;
if (norm == 0) if (norm == 0)
{ {
throw new DivideByZeroException("Trying to normalize a quaternion with modulus of zero."); throw new DivideByZeroException("Trying to normalize a quaternion with modulus of zero.");
@@ -595,7 +595,7 @@ namespace Framework.GameMath
/// <remarks> /// <remarks>
/// The quaternion values that are close to zero within the given tolerance are set to zero. /// The quaternion values that are close to zero within the given tolerance are set to zero.
/// </remarks> /// </remarks>
public void ClampZero(double tolerance) public void ClampZero(float tolerance)
{ {
_x = MathFunctions.Clamp(_x, 0, tolerance); _x = MathFunctions.Clamp(_x, 0, tolerance);
_y = MathFunctions.Clamp(_y, 0, tolerance); _y = MathFunctions.Clamp(_y, 0, tolerance);
@@ -712,7 +712,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion operator *(Quaternion quaternion, double scalar) public static Quaternion operator *(Quaternion quaternion, float scalar)
{ {
return Quaternion.Multiply(quaternion, scalar); return Quaternion.Multiply(quaternion, scalar);
} }
@@ -722,7 +722,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion operator *(double scalar, Quaternion quaternion) public static Quaternion operator *(float scalar, Quaternion quaternion)
{ {
return Quaternion.Multiply(quaternion, scalar); return Quaternion.Multiply(quaternion, scalar);
} }
@@ -732,7 +732,7 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion operator /(Quaternion quaternion, double scalar) public static Quaternion operator /(Quaternion quaternion, float scalar)
{ {
return Quaternion.Divide(quaternion, scalar); return Quaternion.Divide(quaternion, scalar);
} }
@@ -742,9 +742,9 @@ namespace Framework.GameMath
/// <param name="quaternion">A <see cref="Quaternion"/> instance.</param> /// <param name="quaternion">A <see cref="Quaternion"/> instance.</param>
/// <param name="scalar">A scalar.</param> /// <param name="scalar">A scalar.</param>
/// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns> /// <returns>A <see cref="Quaternion"/> instance to hold the result.</returns>
public static Quaternion operator /(double scalar, Quaternion quaternion) public static Quaternion operator /(float scalar, Quaternion quaternion)
{ {
return Quaternion.Multiply(quaternion, (1.0 / scalar)); return Quaternion.Multiply(quaternion, (1.0f / scalar));
} }
#endregion #endregion
@@ -752,7 +752,7 @@ namespace Framework.GameMath
/// <summary> /// <summary>
/// Indexer ( [w, x, y, z] ). /// Indexer ( [w, x, y, z] ).
/// </summary> /// </summary>
public double this[int index] public float this[int index]
{ {
get get
{ {
-28
View File
@@ -58,20 +58,6 @@ public static class MathFunctions
/// Returns the clamped value. /// Returns the clamped value.
/// result = (tolerance > Abs(value-calmpedValue)) ? calmpedValue : value; /// result = (tolerance > Abs(value-calmpedValue)) ? calmpedValue : value;
/// </returns> /// </returns>
public static double Clamp(double value, double calmpedValue, double tolerance)
{
return (tolerance > Math.Abs(value - calmpedValue)) ? calmpedValue : value;
}
/// <summary>
/// Clamp a <paramref name="value"/> to <paramref name="calmpedValue"/> if it is withon the <paramref name="tolerance"/> range.
/// </summary>
/// <param name="value">The value to clamp.</param>
/// <param name="calmpedValue">The clamped value.</param>
/// <param name="tolerance">The tolerance value.</param>
/// <returns>
/// Returns the clamped value.
/// result = (tolerance > Abs(value-calmpedValue)) ? calmpedValue : value;
/// </returns>
public static float Clamp(float value, float calmpedValue, float tolerance) public static float Clamp(float value, float calmpedValue, float tolerance)
{ {
return (tolerance > Math.Abs(value - calmpedValue)) ? calmpedValue : value; return (tolerance > Math.Abs(value - calmpedValue)) ? calmpedValue : value;
@@ -83,20 +69,6 @@ public static class MathFunctions
/// <param name="calmpedValue">The clamped value.</param> /// <param name="calmpedValue">The clamped value.</param>
/// <returns> /// <returns>
/// Returns the clamped value. /// Returns the clamped value.
/// result = (Epsilon > Abs(value-calmpedValue)) ? calmpedValue : value;
/// </returns>
/// <remarks><see cref="MathFunctions.EpsilonD"/> is used for tolerance.</remarks>
public static double Clamp(double value, double calmpedValue)
{
return (Epsilon > Math.Abs(value - calmpedValue)) ? calmpedValue : value;
}
/// <summary>
/// Clamp a <paramref name="value"/> to <paramref name="calmpedValue"/> using the default tolerance value.
/// </summary>
/// <param name="value">The value to clamp.</param>
/// <param name="calmpedValue">The clamped value.</param>
/// <returns>
/// Returns the clamped value.
/// result = (EpsilonF > Abs(value-calmpedValue)) ? calmpedValue : value; /// result = (EpsilonF > Abs(value-calmpedValue)) ? calmpedValue : value;
/// </returns> /// </returns>
/// <remarks><see cref="MathFunctions.EpsilonF"/> is used for tolerance.</remarks> /// <remarks><see cref="MathFunctions.EpsilonF"/> is used for tolerance.</remarks>
+32 -32
View File
@@ -55,45 +55,45 @@ namespace Game.BattleFields
{ {
// Wall (Not spawned in db) // Wall (Not spawned in db)
// Entry WS X Y Z O rX rY rZ rW Type // Entry WS X Y Z O rX rY rZ rW Type
new WintergraspBuildingSpawnData(190219, 3749, 5371.457f, 3047.472f, 407.5710f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190219, 3749, 5371.457f, 3047.472f, 407.5710f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190220, 3750, 5331.264f, 3047.105f, 407.9228f, 0.05235888f, 0.0f, 0.0f, 0.026176450f, 0.99965730, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190220, 3750, 5331.264f, 3047.105f, 407.9228f, 0.05235888f, 0.0f, 0.0f, 0.026176450f, 0.99965730f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191795, 3764, 5385.841f, 2909.490f, 409.7127f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.99999050, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191795, 3764, 5385.841f, 2909.490f, 409.7127f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.99999050f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191796, 3772, 5384.452f, 2771.835f, 410.2704f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191796, 3772, 5384.452f, 2771.835f, 410.2704f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191799, 3762, 5371.436f, 2630.610f, 408.8163f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191799, 3762, 5371.436f, 2630.610f, 408.8163f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191800, 3766, 5301.838f, 2909.089f, 409.8661f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.99999050, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191800, 3766, 5301.838f, 2909.089f, 409.8661f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.99999050f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191801, 3770, 5301.063f, 2771.411f, 409.9014f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191801, 3770, 5301.063f, 2771.411f, 409.9014f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.00000000f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191802, 3751, 5280.197f, 2995.583f, 408.8249f, 1.61442800f, 0.0f, 0.0f, 0.722363500f, 0.69151360, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191802, 3751, 5280.197f, 2995.583f, 408.8249f, 1.61442800f, 0.0f, 0.0f, 0.722363500f, 0.69151360f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191803, 3752, 5279.136f, 2956.023f, 408.6041f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191803, 3752, 5279.136f, 2956.023f, 408.6041f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191804, 3767, 5278.685f, 2882.513f, 409.5388f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191804, 3767, 5278.685f, 2882.513f, 409.5388f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191806, 3769, 5279.502f, 2798.945f, 409.9983f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191806, 3769, 5279.502f, 2798.945f, 409.9983f, 1.57079600f, 0.0f, 0.0f, 0.707106600f, 0.70710690f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191807, 3759, 5279.937f, 2724.766f, 409.9452f, 1.56207000f, 0.0f, 0.0f, 0.704014800f, 0.71018530, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191807, 3759, 5279.937f, 2724.766f, 409.9452f, 1.56207000f, 0.0f, 0.0f, 0.704014800f, 0.71018530f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191808, 3760, 5279.601f, 2683.786f, 409.8488f, 1.55334100f, 0.0f, 0.0f, 0.700908700f, 0.71325110, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191808, 3760, 5279.601f, 2683.786f, 409.8488f, 1.55334100f, 0.0f, 0.0f, 0.700908700f, 0.71325110f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191809, 3761, 5330.955f, 2630.777f, 409.2826f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191809, 3761, 5330.955f, 2630.777f, 409.2826f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190369, 3753, 5256.085f, 2933.963f, 409.3571f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190369, 3753, 5256.085f, 2933.963f, 409.3571f, 3.13285800f, 0.0f, 0.0f, 0.999990500f, 0.00436732f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190370, 3758, 5257.463f, 2747.327f, 409.7427f, -3.13285800f, 0.0f, 0.0f, -0.999990500f, 0.00436732, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190370, 3758, 5257.463f, 2747.327f, 409.7427f, -3.13285800f, 0.0f, 0.0f, -0.999990500f, 0.00436732f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190371, 3754, 5214.960f, 2934.089f, 409.1905f, -0.00872424f, 0.0f, 0.0f, -0.004362106f, 0.99999050, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190371, 3754, 5214.960f, 2934.089f, 409.1905f, -0.00872424f, 0.0f, 0.0f, -0.004362106f, 0.99999050f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190372, 3757, 5215.821f, 2747.566f, 409.1884f, -3.13285800f, 0.0f, 0.0f, -0.999990500f, 0.00436732, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190372, 3757, 5215.821f, 2747.566f, 409.1884f, -3.13285800f, 0.0f, 0.0f, -0.999990500f, 0.00436732f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190374, 3755, 5162.273f, 2883.043f, 410.2556f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.70401500, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190374, 3755, 5162.273f, 2883.043f, 410.2556f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.70401500f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(190376, 3756, 5163.724f, 2799.838f, 409.2270f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.70401500, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(190376, 3756, 5163.724f, 2799.838f, 409.2270f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.70401500f, WGGameObjectBuildingType.Wall),
// Tower of keep (Not spawned in db) // Tower of keep (Not spawned in db)
new WintergraspBuildingSpawnData(190221, 3711, 5281.154f, 3044.588f, 407.8434f, 3.115388f, 0.0f, 0.0f, 0.9999142f, 0.013101960, WGGameObjectBuildingType.KeepTower), // NW new WintergraspBuildingSpawnData(190221, 3711, 5281.154f, 3044.588f, 407.8434f, 3.115388f, 0.0f, 0.0f, 0.9999142f, 0.013101960f, WGGameObjectBuildingType.KeepTower), // NW
new WintergraspBuildingSpawnData(190373, 3713, 5163.757f, 2932.228f, 409.1904f, 3.124123f, 0.0f, 0.0f, 0.9999619f, 0.008734641, WGGameObjectBuildingType.KeepTower), // SW new WintergraspBuildingSpawnData(190373, 3713, 5163.757f, 2932.228f, 409.1904f, 3.124123f, 0.0f, 0.0f, 0.9999619f, 0.008734641f, WGGameObjectBuildingType.KeepTower), // SW
new WintergraspBuildingSpawnData(190377, 3714, 5166.397f, 2748.368f, 409.1884f, -1.570796f, 0.0f, 0.0f, -0.7071066f, 0.707106900, WGGameObjectBuildingType.KeepTower), // SE new WintergraspBuildingSpawnData(190377, 3714, 5166.397f, 2748.368f, 409.1884f, -1.570796f, 0.0f, 0.0f, -0.7071066f, 0.707106900f, WGGameObjectBuildingType.KeepTower), // SE
new WintergraspBuildingSpawnData(190378, 3712, 5281.192f, 2632.479f, 409.0985f, -1.588246f, 0.0f, 0.0f, -0.7132492f, 0.700910500, WGGameObjectBuildingType.KeepTower), // NE new WintergraspBuildingSpawnData(190378, 3712, 5281.192f, 2632.479f, 409.0985f, -1.588246f, 0.0f, 0.0f, -0.7132492f, 0.700910500f, WGGameObjectBuildingType.KeepTower), // NE
// Wall (with passage) (Not spawned in db) // Wall (with passage) (Not spawned in db)
new WintergraspBuildingSpawnData(191797, 3765, 5343.290f, 2908.860f, 409.5757f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.9999905, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191797, 3765, 5343.290f, 2908.860f, 409.5757f, 0.00872424f, 0.0f, 0.0f, 0.004362106f, 0.9999905f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191798, 3771, 5342.719f, 2771.386f, 409.6249f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.0000000, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191798, 3771, 5342.719f, 2771.386f, 409.6249f, 3.14159300f, 0.0f, 0.0f, -1.000000000f, 0.0000000f, WGGameObjectBuildingType.Wall),
new WintergraspBuildingSpawnData(191805, 3768, 5279.126f, 2840.797f, 409.7826f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.7040150, WGGameObjectBuildingType.Wall), new WintergraspBuildingSpawnData(191805, 3768, 5279.126f, 2840.797f, 409.7826f, 1.57952200f, 0.0f, 0.0f, 0.710185100f, 0.7040150f, WGGameObjectBuildingType.Wall),
// South tower (Not spawned in db) // South tower (Not spawned in db)
new WintergraspBuildingSpawnData(190356, 3704, 4557.173f, 3623.943f, 395.8828f, 1.675516f, 0.0f, 0.0f, 0.7431450f, 0.669130400, WGGameObjectBuildingType.Tower), // W new WintergraspBuildingSpawnData(190356, 3704, 4557.173f, 3623.943f, 395.8828f, 1.675516f, 0.0f, 0.0f, 0.7431450f, 0.669130400f, WGGameObjectBuildingType.Tower), // W
new WintergraspBuildingSpawnData(190357, 3705, 4398.172f, 2822.497f, 405.6270f, -3.124123f, 0.0f, 0.0f, -0.9999619f, 0.008734641, WGGameObjectBuildingType.Tower), // S new WintergraspBuildingSpawnData(190357, 3705, 4398.172f, 2822.497f, 405.6270f, -3.124123f, 0.0f, 0.0f, -0.9999619f, 0.008734641f, WGGameObjectBuildingType.Tower), // S
new WintergraspBuildingSpawnData(190358, 3706, 4459.105f, 1944.326f, 434.9912f, -2.002762f, 0.0f, 0.0f, -0.8422165f, 0.539139500, WGGameObjectBuildingType.Tower), // E new WintergraspBuildingSpawnData(190358, 3706, 4459.105f, 1944.326f, 434.9912f, -2.002762f, 0.0f, 0.0f, -0.8422165f, 0.539139500f, WGGameObjectBuildingType.Tower), // E
// Door of forteress (Not spawned in db) // Door of forteress (Not spawned in db)
new WintergraspBuildingSpawnData(WGGameObjects.FortressGate, 3763, 5162.991f, 2841.232f, 410.1892f, -3.132858f, 0.0f, 0.0f, -0.9999905f, 0.00436732, WGGameObjectBuildingType.Door), new WintergraspBuildingSpawnData(WGGameObjects.FortressGate, 3763, 5162.991f, 2841.232f, 410.1892f, -3.132858f, 0.0f, 0.0f, -0.9999905f, 0.00436732f, WGGameObjectBuildingType.Door),
// Last door (Not spawned in db) // Last door (Not spawned in db)
new WintergraspBuildingSpawnData(WGGameObjects.VaultGate, 3773, 5397.108f, 2841.54f, 425.9014f, 3.141593f, 0.0f, 0.0f, -1.0f, 0.0f, WGGameObjectBuildingType.DoorLast), new WintergraspBuildingSpawnData(WGGameObjects.VaultGate, 3773, 5397.108f, 2841.54f, 425.9014f, 3.141593f, 0.0f, 0.0f, -1.0f, 0.0f, WGGameObjectBuildingType.DoorLast),
@@ -742,7 +742,7 @@ namespace Game.BattleFields
struct WintergraspBuildingSpawnData struct WintergraspBuildingSpawnData
{ {
public WintergraspBuildingSpawnData(uint entry, uint worldstate, float x, float y, float z, float o, double rX, double rY, double rZ, double rW, WGGameObjectBuildingType type) public WintergraspBuildingSpawnData(uint entry, uint worldstate, float x, float y, float z, float o, float rX, float rY, float rZ, float rW, WGGameObjectBuildingType type)
{ {
Entry = entry; Entry = entry;
WorldState = worldstate; WorldState = worldstate;
+4 -4
View File
@@ -2009,10 +2009,10 @@ namespace Game.Entities
public void SetParentRotation(Quaternion rotation) public void SetParentRotation(Quaternion rotation)
{ {
SetFloatValue(GameObjectFields.ParentRotation + 0, (float)rotation.X); SetFloatValue(GameObjectFields.ParentRotation + 0, rotation.X);
SetFloatValue(GameObjectFields.ParentRotation + 1, (float)rotation.Y); SetFloatValue(GameObjectFields.ParentRotation + 1, rotation.Y);
SetFloatValue(GameObjectFields.ParentRotation + 2, (float)rotation.Z); SetFloatValue(GameObjectFields.ParentRotation + 2, rotation.Z);
SetFloatValue(GameObjectFields.ParentRotation + 3, (float)rotation.W); SetFloatValue(GameObjectFields.ParentRotation + 3, rotation.W);
} }
public void SetWorldRotationAngles(float z_rot, float y_rot, float x_rot) public void SetWorldRotationAngles(float z_rot, float y_rot, float x_rot)