diff --git a/include/vsg/maths/mat4.h b/include/vsg/maths/mat4.h index 83257afc54..ad5ab16031 100644 --- a/include/vsg/maths/mat4.h +++ b/include/vsg/maths/mat4.h @@ -236,9 +236,8 @@ namespace vsg t_vec3 operator*(const t_vec3& lhs, const t_mat4& rhs) { T inv = numbers::one() / (lhs[0] * rhs[3][0] + lhs[1] * rhs[3][1] + lhs[2] * rhs[3][2] + rhs[3][3]); - return t_vec3(lhs[0] * rhs[0][0] + lhs[1] * rhs[0][1] + lhs[2] * rhs[0][2] + rhs[0][3] * inv, - lhs[0] * rhs[1][0] + lhs[1] * rhs[1][1] + lhs[2] * rhs[1][2] + rhs[1][3] * inv, - lhs[0] * rhs[2][0] + lhs[1] * rhs[2][1] + lhs[2] * rhs[2][2] + rhs[2][3] * inv); + return t_vec3((lhs[0] * rhs[0][0] + lhs[1] * rhs[0][1] + lhs[2] * rhs[0][2] + rhs[0][3]) * inv, + (lhs[0] * rhs[1][0] + lhs[1] * rhs[1][1] + lhs[2] * rhs[1][2] + rhs[1][3]) * inv, + (lhs[0] * rhs[2][0] + lhs[1] * rhs[2][1] + lhs[2] * rhs[2][2] + rhs[2][3]) * inv); } - } // namespace vsg diff --git a/src/vsg/animation/CameraSampler.cpp b/src/vsg/animation/CameraSampler.cpp index 1aaa146e58..1a222a8b55 100644 --- a/src/vsg/animation/CameraSampler.cpp +++ b/src/vsg/animation/CameraSampler.cpp @@ -45,6 +45,19 @@ void CameraKeyframes::read(Input& input) input.readObjects("path", track.value); } + if (input.version_greater_equal(1, 1, 15)) + { + // read origin key frames + uint32_t num_origins = input.readValue("origins"); + origins.resize(num_origins); + for (auto& origin : origins) + { + input.matchPropertyName("origin"); + input.read(1, &origin.time); + input.read(1, &origin.value); + } + } + // read position key frames uint32_t num_positions = input.readValue("positions"); positions.resize(num_positions); @@ -103,6 +116,19 @@ void CameraKeyframes::write(Output& output) const output.writeObjects("path", track.value); } + if (output.version_greater_equal(1, 1, 15)) + { + // write origin key frames + output.writeValue("origins", origins.size()); + for (const auto& origin : origins) + { + output.writePropertyName("origin"); + output.write(1, &origin.time); + output.write(1, &origin.value); + output.writeEndOfLine(); + } + } + // write position key frames output.writeValue("positions", positions.size()); for (const auto& position : positions) @@ -123,15 +149,6 @@ void CameraKeyframes::write(Output& output) const output.writeEndOfLine(); } - // write scale key frames - for (const auto& scale : fieldOfViews) - { - output.writePropertyName("fov"); - output.write(1, &scale.time); - output.write(1, &scale.value); - output.writeEndOfLine(); - } - // write field of view key frames output.writeValue("fieldOfViews", fieldOfViews.size()); for (const auto& fov : fieldOfViews) diff --git a/src/vsg/state/ColorBlendState.cpp b/src/vsg/state/ColorBlendState.cpp index 105f50ea37..eb9993dca5 100644 --- a/src/vsg/state/ColorBlendState.cpp +++ b/src/vsg/state/ColorBlendState.cpp @@ -85,7 +85,7 @@ int ColorBlendState::compare(const Object& rhs_object) const if ((result = compare_value(logicOpEnable, rhs.logicOpEnable))) return result; if ((result = compare_value(logicOp, rhs.logicOp))) return result; if ((result = compare_value_container(attachments, rhs.attachments))) return result; - return compare_values(blendConstants, rhs.blendConstants, 3); + return compare_values(blendConstants, rhs.blendConstants, 4); } void ColorBlendState::read(Input& input)