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 ). |
java.awt.Color |
getAlliedContactColor()
Returns the color of allied contacts on the radar.
|
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.
|
boolean |
isPointOnRadar(float worldLocX,
float worldLocY,
float padding)
Checks if a point in world space is visible on the radar.
|
boolean |
isPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc,
float padding)
Checks if a point in world space is visible on the radar.
|
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()
java.awt.Color getAlliedContactColor()
org.lwjgl.util.vector.Vector2f getRenderCenter()
float getRenderRadius()
float getRadarAlpha()
float getContactAlpha()
float getCurrentPixelsPerSU()
getRenderRadius()
/
getCurrentSightRadius()
.float getCurrentZoomLevel()
float getCurrentSightRadius()
boolean isPointOnRadar(org.lwjgl.util.vector.Vector2f worldLoc, float padding)
worldLoc
- The point to check.padding
- Extra distance from worldLoc
to include in the
check, usually an object's radius.
worldLoc
is within padding
su of being
visible on the radar.
boolean isPointOnRadar(float worldLocX, float worldLocY, float padding)
worldLocX
- The X coordinate of the point to check.worldLocY
- The Y coordinate of the point to check.padding
- Extra distance from worldLoc
to include in the
check, usually an object's radius.
worldLocX
,wolrdLocY
} is
within padding
su of being visible on the radar.
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.