ToStr implemented for transform::Decomposed
This commit is contained in:
parent
7f39520aa1
commit
efd3403bf2
1 changed files with 10 additions and 1 deletions
|
@ -13,7 +13,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
use std::num;
|
use std::{fmt,num};
|
||||||
|
|
||||||
use matrix::{Matrix, Mat4, ToMat4};
|
use matrix::{Matrix, Mat4, ToMat4};
|
||||||
use point::{Point, Point3};
|
use point::{Point, Point3};
|
||||||
|
@ -137,6 +137,15 @@ ToMat4<S> for Decomposed<S, Vec3<S>, R> {
|
||||||
impl<S: Float, R: Rotation3<S>>
|
impl<S: Float, R: Rotation3<S>>
|
||||||
Transform3<S> for Decomposed<S,Vec3<S>,R> {}
|
Transform3<S> for Decomposed<S,Vec3<S>,R> {}
|
||||||
|
|
||||||
|
impl<S: fmt::Default + Float, R: ToStr + Rotation3<S>>
|
||||||
|
ToStr for Decomposed<S,Vec3<S>,R> {
|
||||||
|
fn to_str(&self) -> ~str {
|
||||||
|
format!("(scale({}), rot({:s}), disp{:s})",
|
||||||
|
self.scale, self.rot.to_str(), self.disp.to_str())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// A homogeneous transformation matrix.
|
/// A homogeneous transformation matrix.
|
||||||
pub struct AffineMatrix3<S> {
|
pub struct AffineMatrix3<S> {
|
||||||
mat: Mat4<S>,
|
mat: Mat4<S>,
|
||||||
|
|
Loading…
Reference in a new issue