[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/include/vob/vobs Paper.hxx
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob/include/vob/vobs Paper.hxx |
Date: |
Tue, 01 Apr 2003 14:48:07 -0500 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Tuomas J. Lukka <address@hidden> 03/04/01 14:48:06
Modified files:
include/vob/vobs: Paper.hxx
Log message:
Refactor a bit
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Paper.hxx.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: libvob/include/vob/vobs/Paper.hxx
diff -u libvob/include/vob/vobs/Paper.hxx:1.3
libvob/include/vob/vobs/Paper.hxx:1.4
--- libvob/include/vob/vobs/Paper.hxx:1.3 Tue Apr 1 10:06:52 2003
+++ libvob/include/vob/vobs/Paper.hxx Tue Apr 1 14:48:06 2003
@@ -58,13 +58,6 @@
}
- float dicelen;
- float split(int i, int j) const {
- float ret = (points[i].final - points[j].final).xylength() /
(float)dicelen - 1;
- DBG(dbg_paperquad) << "Split "<<i<<" "<<j<<" "<<
- points[i].final<<" "<<points[j].final<<" "<<ret<<"\n";
- return ret;
- }
void startT2V3Operation() {
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
@@ -98,8 +91,17 @@
}
};
+inline float split(Verts &v, float dicelen, int i, int j) {
+ float ret = (v.points[i].final - v.points[j].final).xylength()
+ / dicelen - 1;
+ DBG(dbg_paperquad) << "Split "<<i<<" "<<j<<" "<<
+ v.points[i].final<<" "<<v.points[j].final<<" "<<ret<<"\n";
+ return ret;
}
+}
+
+
class DiceTester {
public:
enum { NTrans = 1 };
@@ -111,8 +113,6 @@
template<class F> void params(F &f) {
f(dicelen, flags, maxdepth);
}
- static float split(PaperPriv::Verts &v, int i, int j) {
- return v.split(i,j); }
template<class T> void render(const T &coords) const {
using namespace PaperPriv;
@@ -122,38 +122,19 @@
verts.append(Pt(0,0));
verts.append(Pt(1,0));
verts.append(Pt(1,1));
- verts.dicelen = dicelen;
using namespace boost;
using namespace boost::lambda;
DBG(dbg_paperquad) << "Set_and_initial\n";
tri.set_and_initial_dice(verts,
- 0, 1, 2, bind(split, ref(verts), _1, _2), maxdepth);
+ 0, 1, 2, bind(split, ref(verts), dicelen, _1, _2),
maxdepth);
DBG(dbg_paperquad) << "dice\n";
tri.dice(verts, triangler,
- bind(split, ref(verts), _1, _2), maxdepth);
+ bind(split, ref(verts), dicelen, _1, _2), maxdepth);
verts.startT2V3Operation();
triangler.draw();
verts.endT2V3Operation();
- /*
- glBegin(GL_TRIANGLES);
-
- int ind = 0;
- for(vector<Triangler::Tri>::iterator i=triangler.tris.begin();
- i != triangler.tris.end(); i++) {
- DBG(dbg_paperquad) << "tri \n";
- if(flags & 1) {
- glColor3f(.5 + .5 * sin(.1 * ind),
- .5 + .5 * cos(.08751 * ind),
- .5 + .5 * sin(.07751 * ind));
- }
- ind ++;
- for(int j=0; j<3; j++)
- VecGL::glVertex( verts.finalPoints[(*i).v[j]] );
- }
- glEnd();
- */
}
};
- [Gzz-commits] libvob/include/vob/vobs Paper.hxx,
Tuomas J. Lukka <=