cpp Math

This topic contains 8 replies, has 3 voices, and was last updated by  abakobo 1 year, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8976

    DaY
    Participant

    I just installed the new build after a break so whats new in the c++ compatibility can i just include this as a .h?

    i could just redo it in monkey but why reinvent the wheel when i have a math lib of my own already done.

    [/crayon]
    #8977

    Mark Sibly
    Keymaster

    You will have to write a monkey ‘extern wrapper’ for it, or you could try using std.geom.Vec3f.

    #8979

    DaY
    Participant

    ok i can live with that i spent a damn long time learning the maths to create thee lib so il be damned if i dont get some use out of it.

    its using grassmann algebra for matrix3/4, translation, reflection, Quaternions etc

    just want to put it to use.

    #8998

    DaY
    Participant

    ok so far i have got a few things done BUT whats the best way to bring in the operators from cpp to mx2?
    i.e.

    [/crayon] [/crayon]
    #9000

    Mark Sibly
    Keymaster

    There is no way to extern operators.

    Monkey2 is not a cpp ‘translator’ or emulator, it is its own language that generates simplified c++ behind the scenes.

    It does not support all c++ functionality and there are many things you can do in c++ that you cannot do in monkey2.

    Why not just stick with c++? What are you hoping to gain by wrapping highly specialized c++ code in monkey2?

    #9008

    DaY
    Participant

    I wanted to reuse as much code from my c++ libs as i can rather than full remakes so the better MX2 supports c++ the easier to bring it in.

    Also i now agree with this last statement i will stick with c++ i just wanted a toy to rad stuff and mx2 supposedly supports c++ the docs dont even say what you can or cant do.

    Well if that’s the case why even bother being able to use c++? Drop it full stop why bother if it wont fully be compatible.

    Partial c++ support is not a great advertisement point.
    Go big or go home!

    #9009

    Mark Sibly
    Keymaster

    Quite understand!

    I am actually only aiming for ‘useful c++ support’. Full c++ support would be impossible without duplicating all of c++’s features (and quirks). But there’s enough in there to be able to use bullet, litehtml, libtheora etc. from monkey2 which is what I was aiming for.

    Will update docs too to at least mention what you can’t do with extern.

    #9010

    DaY
    Participant

    This is what i wanted to import but all i get are errors as i overload the operators the code is not that advanced but for speed i want to keep it as cpp.

    its the math lib i built for my dx framework that i was trying to also bring in but MX2 didnt like directx math so i built one but seems like it dont like my maths also lol.

    [/crayon]
    #9038

    abakobo
    Participant

    I am actually only aiming for ‘useful c++ support’. Full c++ support would be impossible without duplicating all of c++’s features (and quirks)

    Operator is a monkey2 feature! (some tokens are not available like ^)

    and when I tried to use external operators it looked like it’s almost there. The cpp was showing errors but it’s not far from the good result:

    [/crayon]

    wich should just be

    [/crayon]

    That is just not adding the postfix.member token and not adding the brackets when the method is an operator.
    In that regard I thought I would post a feature request as it looks not so hard to implement.

    The fact that we can add an operator ‘To’ by creating extension is great though, it let us use mx2’s Vec types with that kind of libraries (in my case box2D) without hassle.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.