Package org.dark.shaders.util
Interface MapObjectAPI
- All Known Implementing Classes:
ThreatMapObject
public interface MapObjectAPI
An interface for managing material/normal/surface-mapped objects in the lighting engine.
- Since:
- 1.10.0
-
Method Summary
Modifier and TypeMethodDescriptionorg.lwjgl.util.vector.Vector2fGets the current location of the object.floatGets the rotational angle for the normal map.booleanGets the horizontal flip flag for the normal map.booleanGets the vertical flip flag for the normal map.floatGets the magnitude scalar for the normal map.floatGets the render radius of the object.booleanReports if a normal map exists for this object.voidrender(com.fs.starfarer.api.combat.CombatEngineLayers layer, com.fs.starfarer.api.combat.ViewportAPI viewport, TextureData.TextureDataType type, boolean alwaysBind) Renders the object with the specified map type.
-
Method Details
-
getLocation
org.lwjgl.util.vector.Vector2f getLocation()Gets the current location of the object.- Returns:
- The current location of the object.
- Since:
- 1.10.0
-
getRenderRadius
float getRenderRadius()Gets the render radius of the object. This is not exactly the same as the usual getRenderRadius(); make sure to explicitly include the entity's visible radius.- Returns:
- The render radius of the object.
- Since:
- 1.10.0
-
getNormalAngle
float getNormalAngle()Gets the rotational angle for the normal map. This is used to transform the vector components when the map is being rendered. This should almost always be the in-engine getFacing() angle of the object, minus 90 degrees.- Returns:
- The rotational angle for the normal map, in degrees.
- Since:
- 1.10.0
-
getNormalFlipHorizontal
boolean getNormalFlipHorizontal()Gets the horizontal flip flag for the normal map. This is almost always false.- Returns:
- The horizontal flip flag for the normal map.
- Since:
- 1.10.0
-
getNormalFlipVertical
boolean getNormalFlipVertical()Gets the vertical flip flag for the normal map. This is almost always false.- Returns:
- The vertical flip flag for the normal map.
- Since:
- 1.10.0
-
getNormalMagnitude
float getNormalMagnitude()Gets the magnitude scalar for the normal map.- Returns:
- The magnitude multiplier for the normal map.
- Since:
- 1.10.0
-
hasNormal
boolean hasNormal()Reports if a normal map exists for this object. If none exists, different shader settings are used prior to the render() call, which should render the material map or diffuse sprite in place of a normal map.- Returns:
- Whether a normal map exists for this object.
- Since:
- 1.10.0
-
render
void render(com.fs.starfarer.api.combat.CombatEngineLayers layer, com.fs.starfarer.api.combat.ViewportAPI viewport, TextureData.TextureDataType type, boolean alwaysBind) Renders the object with the specified map type.- Parameters:
layer- Will presently *always* be ABOVE_SHIPS_LAYER.viewport- Same as the usual render() viewport argument.type- Map type that should be rendered.alwaysBind- Flag to indicate if the sprite texture should always be bound on this call.- Since:
- 1.10.0
-