diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-09-14 18:56:08 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-09-14 19:03:07 -0400 |
commit | 1374b946398544a28ac989c75570d4b7c6937873 (patch) | |
tree | d3f05e23b5c39201292bfaddaca23220de6652f7 /libdimension-python | |
parent | 4bfa19e5a0b426ea6ec99dfebaeb35e507136b74 (diff) | |
download | dimension-1374b946398544a28ac989c75570d4b7c6937873.tar.xz |
Transform normals as pseudovectors, not vectors.
Also clarify the vector transformation API. Instead of
dmnsn_transform_vector(), we have:
- dmnsn_transform_point()
- dmnsn_transform_direction()
- dmnsn_transform_normal()
Diffstat (limited to 'libdimension-python')
-rw-r--r-- | libdimension-python/dimension.pxd | 4 | ||||
-rw-r--r-- | libdimension-python/dimension.pyx | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd index 42fda7e..1164be5 100644 --- a/libdimension-python/dimension.pxd +++ b/libdimension-python/dimension.pxd @@ -130,7 +130,9 @@ cdef extern from "../libdimension/dimension.h": dmnsn_matrix dmnsn_matrix_inverse(dmnsn_matrix m) dmnsn_matrix dmnsn_matrix_mul(dmnsn_matrix lhs, dmnsn_matrix rhs) - dmnsn_vector dmnsn_transform_vector(dmnsn_matrix lhs, dmnsn_vector rhs) + dmnsn_vector dmnsn_transform_point(dmnsn_matrix lhs, dmnsn_vector rhs) + dmnsn_vector dmnsn_transform_direction(dmnsn_matrix lhs, dmnsn_vector rhs) + dmnsn_vector dmnsn_transform_normal(dmnsn_matrix lhs, dmnsn_vector rhs) dmnsn_matrix dmnsn_scale_matrix(dmnsn_vector s) dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d) diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index a1c8710..48e8de1 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -263,7 +263,7 @@ cdef class Matrix: if isinstance(rhs, Matrix): return _Matrix(dmnsn_matrix_mul(lhs._m, (<Matrix>rhs)._m)) else: - return _Vector(dmnsn_transform_vector(lhs._m, (<Vector>rhs)._v)) + return _Vector(dmnsn_transform_point(lhs._m, (<Vector>rhs)._v)) def __richcmp__(Matrix lhs not None, Matrix rhs not None, int op): cdef double sum = 0.0 |