T
- The base type of object this radar is responsible.
public interface CommonRadar<T>
RadarSettings
values or perform common
radar operations.
Modifier and Type | Method and Description |
---|---|
void |
disableStencilTest()
Disables the radar stencil, allowing shapes to be rendered outside of the
radar circle.
|
void |
enableStencilTest()
Enables the radar stencil, which prevents anything from being rendered
outside of the radar circle.
|
java.util.List |
filterVisible(java.util.List<? extends T> contacts,
int maxContacts)
Filters out all contacts that aren't in radar range or are invisible to
the player (if
RadarSettings.isRespectingFogOfWar() is
true ). |
float |
getContactAlpha()
Returns the alpha modifier for radar contacts.
|
float |
getCurrentPixelsPerSU()
Returns how many pixels are drawn per SU (Starsector's world unit).
|
float |
getCurrentSightRadius()
Returns how far the radar can see at its current zoom level.
|
float |
getCurrentZoomLevel()
Returns the current zoom level of the radar.
|
java.awt.Color |
getEnemyContactColor()
Returns the color of hostile contacts on the radar.
|
java.awt.Color |
getFriendlyContactColor()
Returns the color of friendly contacts on the radar.
|
java.awt.Color |
getNeutralContactColor()
Returns the color of neutral contacts on the radar.
|
org.lwjgl.util.vector.Vector2f |
getPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc)
Converts a point from world space to radar space.
|
float |
getRadarAlpha()
Returns the alpha modifier for radar UI elements.
|
float[] |
getRawPointOnRadar(float worldX,
float worldY)
Converts a point from world space to radar space.
|
float[] |
getRawPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc)
Converts a point from world space to radar space.
|
float[] |
getRawPointsOnRadar(float[] worldCoords)
Converts multiple points from world space to radar space.
|
org.lwjgl.util.vector.Vector2f |
getRenderCenter()
Returns the center of the radar circle in screen coordinates.
|
float |
getRenderRadius()
Returns the radius of the radar circle in screen coordinates.
|
void |
resetView()
Resets the glOrtho and glViewport to their pristine state.
|
void resetView()
void enableStencilTest()
void disableStencilTest()
enableStencilTest()
, otherwise other renderers will
display graphical errors.
java.awt.Color getFriendlyContactColor()
java.awt.Color getEnemyContactColor()
java.awt.Color getNeutralContactColor()
org.lwjgl.util.vector.Vector2f getRenderCenter()
float getRenderRadius()
float getRadarAlpha()
float getContactAlpha()
float getCurrentPixelsPerSU()
getRenderRadius()
/
getCurrentSightRadius()
.float getCurrentZoomLevel()
float getCurrentSightRadius()
org.lwjgl.util.vector.Vector2f getPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc)
worldLoc
- The point in Starsector coordinates to translate.
worldLoc
translated to radar coordinates.
float[] getRawPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc)
worldLoc
- The point in Starsector coordinates to translate.
worldLoc
translated to radar coordinates.
float[] getRawPointOnRadar(float worldX, float worldY)
worldX
- The X coordinate of the point in Starsector coordinates to
translate.worldY
- The Y coordinate of the point in Starsector coordinates to
translate.
float[] getRawPointsOnRadar(float[] worldCoords)
worldCoords
- The points in Starsector coordinates to translate, in
{x,y} pairs.
worldCoords
translated to radar
coordinates, in {x,y} pairs.
java.util.List filterVisible(java.util.List<? extends T> contacts, int maxContacts)
RadarSettings.isRespectingFogOfWar()
is
true
).contacts
- The list of contacts to be filtered.maxContacts
- The maximum number of contacts to be retained. Use
this if your renderer has a setting to limit how many
contacts it will draw. Pass in -1
for no
limit.
List
of contacts.