10000 Removes unused variables in G3D:Ray by Gamemechanicwow · Pull Request #3040 · vmangos/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Removes unused variables in G3D:Ray #3040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions dep/include/g3dlite/G3D/Ray.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ class Ray {
/** 1.0 / direction */
Vector3 m_invDirection;


/** The following are for the "ray slope" optimization from
"Fast Ray / Axis-Aligned Bounding Box Overlap Tests using Ray Slopes"
by Martin Eisemann, Thorsten Grosch, Stefan M��ller and Marcus Magnor
Computer Graphics Lab, TU Braunschweig, Germany and
University of Koblenz-Landau, Germany */
enum Classification {MMM, MMP, MPM, MPP, PMM, PMP, PPM, PPP, POO, MOO, OPO, OMO, OOP, OOM, OMM, OMP, OPM, OPP, MOM, MOP, POM, POP, MMO, MPO, PMO, PPO};

Classification classification;

/** ray slope */
float ibyj, jbyi, kbyj, jbyk, ibyk, kbyi;

/** Precomputed components */
float c_xy, c_xz, c_yx, c_yz, c_zx, c_zy;

public:
/** \param direction Assumed to have unit length */
void set(const Point3& origin, const Vector3& direction);
Expand Down
99 changes: 0 additions & 99 deletions dep/src/g3dlite/Ray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,105 +21,6 @@ void Ray::set(const Vector3& origin, const Vector3& direction) {
debugAssert(direction.isUnit());

m_invDirection = Vector3::one() / direction;

// ray slope
ibyj = m_direction.x * m_invDirection.y;
jbyi = m_direction.y * m_invDirection.x;
jbyk = m_direction.y * m_invDirection.z;
kbyj = m_direction.z * m_invDirection.y;
ibyk = m_direction.x * m_invDirection.z;
kbyi = m_direction.z * m_invDirection.x;

// precomputed terms
c_xy = m_origin.y - jbyi * m_origin.x;
c_xz = m_origin.z - kbyi * m_origin.x;
c_yx = m_origin.x - ibyj * m_origin.y;
c_yz = m_origin.z - kbyj * m_origin.y;
c_zx = m_origin.x - ibyk * m_origin.z;
c_zy = m_origin.y - jbyk * m_origin.z;

//ray slope classification
if (m_direction.x < 0) {
if (m_direction.y < 0) {
if (m_direction.z < 0) {
classification = MMM;
} else if (m_direction.z > 0) {
classification = MMP;
} else { //(m_direction.z >= 0)
classification = MMO;
}
} else { //(m_direction.y >= 0)
if (m_direction.z < 0) {
if (m_direction.y == 0) {
classification = MOM;
} else {
classification = MPM;
}
} else { //(m_direction.z >= 0)
if ((m_direction.y == 0) && (m_direction.z == 0)) {
classification = MOO;
} else if (m_direction.z == 0) {
classification = MPO;
} else if (m_direction.y == 0) {
classification = MOP;
} else {
classification = MPP;
}
}
}
} else { //(m_direction.x >= 0)
if (m_direction.y < 0) {
if (m_direction.z < 0) {
if (m_direction.x == 0) {
classification = OMM;
} else {
classification = PMM;
}
} else { //(m_direction.z >= 0)
if ((m_direction.x == 0) && (m_direction.z == 0)) {
classification = OMO;
} else if (m_direction.z == 0) {
classification = PMO;
} else if (m_direction.x == 0) {
classification = OMP;
} else {
classification = PMP;
}
}
} else { //(m_direction.y >= 0)
if (m_direction.z < 0) {
if ((m_direction.x == 0) && (m_direction.y == 0)) {
classification = OOM;
} else if (m_direction.x == 0) {
classification = OPM;
} else if (m_direction.y == 0) {
classification = POM;
} else {
classification = PPM;
}
} else { //(m_direction.z > 0)
if (m_direction.x == 0) {
if (m_direction.y == 0) {
classification = OOP;
} else if (m_direction.z == 0) {
classification = OPO;
} else {
classification = OPP;
}
} else {
if ((m_direction.y == 0) && (m_direction.z == 0)) {
classification = POO;
} else if (m_direction.y == 0) {
classification = POP;
} else if (m_direction.z == 0) {
classification = PPO;
} else {
classification = PPP;
}
}
}
}
}
}


Expand Down
0