125 |
} |
} |
126 |
|
|
127 |
inline void addToAccum(Stats::TexAccum *acc, Verts &v, |
inline void addToAccum(Stats::TexAccum *acc, Verts &v, |
128 |
int v0, int v1, int v2) { |
int v0, int v1, int v2, float texAreaMult) { |
129 |
acc->add( |
acc->add( |
130 |
v.points[v0].final, |
v.points[v0].final, |
131 |
v.points[v1].final, |
v.points[v1].final, |
132 |
v.points[v2].final, |
v.points[v2].final, |
133 |
v.points[v0].orig, |
v.points[v0].orig, |
134 |
v.points[v1].orig, |
v.points[v1].orig, |
135 |
v.points[v2].orig); |
v.points[v2].orig, |
136 |
|
texAreaMult); |
137 |
} |
} |
138 |
|
|
139 |
inline int splitTri(Verts &v, float dicelen1, float dicelen2, int i, int j, int k) { |
inline int splitTri(Verts &v, float dicelen1, float dicelen2, int i, int j, int k) { |
211 |
const int PAPERQUAD_USE_VERTEX_PROGRAM = 2; |
const int PAPERQUAD_USE_VERTEX_PROGRAM = 2; |
212 |
const int PAPERQUAD_NONL_MAXLEN = 4; |
const int PAPERQUAD_NONL_MAXLEN = 4; |
213 |
|
|
214 |
|
|
215 |
/** A paperquad with no separation between paper and object coordinates. |
/** A paperquad with no separation between paper and object coordinates. |
216 |
*/ |
*/ |
217 |
class FixedPaperQuad { |
class FixedPaperQuad { |
225 |
int diceDepth; |
int diceDepth; |
226 |
|
|
227 |
Stats::TexAccum *texAccum; |
Stats::TexAccum *texAccum; |
228 |
|
float texAreaMult; |
229 |
|
|
230 |
template<class F> void params(F &f) { |
template<class F> void params(F &f) { |
231 |
f(paper, x0, y0, x1, y1, flags, diceLength, diceLength2, diceDepth, |
f(paper, x0, y0, x1, y1, flags, diceLength, diceLength2, diceDepth, |
232 |
texAccum); |
texAccum, texAreaMult); |
233 |
} |
} |
234 |
|
|
235 |
|
|
259 |
diceLength*2, diceLength2*2, _1, _2, _3)); |
diceLength*2, diceLength2*2, _1, _2, _3)); |
260 |
// Then, calculate the texture surface estimates |
// Then, calculate the texture surface estimates |
261 |
triangler.iterateTriangles( |
triangler.iterateTriangles( |
262 |
bind(addToAccum, texAccum, ref(verts), _1, _2, _3)); |
bind(addToAccum, texAccum, ref(verts), _1, _2, _3, texAreaMult)); |
263 |
} |
} |
264 |
|
|
265 |
// Dice to finish |
// Dice to finish |