Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/vsg/maths/mat4.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ namespace vsg
t_vec3<T> operator*(const t_vec3<T>& lhs, const t_mat4<T>& rhs)
{
T inv = numbers<T>::one() / (lhs[0] * rhs[3][0] + lhs[1] * rhs[3][1] + lhs[2] * rhs[3][2] + rhs[3][3]);
return t_vec3<T>(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<T>((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
35 changes: 26 additions & 9 deletions src/vsg/animation/CameraSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>("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<uint32_t>("positions");
positions.resize(num_positions);
Expand Down Expand Up @@ -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<uint32_t>("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<uint32_t>("positions", positions.size());
for (const auto& position : positions)
Expand All @@ -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<uint32_t>("fieldOfViews", fieldOfViews.size());
for (const auto& fov : fieldOfViews)
Expand Down
2 changes: 1 addition & 1 deletion src/vsg/state/ColorBlendState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading