diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-09-12 19:49:12 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-09-12 22:09:49 -0400 |
commit | e77371bdbf6f9a14d0cf82b317ca6022f3b00bf7 (patch) | |
tree | 934b9ca1e4933457afc1695ce63985b3ebc291c8 | |
parent | eb5c280be7850872e4f94f1b914d35967d71fbce (diff) | |
download | dimension-e77371bdbf6f9a14d0cf82b317ca6022f3b00bf7.tar.xz |
Use dmnsn_object::intrinsic_trans from Python.
-rw-r--r-- | libdimension-python/dimension.pxd | 1 | ||||
-rw-r--r-- | libdimension-python/dimension.pyx | 9 | ||||
-rw-r--r-- | libdimension/dimension/object.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd index 4590e89..42fda7e 100644 --- a/libdimension-python/dimension.pxd +++ b/libdimension-python/dimension.pxd @@ -305,6 +305,7 @@ cdef extern from "../libdimension/dimension.h": dmnsn_texture *texture dmnsn_interior *interior dmnsn_matrix trans + dmnsn_matrix intrinsic_trans dmnsn_object *dmnsn_new_object() void dmnsn_delete_object(dmnsn_object *object) diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index 556b90a..a1c8710 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -952,11 +952,10 @@ cdef class Object: # Transform an object without affecting the texture cdef _intrinsic_transform(self, Matrix trans): - self._object.trans = dmnsn_matrix_mul(self._object.trans, trans._m) - cdef Matrix inv = trans.inverse() - if self._object.texture != NULL: - self._object.texture.trans = dmnsn_matrix_mul(self._object.texture.trans, - inv._m) + self._object.intrinsic_trans = dmnsn_matrix_mul( + trans._m, + self._object.intrinsic_trans + ) cdef class Triangle(Object): """A triangle.""" diff --git a/libdimension/dimension/object.h b/libdimension/dimension/object.h index 673c8bc..8254782 100644 --- a/libdimension/dimension/object.h +++ b/libdimension/dimension/object.h @@ -74,7 +74,7 @@ struct dmnsn_object { dmnsn_matrix trans; /**< Transformation matrix. */ dmnsn_matrix trans_inv; /**< Inverse of the transformation matrix. */ - dmnsn_matrix intrinsic_trans; /**< Transformations not affecting the texture. */ + dmnsn_matrix intrinsic_trans; /**< Transformations intrinsic to the object. */ dmnsn_matrix pigment_trans; /**< Inverse transformation for the texture. */ dmnsn_bounding_box bounding_box; /**< Object bounding box. */ |