Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-08 08:48:14 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-03-10 06:54:05 +0300
commitb66efbecf4780c65833f72ac8de5d18b5bca7e15 (patch)
tree58f258df9e797f55ad1a77082115989df147e6db /intern/cycles/app/cycles_xml.cpp
parent623141f339d5066ed6b96ad70ab45fb294e3e612 (diff)
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.
Diffstat (limited to 'intern/cycles/app/cycles_xml.cpp')
-rw-r--r--intern/cycles/app/cycles_xml.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 21ae07e23b8..a46955322e3 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -40,6 +40,7 @@
#include "util/util_foreach.h"
#include "util/util_path.h"
+#include "util/util_projection.h"
#include "util/util_transform.h"
#include "util/util_xml.h"
@@ -546,8 +547,10 @@ static void xml_read_transform(xml_node node, Transform& tfm)
{
if(node.attribute("matrix")) {
vector<float> matrix;
- if(xml_read_float_array(matrix, node, "matrix") && matrix.size() == 16)
- tfm = tfm * transform_transpose((*(Transform*)&matrix[0]));
+ if(xml_read_float_array(matrix, node, "matrix") && matrix.size() == 16) {
+ ProjectionTransform projection = *(ProjectionTransform*)&matrix[0];
+ tfm = tfm * projection_to_transform(projection_transpose(projection));
+ }
}
if(node.attribute("translate")) {