Small changes.
This commit is contained in:
parent
4636a37a27
commit
244e548569
|
@ -27,7 +27,8 @@ namespace nxs {
|
|||
virtual void GetView() { frustum.GetView(); }
|
||||
float GetError(Entry &entry) {
|
||||
vcg::Sphere3f &sphere = entry.sphere;
|
||||
float dist = Distance(sphere, frustum.ViewPoint());
|
||||
float dist = (sphere.Center() - frustum.ViewPoint()).Norm() - sphere.Radius();
|
||||
//float dist = Distance(sphere, frustum.ViewPoint());
|
||||
if(dist < 0)
|
||||
return 1e20f;
|
||||
if(frustum.IsOutside(sphere.Center(), sphere.Radius()))
|
||||
|
|
|
@ -113,6 +113,7 @@ bool Nexus::LoadHeader() {
|
|||
ReadBuffer(&totvert, sizeof(unsigned int));
|
||||
ReadBuffer(&totface, sizeof(unsigned int));
|
||||
ReadBuffer(&sphere, sizeof(Sphere3f));
|
||||
return true;
|
||||
}
|
||||
|
||||
void Nexus::Flush(bool all) {
|
||||
|
@ -140,10 +141,10 @@ Patch &Nexus::GetPatch(unsigned int patch, bool flush) {
|
|||
Entry &entry = operator[](patch);
|
||||
if(index.count(patch)) {
|
||||
assert(entry.patch);
|
||||
list<unsigned int>::iterator &i = index[patch];
|
||||
list<unsigned int>::iterator i = index[patch];
|
||||
pqueue.erase(i);
|
||||
pqueue.push_front(patch);
|
||||
|
||||
index[patch] = pqueue.begin();
|
||||
} else {
|
||||
while(flush && ram_used > ram_max) {
|
||||
unsigned int to_flush = pqueue.back();
|
||||
|
|
|
@ -37,6 +37,7 @@ void nxs::ComputeNormals(Nexus &nexus) {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
//TODO optimize! it is not necessary to read all the borders.
|
||||
for(unsigned int p = 0; p < nexus.size(); p++) {
|
||||
Border border = nexus.GetBorder(p);
|
||||
tmpb_start.push_back(tmpb_offset);
|
||||
|
@ -62,7 +63,6 @@ void nxs::ComputeNormals(Nexus &nexus) {
|
|||
normals.clear();
|
||||
normals.resize(patch.nv, Point3f(0, 0, 0));
|
||||
|
||||
|
||||
if(nexus.signature & NXS_FACES)
|
||||
for(unsigned int i = 0; i < patch.nf; i++) {
|
||||
unsigned short *f = patch.Face(i);
|
||||
|
@ -95,9 +95,9 @@ void nxs::ComputeNormals(Nexus &nexus) {
|
|||
Point3f &norm = normals[i];
|
||||
norm.Normalize();
|
||||
short *n = patch.Norm16(i);
|
||||
for(int k = 0; k < 3; k++) {
|
||||
for(int k = 0; k < 3; k++)
|
||||
n[k] = (short)(norm[k] * 32766);
|
||||
}
|
||||
|
||||
n[3] = 0;
|
||||
}
|
||||
} else {
|
||||
|
@ -111,15 +111,15 @@ void nxs::ComputeNormals(Nexus &nexus) {
|
|||
|
||||
map<unsigned int, map<unsigned short, Point3f> > bnorm;
|
||||
|
||||
|
||||
unsigned int poff = tmpb_start[p];
|
||||
for(unsigned int i = 0; i < border.Size(); i++) {
|
||||
Link &link = border[i];
|
||||
if(link.IsNull()) continue;
|
||||
if(link.IsNull()) continue; //this should never happen now.
|
||||
Point3f pt = normals[link.start_vert];
|
||||
//bnorm[p][link.start_vert] = pt;
|
||||
bnorm[link.end_patch][link.end_vert] = pt;
|
||||
tmpb[poff + i] += pt;
|
||||
|
||||
}
|
||||
|
||||
map<unsigned int, map<unsigned short, Point3f> >::iterator k;
|
||||
|
|
|
@ -155,7 +155,7 @@ void Dispatcher::msghandler(message &msg) {
|
|||
Server *best = BestServer();
|
||||
Fragment *fragin = (Fragment *)(msg.param);
|
||||
|
||||
if(!best) { //no server process locally....
|
||||
if(!best || mode == CLUSTER) { //no server process locally....
|
||||
// cerr << "Local: " << fragin->id << endl;
|
||||
vector<Point3f> newvert;
|
||||
vector<unsigned int> newface;
|
||||
|
|
Loading…
Reference in New Issue