[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] alpha6!
- From: "Schleimer, Ben" <bensch128@xxxxxxxxx>
- Date: Wed, 13 Aug 2008 17:42:36 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=bzRpVxE7QCSYP+2648h6gvMusfU5WlEcmyFgkAhcNdmIhXB0aQ3k9jy7Suz4slaHtI5TKBHwqQDLbP8DLmCCOGYbjhfSY1ivbIAaUlTecUt9KFUgAp2YgXDxpD6yO1QiPQdNTKhK+6Jv8tkQ8mwXTbJ1cjJssJWSOwA8tk3NE7E=;
>
> > My only issue is the usage of the operator Matrix3f()
> in
> > AngleAxis and Quaterion and operator Scalar() and
> others in Rotation2d. The
> > toMatrix() is clearer and less error prone IMHO.
>
> As you can see in the code,
>
> operator Matrix3 () const { return toRotationMatrix(); }
>
> the method you're asking for is named
> toRotationMatrix(). Do you think then
> that it is a bad thing to also have the conversion
> operator? I can't really
> see how it could be dangerous. One can also discuss whether
> it is better to
> have an operator like this or a Matrix constructor. I
> don't really know...
> this is Gael's work btw.
>
I just caution against operator ...() because I've run into several situations where it causes bugs. I prefer explicit casting because it's more obvious (for you and the compiler) what's going on.
Cheers
Ben