- API Change: ecere/gfx/3D/Quaternion: RotationAxis() now taking a Vector3D instead of a Vector3Df
z = q2.w * q1.z + q2.x * q1.y - q2.y * q1.x - q2.z * q1.w;
}
- void RotationAxis(Vector3Df axis, Degrees angle)
+ void RotationAxis(Vector3D axis, Degrees angle)
{
double sa = sin( angle / 2 );
double ca = cos( angle / 2 );
- x = (double)(axis.x * sa);
- y = (double)(axis.y * sa);
- z = (double)(axis.z * sa);
- w = (double)ca;
+ x = axis.x * sa;
+ y = axis.y * sa;
+ z = axis.z * sa;
+ w = ca;
}
void RotationYawPitchRoll(Euler euler)
{
Vector3Df axis;
Angle angle = ReadFloat(info->f);
- Vector3Df fixedAxis;
+ Vector3D fixedAxis;
Read3DVertex(info->f, axis);
- fixedAxis.x = axis.x;
- fixedAxis.y = -axis.z;
- fixedAxis.z = axis.y;
+ fixedAxis = { axis.x, -axis.z, axis.y };
if(c > 0)
{
}
}
-public void glmsRotated( double a, double b, double c, double d )
+public void glmsRotated(double angle, double x, double y, double z)
{
Quaternion q;
Matrix m, r;
+ Vector3D n;
- q.RotationAxis({(float)b,(float)c,(float)-d}, a );
+ n.Normalize({ -x, -y, -z });
+ q.RotationAxis(n, angle);
m.RotationQuaternion(q);
r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
matrixStack[curStack][matrixIndex[curStack]] = r;