small error in SynthopiaCore/Math/Vector3.h

  • Paolo Cignoni

    Paolo Cignoni - 2010-10-01

    At line 87 of
    SynthopiaCore/Math/Vector3.h (latest revision, 276)

    template <typename T>
    Vector3<T> operator*(T hs, Vector3<T> rs) { return Vector3<T>(rhs[0]*lhs, rhs[1]*lhs, rhs[2]*lhs); }

    should probably be:

    template <typename T>
        Vector3<T> operator*(T lhs, Vector3<T> rhs) { return Vector3<T>(rhs[0]*lhs, rhs[1]*lhs, rhs[2]*lhs); }

    sorry for being pedantic :)

    (BTW did you know that development version of  MeshLab now can directly import SSynth grammars?)
    cheers and thanks for the cool grammar engine!

  • Mikael Hvidtfeldt Christensen

    Hi Cignoni,

    You are of course right :-)
    Actually, the code annoyed me, and I ended up not using it all. (The problem is, that the scalar type must match the vector type exactly - you cannot multiply an int with a Vector3 using the template code - only if the int is on the right-side).

    Direct EisenScript in MeshLab is very cool - I'm looking forward to playing around with it!


Log in to post a comment.