mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:30:33 +02:00
tweaks to some variable names since windows has a problem with them
This commit is contained in:
parent
5725a92cfe
commit
e55e680e66
3 changed files with 140 additions and 140 deletions
|
@ -463,7 +463,7 @@ void ViewFrustum::computePickRay(float x, float y, glm::vec3& origin, glm::vec3&
|
|||
direction = glm::normalize(origin - (_position + _orientation * _eyeOffsetPosition));
|
||||
}
|
||||
|
||||
void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& near, float& far,
|
||||
void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& nearValue, float& farValue,
|
||||
glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const {
|
||||
// compute our dimensions the usual way
|
||||
float hheight = _nearClip * tanf(_fieldOfView * 0.5f * PI_OVER_180);
|
||||
|
@ -483,16 +483,16 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
|
|||
corners[7] = eyeMatrix * glm::vec4(-hwidth * farScale, hheight * farScale, -_farClip, 1.0f);
|
||||
|
||||
// find the minimum and maximum z values, which will be our near and far clip distances
|
||||
near = FLT_MAX;
|
||||
far = -FLT_MAX;
|
||||
nearValue = FLT_MAX;
|
||||
farValue = -FLT_MAX;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
near = min(near, -corners[i].z);
|
||||
far = max(far, -corners[i].z);
|
||||
nearValue = min(nearValue, -corners[i].z);
|
||||
farValue = max(farValue, -corners[i].z);
|
||||
}
|
||||
|
||||
// make sure the near clip isn't too small to be valid
|
||||
const float MIN_NEAR = 0.01f;
|
||||
near = max(MIN_NEAR, near);
|
||||
nearValue = max(MIN_NEAR, nearValue);
|
||||
|
||||
// get the near/far normal and use it to find the clip planes
|
||||
glm::vec4 normal = eyeMatrix * glm::vec4(0.0f, 0.0f, 1.0f, 0.0f);
|
||||
|
@ -509,7 +509,7 @@ void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom
|
|||
top = -FLT_MAX;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
glm::vec4 corner = glm::mix(corners[i], corners[i + 4], focalProportion);
|
||||
glm::vec4 intersection = corner * (-near / corner.z);
|
||||
glm::vec4 intersection = corner * (-nearValue / corner.z);
|
||||
left = min(left, intersection.x);
|
||||
right = max(right, intersection.x);
|
||||
bottom = min(bottom, intersection.y);
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
|
||||
void computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const;
|
||||
|
||||
void computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& near, float& far,
|
||||
void computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& nearValue, float& farValue,
|
||||
glm::vec4& nearClipPlane, glm::vec4& farClipPlane) const;
|
||||
|
||||
void printDebugDetails() const;
|
||||
|
|
|
@ -121,11 +121,11 @@ int getSemiNibbleAt(unsigned char& byte, int bitIndex) {
|
|||
}
|
||||
|
||||
int getNthBit(unsigned char byte, int ordinal) {
|
||||
const int ERROR = -1;
|
||||
const int ERROR_RESULT = -1;
|
||||
const int MIN_ORDINAL = 1;
|
||||
const int MAX_ORDINAL = 8;
|
||||
if (ordinal < MIN_ORDINAL || ordinal > MAX_ORDINAL) {
|
||||
return ERROR;
|
||||
return ERROR_RESULT;
|
||||
}
|
||||
int bitsSet = 0;
|
||||
for (int bitIndex = 0; bitIndex < MAX_ORDINAL; bitIndex++) {
|
||||
|
@ -136,7 +136,7 @@ int getNthBit(unsigned char byte, int ordinal) {
|
|||
return bitIndex;
|
||||
}
|
||||
}
|
||||
return ERROR;
|
||||
return ERROR_RESULT;
|
||||
}
|
||||
|
||||
bool isBetween(int64_t value, int64_t max, int64_t min) {
|
||||
|
|
Loading…
Reference in a new issue