mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 09:47:58 +03:00
Fix namespace
This commit is contained in:
parent
a9dfdec427
commit
2fd6addea6
2 changed files with 6 additions and 6 deletions
|
@ -70,7 +70,7 @@ int CollideStaticObjects(COLL_INFO* coll, int x, int y, int z, short roomNumber,
|
||||||
int yMin = mesh->y + sInfo->xMinc;
|
int yMin = mesh->y + sInfo->xMinc;
|
||||||
int yMax = mesh->y + sInfo->yMaxc;
|
int yMax = mesh->y + sInfo->yMaxc;
|
||||||
|
|
||||||
array<float, 4> box{sInfo->xMinc, sInfo->zMinc, sInfo->xMaxc, sInfo->zMaxc};
|
std::array<float, 4> box{sInfo->xMinc, sInfo->zMinc, sInfo->xMaxc, sInfo->zMaxc};
|
||||||
RotateBoundingBox(box, mesh->yRot);
|
RotateBoundingBox(box, mesh->yRot);
|
||||||
|
|
||||||
xMin = box[0];
|
xMin = box[0];
|
||||||
|
@ -1707,12 +1707,12 @@ Vector2 GetDiagonalIntersect(int xPos, int zPos, int splitType, int radius, shor
|
||||||
return vect;
|
return vect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RotateBoundingBox(array<float, 4>& box, short angle)
|
void RotateBoundingBox(std::array<float, 4>& box, short angle)
|
||||||
{
|
{
|
||||||
float s = sin(TO_RAD(angle));
|
float s = sin(TO_RAD(angle));
|
||||||
float c = cos(TO_RAD(angle));
|
float c = cos(TO_RAD(angle));
|
||||||
|
|
||||||
array<float, 4> x, z;
|
std::array<float, 4> x, z;
|
||||||
x[0] = box[0] * c;
|
x[0] = box[0] * c;
|
||||||
z[0] = -box[0] * s;
|
z[0] = -box[0] * s;
|
||||||
x[1] = box[1] * s;
|
x[1] = box[1] * s;
|
||||||
|
@ -1722,8 +1722,8 @@ void RotateBoundingBox(array<float, 4>& box, short angle)
|
||||||
x[3] = box[3] * s;
|
x[3] = box[3] * s;
|
||||||
z[3] = box[3] * c;
|
z[3] = box[3] * c;
|
||||||
|
|
||||||
auto xPair = minmax_element(begin(x), end(x));
|
auto xPair = std::minmax_element(begin(x), end(x));
|
||||||
auto zPair = minmax_element(begin(z), end(z));
|
auto zPair = std::minmax_element(begin(z), end(z));
|
||||||
|
|
||||||
box[0] = *xPair.first;
|
box[0] = *xPair.first;
|
||||||
box[1] = *zPair.first;
|
box[1] = *zPair.first;
|
||||||
|
|
|
@ -131,7 +131,7 @@ bool SnapToQuadrant(short& angle, int interval);
|
||||||
int GetQuadrant(short angle);
|
int GetQuadrant(short angle);
|
||||||
bool SnapToDiagonal(short& angle, int interval);
|
bool SnapToDiagonal(short& angle, int interval);
|
||||||
int GetOctant(short angle);
|
int GetOctant(short angle);
|
||||||
void RotateBoundingBox(array<float, 4>& box, short angle);
|
void RotateBoundingBox(std::array<float, 4>& box, short angle);
|
||||||
// New function for rotating item along XZ slopes.
|
// New function for rotating item along XZ slopes.
|
||||||
// (int radiusDivide) is for radiusZ, else the MaxZ is too high and cause rotation problem !
|
// (int radiusDivide) is for radiusZ, else the MaxZ is too high and cause rotation problem !
|
||||||
// Dont need to set a value in radiusDivide if you dont need it (radiusDivide is set to 1 by default).
|
// Dont need to set a value in radiusDivide if you dont need it (radiusDivide is set to 1 by default).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue