Git Product home page Git Product logo

Comments (14)

SimonDanisch avatar SimonDanisch commented on September 26, 2024 2

I opened an issue: JuliaLang/julia#27361

from glabstraction.jl.

jaakkor2 avatar jaakkor2 commented on September 26, 2024
using Quaternions
using GeometryTypes

function (::Type{M})(q::Quaternions.Quaternion) where M <: Mat4
    T = eltype(M)
    sx, sy, sz = 2q.s*q.v1,  2q.s*q.v2,   2q.s*q.v3
    xx, xy, xz = 2q.v1^2,    2q.v1*q.v2,  2q.v1*q.v3
    yy, yz, zz = 2q.v2^2,    2q.v2*q.v3,  2q.v3^2
    T0, T1 = zero(T), one(T)
    Mat{4}(
        T1-(yy+zz), xy+sz,      xz-sy,      T0,
        xy-sz,      T1-(xx+zz), yz+sx,      T0,
        xz+sy,      yz-sx,      T1-(xx+yy), T0,
        T0,         T0,         T0,         T1
    )
end

function (::Type{M})(q::Quaternions.Quaternion) where M <: Mat3
    T = eltype(M)
    sx, sy, sz = 2q.s*q.v1, 2q.s*q.v2,  2q.s*q.v3
    xx, xy, xz = 2q.v1^2,   2q.v1*q.v2, 2q.v1*q.v3
    yy, yz, zz = 2q.v2^2,   2q.v2*q.v3, 2q.v3^2
    T0, T1 = zero(T), one(T)
    Mat{3}(
        T1-(yy+zz), xy+sz,      xz-sy,
        xy-sz,      T1-(xx+zz), yz+sx,
        xz+sy,      yz-sx,      T1-(xx+yy)
    )
end

results in
ERROR: TypeError: UnionAll: expected Type, got Int64

from glabstraction.jl.

jaakkor2 avatar jaakkor2 commented on September 26, 2024
using GeometryTypes

function (::Type{M})(q) where M <: Mat4
    1
end

function (::Type{M})(q) where M <: Mat3
    2
end

results in
ERROR: TypeError: UnionAll: expected Type, got Int64
on Julia v0.6.3, but is ok on Julia v0.6.2 .

from glabstraction.jl.

oschulz avatar oschulz commented on September 26, 2024

I just ran into the same issue (CentOS-7, Julia v0.6.3, custom build).

from glabstraction.jl.

oschulz avatar oschulz commented on September 26, 2024

Until the Julia issue is fixed, would this do as a workaround?

function (::Type{Mat4{T}})(q::Quaternions.Quaternion) where T
    # ...
end

function (::Type{Mat3{T}})(q::Quaternions.Quaternion) where T
    # ...
end

from glabstraction.jl.

DealPete avatar DealPete commented on September 26, 2024

I can't use GLVisualize at all, because when I import it it tries to precompile, and fails on GLAbstraction.

from glabstraction.jl.

SimonDanisch avatar SimonDanisch commented on September 26, 2024

If it solves it, feel free to open a PR :)

from glabstraction.jl.

SimonDanisch avatar SimonDanisch commented on September 26, 2024

(and thanks for figuring it out!)

from glabstraction.jl.

oschulz avatar oschulz commented on September 26, 2024

Question is, do we want to implement a workaround, and do an interim release of GLAbstraction, or hope for a speedy Julia-0.6.4. There seem to be more regressions in 0.6.3 (JuliaLang/julia#27381, JuliaLang/julia#27345), but I have no idea whether there will be a quick bug-fix release or not ...

from glabstraction.jl.

SimonDanisch avatar SimonDanisch commented on September 26, 2024

If you have it ready locally & it helps people, I'd be happy to merge & tag!

from glabstraction.jl.

getzze avatar getzze commented on September 26, 2024

Maybe the Rotation.jl package could be used for some functions in GLAbstraction, according to JuliaArrays/StaticArrays.jl#423 (comment)
It would reduce code redundancy and bugs.

from glabstraction.jl.

SimonDanisch avatar SimonDanisch commented on September 26, 2024

Would be nice! I have never looked a lot into this, since I've had GLMatrixMath, a 270 loc file, since forever and never needed anything more ;) Not sure if Rotations.jl even covers the functionality ...

from glabstraction.jl.

SimonDanisch avatar SimonDanisch commented on September 26, 2024

Should be fixed now: JuliaLang/METADATA.jl#15225 I

from glabstraction.jl.

oschulz avatar oschulz commented on September 26, 2024

@SimonDanisch , thanks! Sorry, I didn't get around to do the PR for you, was a bit overloaded.

from glabstraction.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.