Commit 754476dc by wester

lod an negative distance (inside bounding)

parent 2906199f
......@@ -98,7 +98,7 @@ double FTile::getScreenSpaceError(double lambda, FVector CamLocation)
//SSE http://folk.uio.no/inftt/Div/visualization2.pdf
double sse = lambda * this->geometricError / dist;
//UE_LOG(TILES, Error, TEXT("sse = %f, geoE = %f Dist %f"), sse, this->geometricError, dist);
UE_LOG(TILES, Error, TEXT("sse = %f, geoE = %f Dist %f"), sse, this->geometricError, dist);
return sse;
}
......@@ -135,7 +135,7 @@ void ATilesetActor::updateScreenSpaceError(FTile* current, double currentSSE, do
{
double ScreenSpaceError1 = current->getScreenSpaceError(constant, CamLocation);
if (ScreenSpaceError1 > LODtreshold && current->children.Num() > 0) {
if ((ScreenSpaceError1 > LODtreshold || ScreenSpaceError1 < 0) && current->children.Num() > 0) {
for (FTile* child : current->children)
{
updateScreenSpaceError(child, 0, constant, CamLocation);
......@@ -405,7 +405,7 @@ float FBoundingVolume::getDistanceTo(FVector Position, FMatrix bouindingTransfor
FVector ZAxis = FVector(box[9], box[10], box[11]);
//TODO FIXME is currently spher distance
UE_LOG(TILES, Error, TEXT("Box distance is not implemented"));
//UE_LOG(TILES, Error, TEXT("Box distance is not implemented"));
double dist = (localPos - Center).Size();
distance = dist - FMath::Max3(XAxis.Size(), YAxis.Size(), ZAxis.Size());
......@@ -413,8 +413,9 @@ float FBoundingVolume::getDistanceTo(FVector Position, FMatrix bouindingTransfor
else if (region.Num() == 6) {
// WGS84
//TODO FIXME is currently spher distance
UE_LOG(TILES, Error, TEXT("Region distance is not implemented"));
// UE_LOG(TILES, Error, TEXT("Region distance is not implemented"));
FVector Center = FVector(0, 0, 6378137);
UE_LOG(TILES, Error, TEXT("Position %s, Center %s, Transform %s"), *Position.ToString(), *Center.ToString(), *bouindingTransformation.ToString());
double dist = (Position - Center).Size();
distance = dist;
}else if (sphere.Num() == 4) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment