mirror of https://github.com/AxioDL/zeus.git
Fix CAABox::getPoint
This commit is contained in:
parent
8c1ddd86b1
commit
07eb5e52ed
|
@ -367,13 +367,8 @@ public:
|
||||||
|
|
||||||
inline CVector3f getPoint(const int point) const
|
inline CVector3f getPoint(const int point) const
|
||||||
{
|
{
|
||||||
int zOff = point & 4;
|
const CVector3f* vecs = &min;
|
||||||
int yOff = (point * 2) & 4;
|
return CVector3f(vecs[(point & 1) != 0].x, vecs[(point & 2) != 0].y, vecs[(point & 4) != 0].z);
|
||||||
int xOff = (point * 4) & 4;
|
|
||||||
float z = ((float*)(&min.x) + zOff)[2];
|
|
||||||
float y = ((float*)(&min.x) + yOff)[1];
|
|
||||||
float x = ((float*)(&min.x) + xOff)[0];
|
|
||||||
return CVector3f(x, y, z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline CVector3f clampToBox(const CVector3f& vec)
|
inline CVector3f clampToBox(const CVector3f& vec)
|
||||||
|
|
Loading…
Reference in New Issue