c++ - How to ensure Eigen isometry stays isometric? -
i looking eigen::isometry3f, defined typedef transform<float,3,isometry> isometry3f;.
therewith cannot, example, assign affine3f isometry3f, keep isometry intact. (the reason is, mode checked in assignment operator of transform.)
i can - via transform::operator(...), shortcuts transform::m_matrix(...) - do
eigen::isometry3f iso; iso.setidentity(); iso(1, 1) = 2; //works (but should not ?!) and destroy isometry.
q1: shouldn't transform::operator(...) disallowed or @ least issue warning? if want mess still use transform.matrix()(1,1) = 2 ...
q2: there other pitfalls accidentally destroy isometry?
q3: if there other pitfalls: intention of mode==isometry? not ensure closedness/safety?
the main purpose of mode==isometry improve speed of operations, inversion, or extraction of rotation part. says "i, user, guaranty eigen underlying matrix represent isometry". responsibility of user no shoot itself. can break initial isometry replacing linear part bad matrix:
iso.linear() = matrix3f::random(); checking isometry not cheap @ all, adding checks everywhere break initial purpose. perhaps, adding bool transform::checkisometry() tracking issues in user code, out-of scope of so.
Comments
Post a Comment