From 65d3a2a707e529d4a10c6416ede4b54403e415e0 Mon Sep 17 00:00:00 2001 From: CarlBittendorf Date: Fri, 23 Jul 2021 18:52:12 +0200 Subject: [PATCH 1/2] Fix replacement of offsets --- src/BVHGraphs.jl | 1 + src/transformation.jl | 4 ++-- test/file.jl | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/BVHGraphs.jl b/src/BVHGraphs.jl index 6acac3a..fa8c432 100644 --- a/src/BVHGraphs.jl +++ b/src/BVHGraphs.jl @@ -37,6 +37,7 @@ Base.@kwdef mutable struct EProps offset::Vector{Float64} = zeros(Float64, 3) end + """ struct BVHGraph{T <: Integer} <: AbstractGraph{T} diff --git a/src/transformation.jl b/src/transformation.jl index 2ef42d8..31aade1 100644 --- a/src/transformation.jl +++ b/src/transformation.jl @@ -331,13 +331,13 @@ function replace_offset!(g::BVHGraph, h::BVHGraph, gv₊₁::Integer, T::Matrix{ for f in frames(g) Rᵥ = rotation(g, gv, f) - rotation!(g, gv, f, B * Rᵥ) + rotation!(g, gv, f, Rᵥ * B) for n in outneighbors(g, gv) if outneighbors(g, n) != [] Rᵥ₊₁ = rotation(g, n, f) - rotation!(g, n, f, inv(Rᵥ) * inv(B) * Rᵥ * Rᵥ₊₁) + rotation!(g, n, f, inv(B) * Rᵥ₊₁) end end end diff --git a/test/file.jl b/test/file.jl index b7eb34d..4907e8a 100644 --- a/test/file.jl +++ b/test/file.jl @@ -71,9 +71,9 @@ using Flux scale!(7.0) d = load("DAZ3D.bvh") |> - zero! |> - add_frames!(240) |> - project!(g, T) + zero! |> + add_frames!(240) |> + project!(g, T) @test nframes(d) == nframes(g) end \ No newline at end of file From dd8a644fa09fa5e405dae24d4aa499fd0c98e875 Mon Sep 17 00:00:00 2001 From: CarlBittendorf Date: Fri, 23 Jul 2021 18:54:51 +0200 Subject: [PATCH 2/2] Version 0.2.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ea58d3c..0199a53 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BVHFiles" uuid = "25714dd2-c69e-4994-8c66-7895118b2050" authors = ["Carl Bittendorf"] -version = "0.2.0" +version = "0.2.1" [deps] Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"