Code refactor: make Transform always affine, dropping last row.

This save a little memory and copying in the kernel by storing only a 4x3
matrix instead of a 4x4 matrix. We already did this in a few places, and
those don't need to be special exceptions anymore now.
This commit is contained in:
2018-03-08 06:48:14 +01:00
parent 623141f339
commit b66efbecf4
25 changed files with 120 additions and 158 deletions

View File

@@ -1445,11 +1445,11 @@ static void update_attribute_element_offset(Mesh *mesh,
Transform *tfm = mattr->data_transform();
offset = attr_float3_offset;
assert(attr_float3.size() >= offset + size * 4);
for(size_t k = 0; k < size*4; k++) {
assert(attr_float3.size() >= offset + size * 3);
for(size_t k = 0; k < size*3; k++) {
attr_float3[offset+k] = (&tfm->x)[k];
}
attr_float3_offset += size * 4;
attr_float3_offset += size * 3;
}
else {
float4 *data = mattr->data_float4();