144 {
145 float x = value2.X;
146 float y = value2.Y;
147 float z = value2.Z;
148 float w = value2.W;
149 float x2 = value1.X;
150 float y2 = value1.Y;
151 float z2 = value1.Z;
152 float w2 = value1.W;
153 float num = y * z2 - z * y2;
154 float num2 = z * x2 - x * z2;
155 float num3 = x * y2 - y * x2;
156 float num4 = x * x2 + y * y2 + z * z2;
158 result.X = x * w2 + x2 * w + num;
159 result.Y = y * w2 + y2 * w + num2;
160 result.Z = z * w2 + z2 * w + num3;
161 result.W = w * w2 - num4;
162 return result;
163 }
Quaternion(float x, float y, float z, float w)