Update of /cvsroot/plib/plib/src/ssg
In directory sc8-pr-cvs1:/tmp/cvs-serv12971/ssg
Modified Files:
ssgVtxTable.cxx
Log Message:
Added function getAs_ssgVtxArray
Index: ssgVtxTable.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgVtxTable.cxx,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- ssgVtxTable.cxx 12 Dec 2003 18:21:59 -0000 1.32
+++ ssgVtxTable.cxx 14 Dec 2003 14:52:01 -0000 1.33
@@ -780,6 +780,36 @@
}
+ssgVtxArray *ssgVtxTable::getAs_ssgVtxArray()
+{
+
+ ssgIndexArray *indices = new ssgIndexArray ();
+ int i, no = 0;
+ switch ( getPrimitiveType () )
+ {
+ case GL_POLYGON :
+ case GL_TRIANGLE_FAN :
+ case GL_TRIANGLE_STRIP :
+ no = getNumTriangles() + 2 ;
+ break;
+
+ case GL_TRIANGLES :
+ no = getNumTriangles() * 3 ;
+ }
+ for(i=0;i<no;i++)
+ indices ->add(i);
+
+
+ ssgState * state = getState();
+ char * name = getName();
+ ssgVtxArray * s = new ssgVtxArray ( getGLtype(),
+ vertices, normals, texcoords, colours, indices);
+ s->setName(name);
+ s->setState(state);
+ return s;
+}
+
+
void ssgVtxTable::isect_triangles ( sgSphere *s, sgMat4 m, int test_needed )
{
int nt = getNumTriangles () ;
|