mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:38:27 +02:00
Divided when I should have multiplied.
This commit is contained in:
parent
8de2dd9485
commit
4e1886dfcb
2 changed files with 2 additions and 3 deletions
|
@ -1104,7 +1104,6 @@ void HeightfieldBrushTool::render() {
|
||||||
if (!Application::getInstance()->getMetavoxels()->findFirstRayHeightfieldIntersection(origin, direction, distance)) {
|
if (!Application::getInstance()->getMetavoxels()->findFirstRayHeightfieldIntersection(origin, direction, distance)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qDebug() << distance;
|
|
||||||
glm::vec3 point = origin + distance * direction;
|
glm::vec3 point = origin + distance * direction;
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -1112,7 +1111,7 @@ void HeightfieldBrushTool::render() {
|
||||||
|
|
||||||
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
|
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
|
||||||
glutSolidSphere(0.1f, 8, 8);
|
glutSolidSphere(1.0f, 8, 8);
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@ int RayHeightfieldIntersectionVisitor::visit(MetavoxelInfo& info, float distance
|
||||||
const uchar* src = (const uchar*)contents.constData();
|
const uchar* src = (const uchar*)contents.constData();
|
||||||
int size = glm::sqrt((float)contents.size());
|
int size = glm::sqrt((float)contents.size());
|
||||||
int highest = size - 1;
|
int highest = size - 1;
|
||||||
float heightScale = highest / EIGHT_BIT_MAXIMUM_RECIPROCAL;
|
float heightScale = highest * EIGHT_BIT_MAXIMUM_RECIPROCAL;
|
||||||
|
|
||||||
// find the initial location in heightfield coordinates
|
// find the initial location in heightfield coordinates
|
||||||
glm::vec3 entry = (_origin + distance * _direction - info.minimum) * (float)highest / info.size;
|
glm::vec3 entry = (_origin + distance * _direction - info.minimum) * (float)highest / info.size;
|
||||||
|
|
Loading…
Reference in a new issue