Class BaseRenderData
- All Implemented Interfaces:
RenderDataAPI
- Direct Known Subclasses:
BaseInstanceRenderData,SegmentEntity,TextFieldEntity,TrailEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected final int[]protected byteprotected ControlDataAPIprotected Objectprotected final float[]protected booleanprotected booleanprotected Objectprotected final FloatBufferprotected org.lwjgl.util.vector.Matrix4fprotected final FloatBufferprotected org.lwjgl.util.vector.Matrix4fprotected byteprotected final FloatBufferprotected final SpinLockprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected intvoidadvanceGlobalTimer(float amount, boolean isPausedNow) Automatic running, not required to call it.voidappendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target) voidappendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle) voidappendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle, org.lwjgl.util.vector.Vector2f scale) voidappendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle, org.lwjgl.util.vector.Vector3f scale) voiddelete()intintintintintbytecom.fs.starfarer.api.campaign.CampaignEngineLayerscom.fs.starfarer.api.combat.CombatEngineLayersfloat[]floatbytegetLayer()org.lwjgl.util.vector.Matrix4forg.lwjgl.util.vector.Matrix4fWhen upload a custom prime matrix, callRenderDataAPI.setCustomPrimeMatrix()with this method.bytevoidglDraw()booleanvoidvoidbooleanbooleanbooleanbooleanbooleanbooleanbooleanOnly for system rendering calls, not applicable to developer.Only for system rendering calls, not applicable to developer.Only for system rendering calls, not applicable to developer.voidreset()voidvoidsetAutoSubmitEntityData(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).voidsetAutoSubmitModelMatrix(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).voidsetAutoSubmitPrimeMatrix(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).voidsetBlendEquation(int mode) voidsetBlendFunc(int srcFactor, int dstFactor) voidsetBlendFuncSeparate(int srcColorFactor, int dstColorFactor, int srcAlphaFactor, int dstAlphaFactor) voidsetControlData(ControlDataAPI data) For custom your rendering entity.setCustomData(Object value) voidvoidvoidvoidvoidsetFacingScale(float facing, float scaleX, float scaleY) voidsetGlobalTimer(float fadeIn, float full, float fadeOut) voidFor once frame rendering instance data, should use fixed type instance data.voidvoidsetLocation(float x, float y) voidsetLocation(float x, float y, float z) voidsetLocation(org.lwjgl.util.vector.Vector2f location) voidsetLocation(org.lwjgl.util.vector.Vector3f location) voidsetModelMatrix(org.lwjgl.util.vector.Matrix4f modelMatrix) voidAs custom blend mode.voidvoidDefault blend mode.voidvoidsetPrimeMatrix(org.lwjgl.util.vector.Matrix4f primeMatrix) Generally, in there it is viewport and camera matrix(VP matrix, View and Projection in MVP), means 'main' not 'prime matrix'.voidsetRotateScale(org.lwjgl.util.vector.Vector3f rotate, org.lwjgl.util.vector.Vector3f scale) voidsetStateVanilla(org.lwjgl.util.vector.Vector2f location, float facing) voidsetStateVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale) voidsetTimerPaused(boolean paused) Block timer even if not in paused.voidsetTimingWhenPaused(boolean timing) Affects entity timer, and instance data.voidvoidWithout matrix data or timer settings.voidvoidOnly required when use a custom prime matrix.
-
Field Details
-
primeMatrixState
protected byte primeMatrixState -
blendState
protected byte blendState -
timingWhenPaused
protected boolean timingWhenPaused -
isTimerPaused
protected boolean isTimerPaused -
autoSubmitPrimeMat
protected boolean autoSubmitPrimeMat -
autoSubmitModelMat
protected boolean autoSubmitModelMat -
autoSubmitDataBuffer
protected boolean autoSubmitDataBuffer -
hasDelete
protected volatile boolean hasDelete -
sync_lock
-
primeMatBuffer
-
modelMatBuffer
-
statePackageBuffer
-
primeMatrix
protected org.lwjgl.util.vector.Matrix4f primeMatrix -
modelMatrix
protected org.lwjgl.util.vector.Matrix4f modelMatrix -
blendConfig
protected final int[] blendConfig -
globalTimer
protected final float[] globalTimer -
controlData
-
customData
-
layer
-
-
Constructor Details
-
BaseRenderData
public BaseRenderData()
-
-
Method Details
-
_StatePackageStack
protected int _StatePackageStack() -
_deleteExc
protected void _deleteExc() -
delete
public void delete()- Specified by:
deletein interfaceRenderDataAPI
-
hasDelete
public boolean hasDelete()- Specified by:
hasDeletein interfaceRenderDataAPI- Returns:
- Should not use this entity when true.
-
glDraw
public void glDraw()- Specified by:
glDrawin interfaceRenderDataAPI
-
_resetExc
protected void _resetExc() -
reset
public void reset()- Specified by:
resetin interfaceRenderDataAPI
-
isAutoSubmitEntityData
public boolean isAutoSubmitEntityData()- Specified by:
isAutoSubmitEntityDatain interfaceRenderDataAPI
-
setAutoSubmitEntityData
public void setAutoSubmitEntityData(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).If data changes are infrequent, you may disable this feature and use
RenderDataAPI.submitEntityData()for manual submits instead, which can reduce unnecessary memory copies to a certain extent.- Specified by:
setAutoSubmitEntityDatain interfaceRenderDataAPI
-
submitEntityData
public void submitEntityData()Without matrix data or timer settings.- Specified by:
submitEntityDatain interfaceRenderDataAPI
-
getControlData
- Specified by:
getControlDatain interfaceRenderDataAPI
-
setControlData
For custom your rendering entity.Always execute
ControlDataAPI.controlInit(RenderDataAPI)when call this method.More than one
RenderDataAPIentities always can be using a same data entity.- Specified by:
setControlDatain interfaceRenderDataAPI
-
getCustomData
- Specified by:
getCustomDatain interfaceRenderDataAPI
-
setCustomData
- Specified by:
setCustomDatain interfaceRenderDataAPI
-
getGlobalTimer
public float[] getGlobalTimer()- Specified by:
getGlobalTimerin interfaceRenderDataAPI
-
setGlobalTimer
public void setGlobalTimer(float fadeIn, float full, float fadeOut) - Specified by:
setGlobalTimerin interfaceRenderDataAPI
-
advanceGlobalTimer
public void advanceGlobalTimer(float amount, boolean isPausedNow) Automatic running, not required to call it.- Specified by:
advanceGlobalTimerin interfaceRenderDataAPI
-
getGlobalTimerState
public byte getGlobalTimerState()- Specified by:
getGlobalTimerStatein interfaceRenderDataAPI
-
getGlobalTimerAlpha
public float getGlobalTimerAlpha()- Specified by:
getGlobalTimerAlphain interfaceRenderDataAPI
-
isGlobalTimerOver
public boolean isGlobalTimerOver()- Specified by:
isGlobalTimerOverin interfaceRenderDataAPI
-
isGlobalTimerOnce
public boolean isGlobalTimerOnce()- Specified by:
isGlobalTimerOncein interfaceRenderDataAPI
-
setGlobalTimerOnce
public void setGlobalTimerOnce()For once frame rendering instance data, should use fixed type instance data.- Specified by:
setGlobalTimerOncein interfaceRenderDataAPI
-
isTimingWhenPaused
public boolean isTimingWhenPaused()- Specified by:
isTimingWhenPausedin interfaceRenderDataAPI
-
setTimingWhenPaused
public void setTimingWhenPaused(boolean timing) Affects entity timer, and instance data.- Specified by:
setTimingWhenPausedin interfaceRenderDataAPI
-
isTimerPaused
public boolean isTimerPaused()- Specified by:
isTimerPausedin interfaceRenderDataAPI
-
setTimerPaused
public void setTimerPaused(boolean paused) Block timer even if not in paused.- Specified by:
setTimerPausedin interfaceRenderDataAPI
-
getPrimeMatrix
public org.lwjgl.util.vector.Matrix4f getPrimeMatrix()- Specified by:
getPrimeMatrixin interfaceRenderDataAPI
-
getPrimeMatrixBuffer
When upload a custom prime matrix, callRenderDataAPI.setCustomPrimeMatrix()with this method.- Specified by:
getPrimeMatrixBufferin interfaceRenderDataAPI- Returns:
- 4x4 matrix in buffer with 16 capacity.
-
isAutoSubmitPrimeMatrix
public boolean isAutoSubmitPrimeMatrix()- Specified by:
isAutoSubmitPrimeMatrixin interfaceRenderDataAPI
-
setAutoSubmitPrimeMatrix
public void setAutoSubmitPrimeMatrix(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).If data changes are infrequent, you may disable this feature and use
RenderDataAPI.submitPrimeMatrix()for manual submits instead, which can reduce unnecessary memory copies to a certain extent.Alternatively, use
RenderDataAPI.getPrimeMatrixBuffer()to directly operate on the corresponding buffer after this feature was disabled;- Specified by:
setAutoSubmitPrimeMatrixin interfaceRenderDataAPI
-
submitPrimeMatrix
public void submitPrimeMatrix()Only required when use a custom prime matrix.- Specified by:
submitPrimeMatrixin interfaceRenderDataAPI
-
initIdentityPrimeMatrix
public void initIdentityPrimeMatrix()- Specified by:
initIdentityPrimeMatrixin interfaceRenderDataAPI
-
setPrimeMatrix
public void setPrimeMatrix(org.lwjgl.util.vector.Matrix4f primeMatrix) Generally, in there it is viewport and camera matrix(VP matrix, View and Projection in MVP), means 'main' not 'prime matrix'.In shader program: [this matrix * model matrix * vertex]
Must call
RenderDataAPI.setCustomPrimeMatrix()if use it.- Specified by:
setPrimeMatrixin interfaceRenderDataAPI- Parameters:
primeMatrix- for usual, this is a matrix as [Projection * Look-at].
-
getPrimeMatrixState
public byte getPrimeMatrixState()- Specified by:
getPrimeMatrixStatein interfaceRenderDataAPI
-
setVanillaPrimeMatrix
public void setVanillaPrimeMatrix()- Specified by:
setVanillaPrimeMatrixin interfaceRenderDataAPI
-
setPerspectivePrimeMatrix
public void setPerspectivePrimeMatrix()- Specified by:
setPerspectivePrimeMatrixin interfaceRenderDataAPI
-
setCustomPrimeMatrix
public void setCustomPrimeMatrix()- Specified by:
setCustomPrimeMatrixin interfaceRenderDataAPI
-
setNonePrimeMatrix
public void setNonePrimeMatrix()- Specified by:
setNonePrimeMatrixin interfaceRenderDataAPI
-
getModelMatrix
public org.lwjgl.util.vector.Matrix4f getModelMatrix()- Specified by:
getModelMatrixin interfaceRenderDataAPI
-
getModelMatrixBuffer
- Specified by:
getModelMatrixBufferin interfaceRenderDataAPI- Returns:
- 4x4 matrix in buffer with 16 capacity.
-
isAutoSubmitModelMatrix
public boolean isAutoSubmitModelMatrix()- Specified by:
isAutoSubmitModelMatrixin interfaceRenderDataAPI
-
setAutoSubmitModelMatrix
public void setAutoSubmitModelMatrix(boolean toggleAuto) Enabling auto-submit incurs a slight memory copy overhead (default behavior, also with potential heap memory allocation).If data changes are infrequent, you may disable this feature and use
RenderDataAPI.submitModelMatrix()for manual submits instead, which can reduce unnecessary memory copies to a certain extent.Alternatively, use
RenderDataAPI.getModelMatrixBuffer()to directly operate on the corresponding buffer after this feature was disabled;- Specified by:
setAutoSubmitModelMatrixin interfaceRenderDataAPI
-
submitModelMatrix
public void submitModelMatrix()- Specified by:
submitModelMatrixin interfaceRenderDataAPI
-
initIdentityModelMatrix
public void initIdentityModelMatrix()- Specified by:
initIdentityModelMatrixin interfaceRenderDataAPI
-
setModelMatrix
public void setModelMatrix(@NotNull org.lwjgl.util.vector.Matrix4f modelMatrix) - Specified by:
setModelMatrixin interfaceRenderDataAPI- Parameters:
modelMatrix- for usual, this is a model matrix.
-
setLocation
public void setLocation(float x, float y) - Specified by:
setLocationin interfaceRenderDataAPI
-
setLocation
public void setLocation(float x, float y, float z) - Specified by:
setLocationin interfaceRenderDataAPI
-
setLocation
public void setLocation(org.lwjgl.util.vector.Vector2f location) - Specified by:
setLocationin interfaceRenderDataAPI
-
setLocation
public void setLocation(org.lwjgl.util.vector.Vector3f location) - Specified by:
setLocationin interfaceRenderDataAPI
-
setFacingScale
public void setFacingScale(float facing, float scaleX, float scaleY) - Specified by:
setFacingScalein interfaceRenderDataAPI
-
setRotateScale
public void setRotateScale(org.lwjgl.util.vector.Vector3f rotate, org.lwjgl.util.vector.Vector3f scale) - Specified by:
setRotateScalein interfaceRenderDataAPI
-
setStateVanilla
public void setStateVanilla(org.lwjgl.util.vector.Vector2f location, float facing, org.lwjgl.util.vector.Vector2f scale) - Specified by:
setStateVanillain interfaceRenderDataAPI
-
setStateVanilla
public void setStateVanilla(org.lwjgl.util.vector.Vector2f location, float facing) - Specified by:
setStateVanillain interfaceRenderDataAPI
-
appendToEntity
public void appendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle, org.lwjgl.util.vector.Vector3f scale) - Specified by:
appendToEntityin interfaceRenderDataAPI
-
appendToEntity
public void appendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle, org.lwjgl.util.vector.Vector2f scale) - Specified by:
appendToEntityin interfaceRenderDataAPI
-
appendToEntity
public void appendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target, float offsetAngle) - Specified by:
appendToEntityin interfaceRenderDataAPI
-
appendToEntity
public void appendToEntity(com.fs.starfarer.api.combat.CombatEntityAPI target) - Specified by:
appendToEntityin interfaceRenderDataAPI
-
pickPrimeMatrixPackage_mat4
Only for system rendering calls, not applicable to developer.- Specified by:
pickPrimeMatrixPackage_mat4in interfaceRenderDataAPI
-
pickModelMatrixPackage_mat4
Only for system rendering calls, not applicable to developer.- Specified by:
pickModelMatrixPackage_mat4in interfaceRenderDataAPI
-
pickDataPackage_vec4
Only for system rendering calls, not applicable to developer.- Specified by:
pickDataPackage_vec4in interfaceRenderDataAPI
-
getBlendColorSRC
public int getBlendColorSRC()- Specified by:
getBlendColorSRCin interfaceRenderDataAPI
-
getBlendColorDST
public int getBlendColorDST()- Specified by:
getBlendColorDSTin interfaceRenderDataAPI
-
getBlendAlphaSRC
public int getBlendAlphaSRC()- Specified by:
getBlendAlphaSRCin interfaceRenderDataAPI
-
getBlendAlphaDST
public int getBlendAlphaDST()- Specified by:
getBlendAlphaDSTin interfaceRenderDataAPI
-
getBlendEquation
public int getBlendEquation()- Specified by:
getBlendEquationin interfaceRenderDataAPI
-
getBlendState
public byte getBlendState()- Specified by:
getBlendStatein interfaceRenderDataAPI
-
setBlendFunc
public void setBlendFunc(int srcFactor, int dstFactor) - Specified by:
setBlendFuncin interfaceRenderDataAPI- See Also:
-
GL11.glBlendFunc(int, int)
-
setBlendFuncSeparate
public void setBlendFuncSeparate(int srcColorFactor, int dstColorFactor, int srcAlphaFactor, int dstAlphaFactor) - Specified by:
setBlendFuncSeparatein interfaceRenderDataAPI- See Also:
-
GL14.glBlendFuncSeparate(int, int, int, int)
-
setBlendEquation
public void setBlendEquation(int mode) - Specified by:
setBlendEquationin interfaceRenderDataAPI- See Also:
-
GL14.glBlendEquation(int)
-
setAdditiveBlend
public void setAdditiveBlend()- Specified by:
setAdditiveBlendin interfaceRenderDataAPI
-
setNormalBlend
public void setNormalBlend()Default blend mode.- Specified by:
setNormalBlendin interfaceRenderDataAPI
-
setNegativeBlend
public void setNegativeBlend()As custom blend mode.- Specified by:
setNegativeBlendin interfaceRenderDataAPI
-
setDisableBlend
public void setDisableBlend()- Specified by:
setDisableBlendin interfaceRenderDataAPI
-
getLayer
- Specified by:
getLayerin interfaceRenderDataAPI
-
getCombatLayer
public com.fs.starfarer.api.combat.CombatEngineLayers getCombatLayer()- Specified by:
getCombatLayerin interfaceRenderDataAPI
-
getCampaignLayer
public com.fs.starfarer.api.campaign.CampaignEngineLayers getCampaignLayer()- Specified by:
getCampaignLayerin interfaceRenderDataAPI
-
setLayer
- Specified by:
setLayerin interfaceRenderDataAPI
-
setDefaultCombatLayer
public void setDefaultCombatLayer()- Specified by:
setDefaultCombatLayerin interfaceRenderDataAPI
-
setDefaultCampaignLayer
public void setDefaultCampaignLayer()- Specified by:
setDefaultCampaignLayerin interfaceRenderDataAPI
-
entityType
- Specified by:
entityTypein interfaceRenderDataAPI
-