-Implemented an Corrected Vector-Methods, just Transform by Quaternion missing

-Fixed Unittests
This commit is contained in:
SND\xToast_cp 2011-11-19 18:52:31 +00:00
parent 89b65cc2be
commit 806367f4ff
15 changed files with 238 additions and 125 deletions

View File

@ -504,12 +504,17 @@ namespace ANX.Framework.TestCenter
public static void ConvertEquals(XNAVector2[] xna, ANXVector2[] anx, String test)
{
bool result = true;
string xnaString = string.Empty;
string anxString = string.Empty;
for (int i = 0; i < xna.Length; i++)
{
result = CompareFloats(xna[i].X, anx[i].X, epsilon) &&
CompareFloats(xna[i].Y, anx[i].Y, epsilon);
xnaString = xna[i].ToString() + " ";
anxString = anx[i].ToString() + " ";
if (!result)
break;
}
@ -520,7 +525,7 @@ namespace ANX.Framework.TestCenter
}
else
{
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xna.ToString(), anx.ToString()));
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xnaString, anxString));
}
}
@ -541,6 +546,8 @@ namespace ANX.Framework.TestCenter
public static void ConvertEquals(XNAVector3[] xna, ANXVector3[] anx, String test)
{
bool result = true;
string xnaString = string.Empty;
string anxString = string.Empty;
for (int i = 0; i < xna.Length; i++)
{
@ -548,6 +555,9 @@ namespace ANX.Framework.TestCenter
CompareFloats(xna[i].Y, anx[i].Y, epsilon) &&
CompareFloats(xna[i].Z, anx[i].Z, epsilon);
xnaString += xna[i].ToString() + " ";
anxString += anx[i].ToString() + " ";
if (!result)
break;
}
@ -558,7 +568,7 @@ namespace ANX.Framework.TestCenter
}
else
{
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xna.ToString(), anx.ToString()));
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xnaString, anxString));
}
}
@ -580,13 +590,18 @@ namespace ANX.Framework.TestCenter
public static void ConvertEquals(XNAVector4[] xna, ANXVector4[] anx, String test)
{
bool result = true;
string xnaString = string.Empty;
string anxString = string.Empty;
for (int i = 0; i < xna.Length; i++)
{
result = CompareFloats(xna[i].X, anx[i].X, epsilon) &&
CompareFloats(xna[i].Y, anx[i].Y, epsilon) &&
CompareFloats(xna[i].Z, anx[i].Z, epsilon) &&
CompareFloats(xna[i].Z, anx[i].W, epsilon);
CompareFloats(xna[i].W, anx[i].W, epsilon);
xnaString += xna[i].ToString() + " ";
anxString += anx[i].ToString() + " ";
if (!result)
break;
@ -598,7 +613,7 @@ namespace ANX.Framework.TestCenter
}
else
{
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xna.ToString(), anx.ToString()));
Assert.Fail(string.Format("{0} failed: xna({1}) anx({2})", test, xnaString, anxString));
}
}

View File

@ -873,9 +873,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector2[] xna = new XNAVector2[2];
XNAVector2.Transform(xnaVector, ref xnaMatrix, xna);
XNAVector2.TransformNormal(xnaVector, ref xnaMatrix, xna);
ANXVector2[] anx = new ANXVector2[2];
ANXVector2.Transform(anxVector, ref anxMatrix, anx);
ANXVector2.TransformNormal(anxVector, ref anxMatrix, anx);
AssertHelper.ConvertEquals(xna, anx, "TransformNormalStaticToDestination");
}
@ -893,9 +893,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector2[] xna = new XNAVector2[2];
XNAVector2.Transform(xnaVector, 1, ref xnaMatrix, xna, 1, 1);
XNAVector2.TransformNormal(xnaVector, 1, ref xnaMatrix, xna, 1, 1);
ANXVector2[] anx = new ANXVector2[2];
ANXVector2.Transform(anxVector, 1, ref anxMatrix, anx, 1, 1);
ANXVector2.TransformNormal(anxVector, 1, ref anxMatrix, anx, 1, 1);
AssertHelper.ConvertEquals(xna, anx, "TransformNormalStaticToDestinationWithIndex");
}

View File

@ -768,9 +768,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.Transform(xnaVector, ref xnaMatrix, xna);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.Transform(anxVector, ref anxMatrix, anx);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrixToDestination");
@ -789,9 +789,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXQuaternion anxQuaternion = new ANXQuaternion(xQ, yQ, zQ, wQ);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.Transform(xnaVector, ref xnaQuaternion, xna);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.Transform(anxVector, ref anxQuaternion, anx);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticQuaternionToDestination");
@ -809,9 +809,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.Transform(xnaVector, 1, ref xnaMatrix, xna, 1, 1);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.Transform(anxVector, 1, ref anxMatrix, anx, 1, 1);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrixToDestinationWithIndex");
@ -830,9 +830,9 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXQuaternion anxQuaternion = new ANXQuaternion(xQ, yQ, zQ, wQ);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.Transform(xnaVector, 1, ref xnaQuaternion, xna, 1, 1);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.Transform(anxVector, 1, ref anxQuaternion, anx, 1, 1);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticQuaternionToDestinationWithIndex");
@ -868,10 +868,10 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3.Transform(xnaVector, ref xnaMatrix, xna);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3.Transform(anxVector, ref anxMatrix, anx);
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.TransformNormal(xnaVector, ref xnaMatrix, xna);
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.TransformNormal(anxVector, ref anxMatrix, anx);
AssertHelper.ConvertEquals(xna, anx, "TransformNormalStaticToDestination");
}
@ -888,10 +888,10 @@ namespace ANX.Framework.TestCenter.Strukturen
ANXVector3[] anxVector = new ANXVector3[] { new ANXVector3(x1, y1, z1), new ANXVector3(x2, y2, z2) };
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector3[] xna = new XNAVector3[2];
XNAVector3.Transform(xnaVector, 1, ref xnaMatrix, xna, 1, 1);
ANXVector3[] anx = new ANXVector3[2];
ANXVector3.Transform(anxVector, 1, ref anxMatrix, anx, 1, 1);
XNAVector3[] xna = new XNAVector3[2] { XNAVector3.Zero, XNAVector3.Zero };
XNAVector3.TransformNormal(xnaVector, 1, ref xnaMatrix, xna, 0, 1);
ANXVector3[] anx = new ANXVector3[2] { ANXVector3.Zero, ANXVector3.Zero };
ANXVector3.TransformNormal(anxVector, 1, ref anxMatrix, anx, 0, 1);
AssertHelper.ConvertEquals(xna, anx, "TransformNormalStaticToDestinationWithIndex");
}

View File

@ -678,7 +678,43 @@ namespace ANX.Framework.TestCenter.Strukturen
#region Transformations
[Test, TestCaseSource("twentyfourFloats")]
public void TransformStaticMatrix(
public void TransformStaticMatrixVector2(
float x, float y,
float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44,
float nop0, float nop1, float nop2, float nop3, float nop4, float nop5)
{
XNAVector2 xnaVector = new XNAVector2(x, y);
XNAMatrix xnaMatrix = new XNAMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
ANXVector2 anxVector = new ANXVector2(x, y);
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector4 xna = XNAVector4.Transform(xnaVector, xnaMatrix);
ANXVector4 anx = ANXVector4.Transform(anxVector, anxMatrix);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrixVector2");
}
[Test, TestCaseSource("twentyfourFloats")]
public void TransformStaticMatrixVector3(
float x, float y, float z,
float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44,
float nop0, float nop1, float nop2, float nop3, float nop4)
{
XNAVector3 xnaVector = new XNAVector3(x, y, z);
XNAMatrix xnaMatrix = new XNAMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
ANXVector3 anxVector = new ANXVector3(x, y, z);
ANXMatrix anxMatrix = new ANXMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44);
XNAVector4 xna = XNAVector4.Transform(xnaVector, xnaMatrix);
ANXVector4 anx = ANXVector4.Transform(anxVector, anxMatrix);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrixVector3");
}
[Test, TestCaseSource("twentyfourFloats")]
public void TransformStaticMatrixVector4(
float x, float y, float z, float w,
float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44,
float nop0, float nop1, float nop2, float nop3)
@ -692,7 +728,7 @@ namespace ANX.Framework.TestCenter.Strukturen
XNAVector4 xna = XNAVector4.Transform(xnaVector, xnaMatrix);
ANXVector4 anx = ANXVector4.Transform(anxVector, anxMatrix);
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrix");
AssertHelper.ConvertEquals(xna, anx, "TransformStaticMatrixVector4");
}
[Test, TestCaseSource("twentyfourFloats")]

View File

@ -160,57 +160,57 @@
<Compile Include="GameComponentCollection.cs" />
<Compile Include="GameComponentCollectionEventArgs.cs" />
<Compile Include="GameHost.cs" />
<Compile Include="GamerServices\Achievement.cs" />
<Compile Include="GamerServices\AchievementCollection.cs" />
<Compile Include="GamerServices\AvatarAnimation.cs" />
<Compile Include="GamerServices\AvatarAnimationPreset.cs" />
<Compile Include="GamerServices\AvatarBodyType.cs" />
<Compile Include="GamerServices\AvatarBone.cs" />
<Compile Include="GamerServices\AvatarDescription.cs" />
<Compile Include="GamerServices\AvatarExpression.cs" />
<Compile Include="GamerServices\AvatarEye.cs" />
<Compile Include="GamerServices\AvatarEyebrow.cs" />
<Compile Include="GamerServices\AvatarMouth.cs" />
<Compile Include="GamerServices\AvatarRenderer.cs" />
<Compile Include="GamerServices\AvatarRendererState.cs" />
<Compile Include="GamerServices\ControllerSensitivity.cs" />
<Compile Include="GamerServices\FriendCollection.cs" />
<Compile Include="GamerServices\FriendGamer.cs" />
<Compile Include="GamerServices\GameDefaults.cs" />
<Compile Include="GamerServices\GameDifficulty.cs" />
<Compile Include="GamerServices\GamerCollection.cs" />
<Compile Include="GamerServices\GamerPresence.cs" />
<Compile Include="GamerServices\GamerPresenceMode.cs" />
<Compile Include="GamerServices\GamerPrivilegeException.cs" />
<Compile Include="GamerServices\GamerPrivileges.cs" />
<Compile Include="GamerServices\GamerPrivilegeSetting.cs" />
<Compile Include="GamerServices\GamerProfile.cs" />
<Compile Include="GamerServices\GamerServicesComponent.cs" />
<Compile Include="GamerServices\GamerServicesDispatcher.cs" />
<Compile Include="GamerServices\GamerServicesNotAvailableException.cs" />
<Compile Include="GamerServices\GamerZone.cs" />
<Compile Include="GamerServices\GameUpdateRequiredException.cs" />
<Compile Include="GamerServices\Guide.cs" />
<Compile Include="GamerServices\GuideAlreadyVisibleException.cs" />
<Compile Include="GamerServices\IAvatarAnimation.cs" />
<Compile Include="GamerServices\Gamer.cs" />
<Compile Include="GamerServices\InviteAcceptedEventArgs.cs" />
<Compile Include="GamerServices\LeaderboardEntry.cs" />
<Compile Include="GamerServices\LeaderboardIdentity.cs" />
<Compile Include="GamerServices\LeaderboardKey.cs" />
<Compile Include="GamerServices\LeaderboardOutcome.cs" />
<Compile Include="GamerServices\LeaderboardReader.cs" />
<Compile Include="GamerServices\LeaderboardWriter.cs" />
<Compile Include="GamerServices\MessageBoxIcon.cs" />
<Compile Include="GamerServices\NetworkException.cs" />
<Compile Include="GamerServices\NetworkNotAvailableException.cs" />
<Compile Include="GamerServices\NotificationPosition.cs" />
<Compile Include="GamerServices\PropertyDictionary.cs" />
<Compile Include="GamerServices\RacingCameraAngle.cs" />
<Compile Include="GamerServices\SignedInEventArgs.cs" />
<Compile Include="GamerServices\SignedInGamer.cs" />
<Compile Include="GamerServices\SignedInGamerCollection.cs" />
<Compile Include="GamerServices\SignedOutEventArgs.cs" />
<Compile Include="Design\GamerServices\Achievement.cs" />
<Compile Include="Design\GamerServices\AchievementCollection.cs" />
<Compile Include="Design\GamerServices\AvatarAnimation.cs" />
<Compile Include="Design\GamerServices\AvatarAnimationPreset.cs" />
<Compile Include="Design\GamerServices\AvatarBodyType.cs" />
<Compile Include="Design\GamerServices\AvatarBone.cs" />
<Compile Include="Design\GamerServices\AvatarDescription.cs" />
<Compile Include="Design\GamerServices\AvatarExpression.cs" />
<Compile Include="Design\GamerServices\AvatarEye.cs" />
<Compile Include="Design\GamerServices\AvatarEyebrow.cs" />
<Compile Include="Design\GamerServices\AvatarMouth.cs" />
<Compile Include="Design\GamerServices\AvatarRenderer.cs" />
<Compile Include="Design\GamerServices\AvatarRendererState.cs" />
<Compile Include="Design\GamerServices\ControllerSensitivity.cs" />
<Compile Include="Design\GamerServices\FriendCollection.cs" />
<Compile Include="Design\GamerServices\FriendGamer.cs" />
<Compile Include="Design\GamerServices\GameDefaults.cs" />
<Compile Include="Design\GamerServices\GameDifficulty.cs" />
<Compile Include="Design\GamerServices\GamerCollection.cs" />
<Compile Include="Design\GamerServices\GamerPresence.cs" />
<Compile Include="Design\GamerServices\GamerPresenceMode.cs" />
<Compile Include="Design\GamerServices\GamerPrivilegeException.cs" />
<Compile Include="Design\GamerServices\GamerPrivileges.cs" />
<Compile Include="Design\GamerServices\GamerPrivilegeSetting.cs" />
<Compile Include="Design\GamerServices\GamerProfile.cs" />
<Compile Include="Design\GamerServices\GamerServicesComponent.cs" />
<Compile Include="Design\GamerServices\GamerServicesDispatcher.cs" />
<Compile Include="Design\GamerServices\GamerServicesNotAvailableException.cs" />
<Compile Include="Design\GamerServices\GamerZone.cs" />
<Compile Include="Design\GamerServices\GameUpdateRequiredException.cs" />
<Compile Include="Design\GamerServices\Guide.cs" />
<Compile Include="Design\GamerServices\GuideAlreadyVisibleException.cs" />
<Compile Include="Design\GamerServices\IAvatarAnimation.cs" />
<Compile Include="Design\GamerServices\Gamer.cs" />
<Compile Include="Design\GamerServices\InviteAcceptedEventArgs.cs" />
<Compile Include="Design\GamerServices\LeaderboardEntry.cs" />
<Compile Include="Design\GamerServices\LeaderboardIdentity.cs" />
<Compile Include="Design\GamerServices\LeaderboardKey.cs" />
<Compile Include="Design\GamerServices\LeaderboardOutcome.cs" />
<Compile Include="Design\GamerServices\LeaderboardReader.cs" />
<Compile Include="Design\GamerServices\LeaderboardWriter.cs" />
<Compile Include="Design\GamerServices\MessageBoxIcon.cs" />
<Compile Include="Design\GamerServices\NetworkException.cs" />
<Compile Include="Design\GamerServices\NetworkNotAvailableException.cs" />
<Compile Include="Design\GamerServices\NotificationPosition.cs" />
<Compile Include="Design\GamerServices\PropertyDictionary.cs" />
<Compile Include="Design\GamerServices\RacingCameraAngle.cs" />
<Compile Include="Design\GamerServices\SignedInEventArgs.cs" />
<Compile Include="Design\GamerServices\SignedInGamer.cs" />
<Compile Include="Design\GamerServices\SignedInGamerCollection.cs" />
<Compile Include="Design\GamerServices\SignedOutEventArgs.cs" />
<Compile Include="GameServiceContainer.cs" />
<Compile Include="GameTime.cs" />
<Compile Include="GameTimer.cs" />

View File

@ -453,32 +453,41 @@ namespace ANX.Framework
public static void Transform(Vector2[] sourceArray, int sourceIndex, ref Matrix matrix, Vector2[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[destinationIndex]);
}
public static void Transform(Vector2[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector2[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[destinationIndex]);
}
public static void Transform(Vector2[] sourceArray, ref Matrix matrix, Vector2[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[i]);
}
public static void Transform(Vector2[] sourceArray, ref Quaternion rotation, Vector2[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[i]);
}
public static Vector2 TransformNormal(Vector2 normal, Matrix matrix)
{
throw new NotImplementedException();
Vector2 result;
TransformNormal(ref normal, ref matrix, out result);
return result;
}
public static void TransformNormal(ref Vector2 normal, ref Matrix matrix, out Vector2 result)
{
throw new NotImplementedException();
result.X = ((normal.X * matrix.M11) + (normal.Y * matrix.M21));
result.Y = ((normal.X * matrix.M12) + (normal.Y * matrix.M22));
}
public static void TransformNormal(
@ -489,7 +498,9 @@ namespace ANX.Framework
int destinationIndex,
int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
TransformNormal(ref sourceArray[i], ref matrix, out destinationArray[destinationIndex]);
}
public static void TransformNormal(
@ -497,7 +508,8 @@ namespace ANX.Framework
ref Matrix matrix,
Vector2[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
TransformNormal(ref sourceArray[i], ref matrix, out destinationArray[i]);
}
#endregion

View File

@ -509,66 +509,91 @@ namespace ANX.Framework
result.Z = MathHelper.SmoothStep(value1.Z, value2.Z, amount);
}
#region Transformations
public static Vector3 Transform(Vector3 position, Matrix matrix)
{
throw new NotImplementedException();
}
public static Vector3 Transform(Vector3 value, Quaternion rotation)
{
throw new NotImplementedException();
Vector3 result;
Transform(ref position, ref matrix, out result);
return result;
}
//source: XNI
public static void Transform(ref Vector3 position, ref Matrix matrix, out Vector3 result)
{
throw new NotImplementedException();
result.X = (position.X * matrix.M11) + (position.Y * matrix.M21) + (position.Z * matrix.M31) + matrix.M41;
result.Y = (position.X * matrix.M12) + (position.Y * matrix.M22) + (position.Z * matrix.M32) + matrix.M42;
result.Z = (position.X * matrix.M13) + (position.Y * matrix.M23) + (position.Z * matrix.M33) + matrix.M43;
}
public static Vector3 Transform(Vector3 value, Quaternion quaternion)
{
Vector3 result;
Transform(ref value, ref quaternion, out result);
return result;
}
public static void Transform(ref Vector3 value, ref Quaternion rotation, out Vector3 result)
{
throw new NotImplementedException();
result.X = (rotation.Y * value.Z - rotation.Z * value.Y);
result.Y = (rotation.Z * value.X - rotation.X * value.Z);
result.Z = (rotation.X * value.Y - rotation.Y * value.X);
result.X = value.X + result.X * rotation.W + (rotation.Y * result.Z - rotation.Z * result.Y);
result.Y = value.Y + result.Y * rotation.W + (rotation.Z * result.X - rotation.X * result.Z);
result.Z = value.Z + result.Z * rotation.W + (rotation.X * result.Y - rotation.Y * result.X);
}
public static void Transform(Vector3[] sourceArray, ref Matrix matrix, Vector3[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[i]);
}
public static void Transform(Vector3[] sourceArray, ref Quaternion rotation, Vector3[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[i]);
}
public static void Transform(Vector3[] sourceArray, int sourceIndex, ref Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[destinationIndex]);
}
public static void Transform(Vector3[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector3[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[destinationIndex]);
}
public static Vector3 TransformNormal(Vector3 normal, Matrix matrix)
{
throw new NotImplementedException();
Vector3 result;
TransformNormal(ref normal, ref matrix, out result);
return result;
}
public static void TransformNormal(ref Vector3 normal, ref Matrix matrix, out Vector3 result)
{
throw new NotImplementedException();
result.X = (normal.X * matrix.M11) + (normal.Y * matrix.M21) + (normal.Z * matrix.M31);
result.Y = (normal.X * matrix.M12) + (normal.Y * matrix.M22) + (normal.Z * matrix.M32);
result.Z = (normal.X * matrix.M13) + (normal.Y * matrix.M23) + (normal.Z * matrix.M33);
}
public static void TransformNormal(Vector3[] sourceArray, ref Matrix matrix, Vector3[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
TransformNormal(ref sourceArray[i], ref matrix, out destinationArray[i]);
}
public static void TransformNormal(Vector3[] sourceArray, int sourceIndex, ref Matrix matrix, Vector3[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
TransformNormal(ref sourceArray[i], ref matrix, out destinationArray[destinationIndex]);
}
#endregion

View File

@ -453,17 +453,24 @@ namespace ANX.Framework
public static Vector4 Transform(Vector2 position, Matrix matrix)
{
throw new NotImplementedException(); ;
Vector4 result;
Transform(ref position, ref matrix, out result);
return result;
}
public static void Transform(ref Vector2 position, ref Matrix matrix, out Vector4 result)
{
throw new NotImplementedException();
result.X = (position.X * matrix.M11) + (position.Y * matrix.M21) + matrix.M41;
result.Y = (position.X * matrix.M12) + (position.Y * matrix.M22) + matrix.M42;
result.Z = (position.X * matrix.M13) + (position.Y * matrix.M23) + matrix.M43;
result.W = (position.X * matrix.M14) + (position.Y * matrix.M24) + matrix.M44;
}
public static Vector4 Transform(Vector2 value, Quaternion rotation)
{
throw new NotImplementedException();
Vector4 result;
Transform(ref value, ref rotation, out result);
return result;
}
public static void Transform(ref Vector2 value, ref Quaternion rotation, out Vector4 result)
@ -473,17 +480,24 @@ namespace ANX.Framework
public static Vector4 Transform(Vector3 position, Matrix matrix)
{
throw new NotImplementedException();
Vector4 result;
Transform(ref position, ref matrix, out result);
return result;
}
public static void Transform(ref Vector3 position, ref Matrix matrix, out Vector4 result)
{
throw new NotImplementedException();
result.X = (position.X * matrix.M11) + (position.Y * matrix.M21) + (position.Z * matrix.M31) + matrix.M41;
result.Y = (position.X * matrix.M12) + (position.Y * matrix.M22) + (position.Z * matrix.M32) + matrix.M42;
result.Z = (position.X * matrix.M13) + (position.Y * matrix.M23) + (position.Z * matrix.M33) + matrix.M43;
result.W = (position.X * matrix.M14) + (position.Y * matrix.M24) + (position.Z * matrix.M34) + matrix.M44;
}
public static Vector4 Transform(Vector3 value, Quaternion rotation)
{
throw new NotImplementedException();
Vector4 result;
Transform(ref value, ref rotation, out result);
return result;
}
public static void Transform(ref Vector3 value, ref Quaternion rotation, out Vector4 result)
@ -493,17 +507,24 @@ namespace ANX.Framework
public static Vector4 Transform(Vector4 vector, Matrix matrix)
{
throw new NotImplementedException();
Vector4 result;
Transform(ref vector, ref matrix, out result);
return result;
}
public static void Transform(ref Vector4 vector, ref Matrix matrix, out Vector4 result)
{
throw new NotImplementedException();
result.X = (vector.X * matrix.M11) + (vector.Y * matrix.M21) + (vector.Z * matrix.M31) + (vector.W * matrix.M41);
result.Y = (vector.X * matrix.M12) + (vector.Y * matrix.M22) + (vector.Z * matrix.M32) + (vector.W * matrix.M42);
result.Z = (vector.X * matrix.M13) + (vector.Y * matrix.M23) + (vector.Z * matrix.M33) + (vector.W * matrix.M43);
result.W = (vector.X * matrix.M14) + (vector.Y * matrix.M24) + (vector.Z * matrix.M34) + (vector.W * matrix.M44);
}
public static Vector4 Transform(Vector4 value, Quaternion rotation)
{
throw new NotImplementedException();
Vector4 result;
Transform(ref value, ref rotation, out result);
return result;
}
public static void Transform(ref Vector4 value, ref Quaternion rotation, out Vector4 result)
@ -511,26 +532,31 @@ namespace ANX.Framework
throw new NotImplementedException();
}
public static void Transform(Vector4[] sourceArray, int sourceIndex, ref Matrix matrix, Vector4[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
}
public static void Transform(Vector4[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4[] destinationArray, int destinationIndex, int length)
{
throw new NotImplementedException();
}
public static void Transform(Vector4[] sourceArray, ref Matrix matrix, Vector4[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[i]);
}
public static void Transform(Vector4[] sourceArray, int sourceIndex, ref Matrix matrix, Vector4[] destinationArray, int destinationIndex, int length)
{
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref matrix, out destinationArray[destinationIndex]);
}
public static void Transform(Vector4[] sourceArray, ref Quaternion rotation, Vector4[] destinationArray)
{
throw new NotImplementedException();
for (int i = 0; i < sourceArray.Length; i++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[i]);
}
public static void Transform(Vector4[] sourceArray, int sourceIndex, ref Quaternion rotation, Vector4[] destinationArray, int destinationIndex, int length)
{
length += sourceIndex;
for (int i = sourceIndex; i < length; i++, destinationIndex++)
Transform(ref sourceArray[i], ref rotation, out destinationArray[destinationIndex]);
}
#endregion
#region Public Methods

View File

@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;XNAEXT</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

View File

@ -95,6 +95,5 @@ namespace ANX.InputSystem.Windows.XInput
get {return null; }
}
#endif
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.