Skip to content

Commit

Permalink
### 5.5.6
Browse files Browse the repository at this point in the history
- [Assimp] Animations: fixed quaternion interpretation
  • Loading branch information
aszabo314 committed Nov 18, 2024
1 parent 6c0555d commit be49645
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 5.5.6
- [Assimp] Animations: fixed quaternion interpretation

### 5.5.5
- OpenGL/WPF control uses tasks for rendering (avoiding stack-inlining due to STAThread)

Expand Down
9 changes: 5 additions & 4 deletions src/Aardvark.SceneGraph.Assimp/Loader.fs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ module Loader =
V2d(v.X, v.Y)

let toQuaternion (v : Assimp.Quaternion) =
QuaternionD(float v.W, float v.X, float v.Y, float v.Z)
Rot3d(QuaternionD(float v.W, float v.X, float v.Y, float v.Z).Normalized)

let private toV4i (arr : int[]) =
match arr.Length with
Expand Down Expand Up @@ -852,14 +852,15 @@ module Loader =
match l, r with
| Some(lt,lv), Some (rt,rv) ->
let f = (t - lt) / (rt - lt)
lv * (1.0 - f) + rv * f
let q = lv * (1.0 - f) + rv * f
Rot3d(q.Normalized)

| Some(_,lv), None ->
lv
| None, Some(_,rv) ->
rv
| None, None ->
QuaternionD.Identity
Rot3d.Identity

let node = na.NodeName

Expand All @@ -869,7 +870,7 @@ module Loader =
let p = position t
let rot = rotation t

let r : M44d = rot |> QuaternionD.op_Explicit
let r : M44d = rot |> Rot3d.op_Explicit
let s = scale t
M44d.Translation(p) * r * M44d.Scale(s)
)
Expand Down

0 comments on commit be49645

Please sign in to comment.