15 using namespace Radar;
45 assert(frontSprite || rearSprite);
66 for (Sensor::TrackCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it)
68 static bool draw_both =
70 if (it->GetPosition().z < 0 || draw_both)
75 if (it->GetPosition().z >= 0 || draw_both)
98 if (negate_z) position.z=-position.z;
100 static bool negate_z =
103 position.z=-position.z;
107 const float trackSize = 2.0;
112 Jitter(0.02, 0.04, position);
118 if (isNebula || isEcmActive)
120 float error = 0.02 * trackSize;
121 Jitter(error, error, position);
130 float magnitude = position.Magnitude();
131 float scaleFactor = 0.0;
133 if (magnitude <= maxRange)
136 scaleFactor = (1.0 -
innerSphere) * (maxRange - magnitude) / maxRange;
137 magnitude /= (1.0 - scaleFactor);
139 Vector scaledPosition =
Vector(-position.x, position.y, position.z) / magnitude;
147 if (dangerRate > 0.0)
173 const float crossSize = 8.0;
182 GFXVertex3f(position.x + xcross, position.y, 0.0f);
183 GFXVertex3f(position.x - xcross, position.y, 0.0f);
184 GFXVertex3f(position.x, position.y - ycross, 0.0f);
185 GFXVertex3f(position.x, position.y + ycross, 0.0f);
200 float logvelocity = 3.0;
201 if (velocity > 1000.0)
204 logvelocity = std::log10(velocity);
206 const float size = 3.0 * logvelocity;