Menu

#16 examples/FAQ need header mention + VecOps.h vs Generate.h

open
nobody
None
5
2009-09-17
2009-09-17
Anonymous
No

How in god's name is someone supposed to know that they need to include Generate.h to get the FAQ code for cross products to work? And why would this not be in VecOps.h?

gmtl::Vec3f vecA, vecB, crossVec;
crossVec = gmtl::cross( vecA, vecB );

I was beating my head up against the wall for hours first thinking that cross( vec3f, vec3f ) had been removed completely.

Please put some documentation as to where

Discussion

  • Nobody/Anonymous

    It looks like maybe the documentation is out of sync with the code
    Some versions have it in VecOps.h some in Generate.h some it doesn't exist, and there is only makeCross
    WTF.

     
  • Nobody/Anonymous

    ...and the compiler with optimization turned on produces the same code in either case since in eliminates unnecessary temp vars. I checked:

    gmtl::Vec3d vec1(1.0, 1.5, -1.0), vec2(1.5, 1.0, -1.0), vec3;
    gmtl::cross(vec1, vec2, vec3);
    vs
    gmtl::Vec3d vec1(1.0, 1.5, -1.0), vec2(1.5, 1.0, -1.0), vec3;
    vec3 = gmtl::makeCross(vec1, vec2);

    With -O3 in gcc is the same.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.