BPy: Mathutils fix: bug #3737

Vector.resize4D() didn't put 1 in the 4th component (the scale factor), as it did in 2.37.
While this is more "correct", it is much less usefull. Also, matrix.resize4x4 puts a 1 there too,
so might as well revert and be consistent.
This commit is contained in:
2006-01-12 01:11:42 +00:00
parent 0132ac9b8b
commit 150d36e4da
2 changed files with 3 additions and 2 deletions

View File

@@ -493,6 +493,7 @@ class Vector:
def resize4D(): def resize4D():
""" """
Resize the vector to 4d. New axis will be 0.0. Resize the vector to 4d. New axis will be 0.0.
The last component will be 1.0, to make multiplying 3d vectors by 4x4 matrices easier.
@return: a copy of itself @return: a copy of itself
""" """

View File

@@ -160,9 +160,9 @@ PyObject *Vector_Resize4D(VectorObject * self)
self->vec = self->data.py_data; //force self->vec = self->data.py_data; //force
if(self->size == 2){ if(self->size == 2){
self->data.py_data[2] = 0.0f; self->data.py_data[2] = 0.0f;
self->data.py_data[3] = 0.0f; self->data.py_data[3] = 1.0f;
}else if(self->size == 3){ }else if(self->size == 3){
self->data.py_data[3] = 0.0f; self->data.py_data[3] = 1.0f;
} }
self->size = 4; self->size = 4;
return EXPP_incr_ret((PyObject*)self); return EXPP_incr_ret((PyObject*)self);