From 8b48608d45c8266b765e8ee29e612fb18376aa65 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 12 Feb 2011 15:00:44 +0100 Subject: fixed W7 (missing vtxclr/nrm/texcoord dicts now supported) and the matrix code --- NW4RTools/ColladaWriter.cs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'NW4RTools/ColladaWriter.cs') diff --git a/NW4RTools/ColladaWriter.cs b/NW4RTools/ColladaWriter.cs index a292ba0..b2fc5a2 100644 --- a/NW4RTools/ColladaWriter.cs +++ b/NW4RTools/ColladaWriter.cs @@ -79,26 +79,26 @@ namespace NW4RTools { //cNode.type = NodeType.JOINT; cNode.node1 = new node[0]; - float cosX = Math.Cos(origNode.Rotation.x / 180 * Math.PI); - float cosY = Math.Cos(origNode.Rotation.y / 180 * Math.PI); - float cosZ = Math.Cos(origNode.Rotation.z / 180 * Math.PI); - float sinX = Math.Sin(origNode.Rotation.x / 180 * Math.PI); - float sinY = Math.Sin(origNode.Rotation.y / 180 * Math.PI); - float sinZ = Math.Sin(origNode.Rotation.z / 180 * Math.PI); + double cosX = Math.Cos(origNode.Rotation.x / 180 * Math.PI); + double cosY = Math.Cos(origNode.Rotation.y / 180 * Math.PI); + double cosZ = Math.Cos(origNode.Rotation.z / 180 * Math.PI); + double sinX = Math.Sin(origNode.Rotation.x / 180 * Math.PI); + double sinY = Math.Sin(origNode.Rotation.y / 180 * Math.PI); + double sinZ = Math.Sin(origNode.Rotation.z / 180 * Math.PI); var nodeMatrix = new matrix(); nodeMatrix.Values = new double[] { - origNode.Scale.X * cosY * cosZ, - origNode.Scale.Y * (sinX * cosZ * sinY - cosX * sinZ), - origNode.Scale.Z * (sinX * sinZ + cosX * cosZ * sinY), + origNode.Scale.x * cosY * cosZ, + origNode.Scale.y * (sinX * cosZ * sinY - cosX * sinZ), + origNode.Scale.z * (sinX * sinZ + cosX * cosZ * sinY), origNode.Translation.x, - origNode.Scale.X * sinZ * cosY, - origNode.Scale.Y * (sinX * sinZ * sinY + cosZ * cosX), - origNode.Scale.Z * (cosX * sinZ * sinY - sinX * cosZ), + origNode.Scale.x * sinZ * cosY, + origNode.Scale.y * (sinX * sinZ * sinY + cosZ * cosX), + origNode.Scale.z * (cosX * sinZ * sinY - sinX * cosZ), origNode.Translation.y, - -origNode.Scale.X * sinY, - origNode.Scale.Y * sinX * cosY, - origNode.Scale.Z * cosX * cosY, + -origNode.Scale.x * sinY, + origNode.Scale.y * sinX * cosY, + origNode.Scale.z * cosX * cosY, origNode.Translation.z, 0, 0, 0, 1 }; -- cgit v1.2.3