Class CombatRenderingManager

java.lang.Object
org.boxutil.manager.CombatRenderingManager

public final class CombatRenderingManager extends Object
  • Method Details

    • addEntity

      public static byte addEntity(@NotNull RenderDataAPI entity)
      NOTE: If entity at highest layer, without any post effect likes bloom or AA.
      Returns:
      return BoxEnum.STATE_SUCCESS when entity valid, return BoxEnum.STATE_FAILED when entity adding failed.
    • containsEntity

      public static boolean containsEntity(@Nullable com.fs.starfarer.api.combat.CombatEngineLayers layer, RenderDataAPI entity)
      Parameters:
      layer - null for any direct draw entity.
    • removeEntity

      public static boolean removeEntity(RenderDataAPI entity)
      Returns:
      returns true if this entity has finished deleted.
    • addStaticTrail

      public static boolean addStaticTrail(@NotNull StaticTrailData trailData, @Nullable com.fs.starfarer.api.combat.CombatEntityAPI linkedEntity, @NotNull com.fs.starfarer.api.combat.CombatEngineLayers layer, @NotNull StaticTrailTracker tacker)
      Parameters:
      trailData - will submit once automatically if this trail data is not exist in system before add.
      linkedEntity - for declare this trail subordinate to the entity.
      Returns:
      returns true when trail data adding success, else false if it not.
    • submitTrailDataChanges

      public static void submitTrailDataChanges(@NotNull StaticTrailData trailData)
      Call if something changes(include material) for trail data in this frame if needed, only once executed in each frame and have active trail tracker.
    • tryCutTrailOnEntity

      public static void tryCutTrailOnEntity(@NotNull com.fs.starfarer.api.combat.CombatEntityAPI linkedEntity)
      Notifies all the trails that the linked entity have to cut off the current trail segment before the next draw, so that it will be treated as a new trail segment.

      For performance and thread‑safety reasons, this method should be called after the start of the advance stage of the current frame AND before the start of the lowest layer rendering stage of the next frame, because it was deferred execution before rendering; otherwise, unexpected visual effects may occur.

      NOTE: Since a trail can be attached to any object independently (or no attached), even though this entity may visually have any number of trails, it is not guaranteed that this entity is the actual subject to which those trails were linked at creation time.

    • tryRemoveTrailOnEntity

      public static void tryRemoveTrailOnEntity(@NotNull com.fs.starfarer.api.combat.CombatEntityAPI linkedEntity, boolean isImmediate)
      Notifies all trails associated with this entity to enter the destruction process.

      For performance and thread‑safety reasons, this method should be called after the start of the advance stage of the current frame AND before the start of the lowest layer rendering stage of the next frame, because it was deferred execution before rendering; otherwise, unexpected visual effects may occur.

      NOTE: Since a trail can be attached to any object independently (or no attached), even though this entity may visually have any number of trails, it is not guaranteed that this entity is the actual subject to which those trails were linked at creation time.

      Parameters:
      isImmediate - notifies with StaticTrailTracker.Result.destroy() when false, otherwise StaticTrailTracker.Result.destroyImmediate()
    • removeStaticTrail

      public static boolean removeStaticTrail(@NotNull StaticTrailData trailData)
      Directly remove the all the trail about this trail data, ignore layer or lifetime.
      Returns:
      returns true when trail data was existed before call this method, else false if it not.
    • addRenderingPlugin

      public static void addRenderingPlugin(@NotNull LayeredRenderingPlugin plugin)
      Parameters:
      plugin - you should not add lots of plugin, and you must know where the layer you want to render.
    • containsRenderingPlugin

      public static boolean containsRenderingPlugin(com.fs.starfarer.api.combat.CombatEngineLayers layer, LayeredRenderingPlugin plugin)
    • containsRenderingPlugin

      public static boolean containsRenderingPlugin(LayeredRenderingPlugin plugin)
    • addBackgroundRenderingPlugin

      public static boolean addBackgroundRenderingPlugin(@NotNull BackgroundEveryFramePlugin plugin)
    • containsBackgroundRenderingPlugin

      public static boolean containsBackgroundRenderingPlugin(@NotNull BackgroundEveryFramePlugin plugin)
    • addBackgroundLogicalPlugin

      public static boolean addBackgroundLogicalPlugin(@NotNull BackgroundEveryFramePlugin plugin)
    • containsBackgroundLogicalPlugin

      public static boolean containsBackgroundLogicalPlugin(@NotNull BackgroundEveryFramePlugin plugin)
    • addCleanupPlugin

      public static void addCleanupPlugin(@NotNull TemporaryCleanupPlugin plugin)
    • containsCleanupPlugin

      public static boolean containsCleanupPlugin(TemporaryCleanupPlugin plugin)
    • getCustomData

      public static ConcurrentMap<String,Object> getCustomData()
      Will auto cleanup after combat over.
    • getGameOrthoViewport

      public static org.lwjgl.util.vector.Matrix4f getGameOrthoViewport()
    • getGamePerspectiveViewport

      public static org.lwjgl.util.vector.Matrix4f getGamePerspectiveViewport()
    • getTimeFraction

      public static float getTimeFraction()
    • getTimeFractionIncludePaused

      public static float getTimeFractionIncludePaused()