Class CampaignRenderingManager
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic booleanstatic voidstatic byteaddEntity(RenderDataAPI entity) NOTE: If entity at highest layer, without any post effect likes bloom or AA.static voidstatic booleanaddStaticTrail(StaticTrailData trailData, com.fs.starfarer.api.campaign.SectorEntityToken linkedEntity, com.fs.starfarer.api.campaign.CampaignEngineLayers layer, StaticTrailTracker tacker) static booleanstatic booleanstatic booleanstatic booleancontainsEntity(com.fs.starfarer.api.campaign.CampaignEngineLayers layer, RenderDataAPI entity) static booleancontainsRenderingPlugin(com.fs.starfarer.api.campaign.CampaignEngineLayers layer, LayeredRenderingPlugin plugin) static booleanstatic ConcurrentMap<String,Object> Will auto cleanup after back to title.static org.lwjgl.util.vector.Matrix4fstatic org.lwjgl.util.vector.Matrix4fstatic floatstatic floatstatic booleanremoveEntity(RenderDataAPI entity) static booleanremoveStaticTrail(StaticTrailData trailData) Directly remove the all the trail about this trail data, ignore layer or lifetime.static voidsubmitTrailDataChanges(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.static voidtryCutTrailOnEntity(com.fs.starfarer.api.campaign.SectorEntityToken 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.static voidtryRemoveTrailOnEntity(com.fs.starfarer.api.campaign.SectorEntityToken linkedEntity, boolean isImmediate) Notifies all trails associated with this entity to enter the destruction process.
-
Method Details
-
addEntity
NOTE: If entity at highest layer, without any post effect likes bloom or AA.- Returns:
- return
BoxEnum.STATE_SUCCESSwhen entity valid, returnBoxEnum.STATE_FAILEDwhen entity adding failed.
-
containsEntity
public static boolean containsEntity(@Nullable com.fs.starfarer.api.campaign.CampaignEngineLayers layer, RenderDataAPI entity) - Parameters:
layer-nullfor any direct draw entity.
-
removeEntity
- Returns:
- returns
trueif this entity has finished deleted.
-
addStaticTrail
public static boolean addStaticTrail(@NotNull StaticTrailData trailData, @Nullable com.fs.starfarer.api.campaign.SectorEntityToken linkedEntity, @NotNull com.fs.starfarer.api.campaign.CampaignEngineLayers 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
truewhen trail data adding success, elsefalseif it not.
-
submitTrailDataChanges
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.campaign.SectorEntityToken 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.campaign.SectorEntityToken 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 withStaticTrailTracker.Result.destroy()whenfalse, otherwiseStaticTrailTracker.Result.destroyImmediate()
-
removeStaticTrail
Directly remove the all the trail about this trail data, ignore layer or lifetime.- Returns:
- returns
truewhen trail data was existed before call this method, elsefalseif it not.
-
addRenderingPlugin
- 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.campaign.CampaignEngineLayers layer, LayeredRenderingPlugin plugin) -
containsRenderingPlugin
-
addBackgroundRenderingPlugin
-
containsBackgroundRenderingPlugin
-
addBackgroundLogicalPlugin
-
containsBackgroundLogicalPlugin
-
addCleanupPlugin
-
containsCleanupPlugin
-
getCustomData
Will auto cleanup after back to title. -
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()
-