From: Kevin M. <ke...@vr...> - 2003-09-22 20:12:57
|
mats are column ordered, so that helps. you should be able to index one element and dereference it to get the column. I think (float*)&mat.mData[0] would be the first column, which if you init a Vec with it: gmtl::Vec4f col; col.set( (float*)&mat.mData[0] ); second column (example): col.set( (float*)&mat(0,1) ); 4th column (translation component): col.set( (float*)&mat[0][3] ); -kevin On Mon, 22 Sep 2003, Eric Maslowski wrote: > How this is the right list: What is the recommended method for grabbing an > entire column? > > Can't seem to find a general GetColumn() routine in the Matrix definition. > I can't seem to even grab the components and throw them in a vector when > the Matrix44f is a pointer. > > Matrix44f* mat = entity->GetTransform(); // GetTransform() returns Matrix44f* > Vec3f out_vec(mat[2][0],mat[2][1],mat[2][2]); > > yields: > > error C2664: 'gmtl::Vec<DATA_TYPE,SIZE>::Vec(const DATA_TYPE &,const > DATA_TYPE &,const DATA_TYPE &)' : cannot convert parameter 1 from > 'gmtl::Matrix<DATA_TYPE,ROWS,COLS>::RowAccessor *' to 'const float &' > > Any help would be greatly appreciated. > > cheers > > E. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > ggt-devel mailing list > ggt...@li... > https://lists.sourceforge.net/lists/listinfo/ggt-devel > -- *--*---*---*----*-----*------*------*-----*----*---*---*--* Kevin Meinert /_/ home - http://www.vrsource.org/~kevin \ / music - http://www.subatomicglue.com \/ __ \/ \__ \_\ |