summaryrefslogtreecommitdiff
path: root/NW4RTools/ColladaWriter.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-12 15:00:44 +0100
committerTreeki <treeki@gmail.com>2011-02-12 15:00:44 +0100
commit8b48608d45c8266b765e8ee29e612fb18376aa65 (patch)
treedabb0546d053586e7c022de8b481c79d892857f8 /NW4RTools/ColladaWriter.cs
parentcd9ce0418bf8e36e39e71757c8ef74fa4a163ab3 (diff)
downloadnw4rtools-8b48608d45c8266b765e8ee29e612fb18376aa65.tar.gz
nw4rtools-8b48608d45c8266b765e8ee29e612fb18376aa65.zip
fixed W7 (missing vtxclr/nrm/texcoord dicts now supported) and the matrix code
Diffstat (limited to '')
-rw-r--r--NW4RTools/ColladaWriter.cs30
1 files changed, 15 insertions, 15 deletions
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
};