mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 20:20:40 +00:00
- inlined Clipper::PointToAngle
This commit is contained in:
parent
2e191f2742
commit
35221188db
2 changed files with 23 additions and 24 deletions
|
@ -358,29 +358,6 @@ void Clipper::DoRemoveClipRange(angle_t start, angle_t end)
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
binangle Clipper::PointToAngle(const vec2_t& pos)
|
||||
{
|
||||
vec2_t vec = pos - viewpoint;
|
||||
#if 0
|
||||
|
||||
if (vec.x == 0 && vec.y == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
double result = vec.y / double(abs(vec.x) + fabs(vec.y));
|
||||
if (vec.x < 0)
|
||||
{
|
||||
result = 2. - result;
|
||||
}
|
||||
return bamang(xs_Fix<30>::ToFix(result));
|
||||
}
|
||||
#else
|
||||
return bvectangbam(vec.x, vec.y);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Clipper::DumpClipper()
|
||||
{
|
||||
for (auto node = cliphead; node; node = node->next)
|
||||
|
|
|
@ -144,7 +144,29 @@ public:
|
|||
|
||||
void DumpClipper();
|
||||
|
||||
binangle PointToAngle(const vec2_t& point);
|
||||
binangle PointToAngle(const vec2_t& pos)
|
||||
{
|
||||
vec2_t vec = pos - viewpoint;
|
||||
#if 0
|
||||
|
||||
if (vec.x == 0 && vec.y == 0)
|
||||
{
|
||||
return bamang(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
double result = vec.y / double(abs(vec.x) + fabs(vec.y));
|
||||
if (vec.x < 0)
|
||||
{
|
||||
result = 2. - result;
|
||||
}
|
||||
return bamang(xs_Fix<30>::ToFix(result));
|
||||
}
|
||||
#else
|
||||
return bvectangbam(vec.x, vec.y);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue