Magnus Norddahl
06-25-2008, 01:07 AM
Here's one of the changes that explains why we didn't release 0.9 yet. :)
CL_Matrix4x4 matrix1(true);
CL_Matrix4x4 matrix2(false);
changes to:
CL_Matrix4x4 matrix1 = CL_Matrix4x4::identity();
CL_Matrix4x4 matrix2 = CL_Matrix4x4::null();
OK, that change wasn't that special, but I also changed CL_Matrix4x4::multiply(), inverse() and adjoint() to follow the normal convention of not returning the result, but modify the object itself. This change will break applications relying on the old behavior. To clarify:
CL_Mat4d m = m1.multiply(m2);
changes to:
CL_Mat4d m = m1;
m.multiply(m2);
CL_Vec[1234][bsifd] is also changed to always follow this policy, so rotate(), normalize(), round(), cross(), etc. all modify the current object.
CL_Vec3d v = v1.cross(v2);
v = v.normalize();
changes to:
CL_Vec3d v = v1;
v.cross(v2);
v.normalize();
Finally I also updated CL_Rect (shrink, expand, translate, normalize, overlap, bounding_rect, apply_alignment, clip), CL_Point (rotate) and CL_Size to match this behavior.
If someone really desires the old behavior, the correct way to implement it would be to add static functions that takes both operators as parameters. I.e.:
CL_Matrix4x4 m = CL_Matrix4x4::multiply(m1, m2);
CL_Rect r = CL_Rect::bounding_rect(r1, r2);
Hopefully this shouldn't cause too much problems for those that use 0.9 SVN currently. :)
CL_Matrix4x4 matrix1(true);
CL_Matrix4x4 matrix2(false);
changes to:
CL_Matrix4x4 matrix1 = CL_Matrix4x4::identity();
CL_Matrix4x4 matrix2 = CL_Matrix4x4::null();
OK, that change wasn't that special, but I also changed CL_Matrix4x4::multiply(), inverse() and adjoint() to follow the normal convention of not returning the result, but modify the object itself. This change will break applications relying on the old behavior. To clarify:
CL_Mat4d m = m1.multiply(m2);
changes to:
CL_Mat4d m = m1;
m.multiply(m2);
CL_Vec[1234][bsifd] is also changed to always follow this policy, so rotate(), normalize(), round(), cross(), etc. all modify the current object.
CL_Vec3d v = v1.cross(v2);
v = v.normalize();
changes to:
CL_Vec3d v = v1;
v.cross(v2);
v.normalize();
Finally I also updated CL_Rect (shrink, expand, translate, normalize, overlap, bounding_rect, apply_alignment, clip), CL_Point (rotate) and CL_Size to match this behavior.
If someone really desires the old behavior, the correct way to implement it would be to add static functions that takes both operators as parameters. I.e.:
CL_Matrix4x4 m = CL_Matrix4x4::multiply(m1, m2);
CL_Rect r = CL_Rect::bounding_rect(r1, r2);
Hopefully this shouldn't cause too much problems for those that use 0.9 SVN currently. :)