Class TrailEntity
- All Implemented Interfaces:
MaterialRenderAPI,RenderDataAPI
Use vanilla beam texture uv(transversal beam texture).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byteprotected booleanprotected intprotected final intprotected final intprotected final float[]protected MaterialDataprotected final IntBufferprotected List<org.lwjgl.util.vector.Vector2f>protected final int[]protected intprotected final float[]protected final boolean[]Fields inherited from class org.boxutil.base.BaseRenderData
autoSubmitDataBuffer, autoSubmitModelMat, autoSubmitPrimeMat, blendConfig, blendState, controlData, customData, globalTimer, hasDelete, isTimerPaused, layer, modelMatBuffer, modelMatrix, primeMatBuffer, primeMatrix, primeMatrixState, statePackageBuffer, sync_lock, timingWhenPaused -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected intvoidaddNode(org.lwjgl.util.vector.Vector2f node) Node at index 0 will be the end point of the trail, and draw from index end to the last index/ the start point.protected intcomputePrim(int num) voidcopyColorState(float[] colorState) float[]floatorg.lwjgl.util.vector.Vector4ffloatfloat[]org.lwjgl.util.vector.Vector4ffloatfloat[]floatfloatfloatfloatfloatfloatfloatfloatintintList<org.lwjgl.util.vector.Vector2f>getNodes()intintorg.lwjgl.util.vector.Vector4ffloatfloat[]org.lwjgl.util.vector.Vector4ffloatfloat[]floatfloatfloatfloatintvoidglDraw()protected intbooleanisFlick()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisValid()bytemallocNodeData(int nodeNum) Optional.voidvoidvoidsetEndColor(float r, float g, float b, float a) voidsetEndColor(Color color) voidsetEndColor(org.lwjgl.util.vector.Vector4f color) voidsetEndColorAlpha(float alpha) voidsetEndEmissive(float r, float g, float b, float a) voidsetEndEmissive(Color color) voidsetEndEmissive(org.lwjgl.util.vector.Vector4f color) voidsetEndEmissiveAlpha(float alpha) voidsetEndWidth(float width) voidsetEndWidthDirect(float widthHalf) voidsetFillEndAlpha(float alpha) voidsetFillEndFactor(float factor) voidsetFillStartAlpha(float alpha) voidsetFillStartFactor(float factor) voidsetFlick(boolean flick) voidsetFlickerSyncCode(int code) voidsetFlickMixValue(float mix) voidsetFlickWhenPaused(boolean flick) voidsetFlowWhenPaused(boolean flow) voidsetJitterPower(float power) perpendicular to trail, effect on trail texture uv.voidsetMappingModeSubmitData(boolean mappingMode) For some very slight data, useglBufferSubData()may faster.voidsetMaterialData(MaterialData material) voidsetMixFactor(float factor) voidvoidsetNodeRefreshIndex(int index) voidsetNodeRefreshSize(int size) voidsetNodeRenderingCount(int nodeCount) voidRecommend to use relative coordinate.voidsetStartColor(float r, float g, float b, float a) voidsetStartColor(Color color) voidsetStartColor(org.lwjgl.util.vector.Vector4f color) voidsetStartColorAlpha(float alpha) voidsetStartEmissive(float r, float g, float b, float a) voidsetStartEmissive(Color color) voidsetStartEmissive(org.lwjgl.util.vector.Vector4f color) voidsetStartEmissiveAlpha(float alpha) voidsetStartWidth(float width) voidsetStartWidthDirect(float widthHalf) voidsetStripLineMode(boolean isStripLine) voidsetSyncFlick(boolean syncFlick) For each line segments.voidsetSynchronousSubmit(boolean sync) High performance impact when is synchronized.voidsetTexturePixels(float texturePixels) voidsetTextureSpeed(float textureSpeed) It is working together withCurveEntity.setTexturePixels(float).voidsetUVOffset(float offset) voidWithout matrix data or timer settings.byteUse it when you changed the node data.Methods inherited from class org.boxutil.base.BaseRenderData
advanceGlobalTimer, appendToEntity, appendToEntity, appendToEntity, appendToEntity, delete, getBlendAlphaDST, getBlendAlphaSRC, getBlendColorDST, getBlendColorSRC, getBlendEquation, getBlendState, getCampaignLayer, getCombatLayer, getControlData, getCustomData, getGlobalTimer, getGlobalTimerAlpha, getGlobalTimerState, getLayer, getModelMatrix, getModelMatrixBuffer, getPrimeMatrix, getPrimeMatrixBuffer, getPrimeMatrixState, hasDelete, initIdentityModelMatrix, initIdentityPrimeMatrix, isAutoSubmitEntityData, isAutoSubmitModelMatrix, isAutoSubmitPrimeMatrix, isGlobalTimerOnce, isGlobalTimerOver, isTimerPaused, isTimingWhenPaused, pickDataPackage_vec4, pickModelMatrixPackage_mat4, pickPrimeMatrixPackage_mat4, reset, setAdditiveBlend, setAutoSubmitEntityData, setAutoSubmitModelMatrix, setAutoSubmitPrimeMatrix, setBlendEquation, setBlendFunc, setBlendFuncSeparate, setControlData, setCustomData, setCustomPrimeMatrix, setDefaultCampaignLayer, setDefaultCombatLayer, setDisableBlend, setFacingScale, setGlobalTimer, setGlobalTimerOnce, setLayer, setLocation, setLocation, setLocation, setLocation, setModelMatrix, setNegativeBlend, setNonePrimeMatrix, setNormalBlend, setPerspectivePrimeMatrix, setPrimeMatrix, setRotateScale, setStateVanilla, setStateVanilla, setTimerPaused, setTimingWhenPaused, setVanillaPrimeMatrix, submitModelMatrix, submitPrimeMatrix
-
Field Details
-
_BUFFER_DATA_SIZE
protected static final byte _BUFFER_DATA_SIZE- See Also:
-
_TBO
protected final int _TBO -
_TBOTex
protected final int _TBOTex -
_isValid
protected volatile boolean _isValid -
nodeList
-
_lastNodeLength
protected int _lastNodeLength -
_distance
-
shouldRenderingCount
protected int shouldRenderingCount -
nodeRefreshState
protected final int[] nodeRefreshState -
colorState
protected final float[] colorState -
state
protected final float[] state -
stateB
protected final boolean[] stateB -
material
-
multiBind
-
-
Constructor Details
-
TrailEntity
public TrailEntity()
-
-
Method Details
-
_StatePackageStack
protected int _StatePackageStack()- Overrides:
_StatePackageStackin classBaseRenderData
-
getNodesTBO
public int getNodesTBO() -
getNodesTBOTex
public int getNodesTBOTex() -
isValid
public boolean isValid() -
_deleteExc
protected void _deleteExc()- Overrides:
_deleteExcin classBaseRenderData
-
glDraw
public void glDraw()- Specified by:
glDrawin interfaceRenderDataAPI- Overrides:
glDrawin classBaseRenderData
-
_resetExc
protected void _resetExc()- Overrides:
_resetExcin classBaseRenderData
-
resetNodes
public void resetNodes() -
computePrim
protected int computePrim(int num) -
submitNodes
public byte submitNodes()Use it when you changed the node data.Will not keeping any node data if beyonds the initial size or the maximum submit size, recommend to call
mallocNodeData(int)for allocate enough size before.Cost
12 Byte * nof vRAM when have number ofnnodes(n is non-zero even number), that if it had8192nodes will cost96 KiBof vRAM.- Returns:
- return
BoxEnum.STATE_SUCCESSwhen success.return
BoxEnum.STATE_FAILEDwhen an empty node list or refresh count is zero.return
BoxEnum.STATE_FAILED_OTHERwhen happened another error.
-
mallocNodeData
public byte mallocNodeData(int nodeNum) Optional.Just
malloc()without any submit call.- Parameters:
nodeNum- must be positive integer.- Returns:
- return
BoxEnum.STATE_SUCCESSwhen success.return
BoxEnum.STATE_FAILEDwhen parameter error.return
BoxEnum.STATE_FAILED_OTHERwhen happened another error.
-
isSynchronousSubmit
public boolean isSynchronousSubmit() -
setSynchronousSubmit
public void setSynchronousSubmit(boolean sync) High performance impact when is synchronized. -
isMappingModeSubmitData
public boolean isMappingModeSubmitData() -
setMappingModeSubmitData
public void setMappingModeSubmitData(boolean mappingMode) For some very slight data, useglBufferSubData()may faster.Besides, some devices(some ARM SoC) may slower with
glMapBufferRange(), decided by the drive how implements it.- Parameters:
mappingMode- to controls whether submit useglMapBufferRange(), else useglBufferSubData().
-
getNodeRefreshIndex
public int getNodeRefreshIndex() -
setNodeRefreshIndex
public void setNodeRefreshIndex(int index) - Parameters:
index- Will refresh node data start from this index.
-
setNodeRefreshSize
public void setNodeRefreshSize(int size) - Parameters:
size- Will refresh node data count.
-
setNodeRefreshAllFromCurrentIndex
public void setNodeRefreshAllFromCurrentIndex() -
getValidNodeCount
public int getValidNodeCount() -
isHaveValidNodeCount
public boolean isHaveValidNodeCount() -
getNodeRenderingCount
public int getNodeRenderingCount() -
setNodeRenderingCount
public void setNodeRenderingCount(int nodeCount) -
glPrimCount
protected int glPrimCount() -
getNodes
-
setNodes
Recommend to use relative coordinate.Node at index 0 will be the end point of the trail.
- Parameters:
nodeList- Cannot have any null-node, and at least have two nodes, if not then pass this entity when rendering.
-
addNode
public void addNode(@NotNull org.lwjgl.util.vector.Vector2f node) Node at index 0 will be the end point of the trail, and draw from index end to the last index/ the start point. -
putShaderTrailData
public void putShaderTrailData() -
getColorState
public float[] getColorState() -
copyColorState
public void copyColorState(float[] colorState) -
getStartColorArray
public float[] getStartColorArray() -
getStartColorC
-
getStartColor
public org.lwjgl.util.vector.Vector4f getStartColor() -
getStartColorAlpha
public float getStartColorAlpha() -
setStartColor
public void setStartColor(@NotNull org.lwjgl.util.vector.Vector4f color) -
setStartColor
public void setStartColor(float r, float g, float b, float a) -
setStartColor
-
setStartColorAlpha
public void setStartColorAlpha(float alpha) -
getEndColorArray
public float[] getEndColorArray() -
getEndColorC
-
getEndColor
public org.lwjgl.util.vector.Vector4f getEndColor() -
getEndColorAlpha
public float getEndColorAlpha() -
setEndColor
public void setEndColor(@NotNull org.lwjgl.util.vector.Vector4f color) -
setEndColor
public void setEndColor(float r, float g, float b, float a) -
setEndColor
-
setEndColorAlpha
public void setEndColorAlpha(float alpha) -
getStartEmissiveArray
public float[] getStartEmissiveArray() -
getStartEmissiveC
-
getStartEmissive
public org.lwjgl.util.vector.Vector4f getStartEmissive() -
getStartEmissiveAlpha
public float getStartEmissiveAlpha() -
setStartEmissive
public void setStartEmissive(@NotNull org.lwjgl.util.vector.Vector4f color) -
setStartEmissive
public void setStartEmissive(float r, float g, float b, float a) -
setStartEmissive
-
setStartEmissiveAlpha
public void setStartEmissiveAlpha(float alpha) -
getEndEmissiveArray
public float[] getEndEmissiveArray() -
getEndEmissiveC
-
getEndEmissive
public org.lwjgl.util.vector.Vector4f getEndEmissive() -
getEndEmissiveAlpha
public float getEndEmissiveAlpha() -
setEndEmissive
public void setEndEmissive(@NotNull org.lwjgl.util.vector.Vector4f color) -
setEndEmissive
public void setEndEmissive(float r, float g, float b, float a) -
setEndEmissive
-
setEndEmissiveAlpha
public void setEndEmissiveAlpha(float alpha) -
getStartWidth
public float getStartWidth() -
setStartWidth
public void setStartWidth(float width) -
setStartWidthDirect
public void setStartWidthDirect(float widthHalf) -
getEndWidth
public float getEndWidth() -
setEndWidth
public void setEndWidth(float width) -
setEndWidthDirect
public void setEndWidthDirect(float widthHalf) -
getMixFactor
public float getMixFactor() -
setMixFactor
public void setMixFactor(float factor) -
getTextureSpeed
public float getTextureSpeed() -
setTextureSpeed
public void setTextureSpeed(float textureSpeed) It is working together withCurveEntity.setTexturePixels(float).- Parameters:
textureSpeed- looks flowing forward when less than zero.
-
getTexturePixels
public float getTexturePixels() -
setTexturePixels
public void setTexturePixels(float texturePixels) - Parameters:
texturePixels- texture fill size.
-
isFlowWhenPaused
public boolean isFlowWhenPaused() -
setFlowWhenPaused
public void setFlowWhenPaused(boolean flow) -
getUVOffset
public float getUVOffset() -
setUVOffset
public void setUVOffset(float offset) -
getFillStartAlpha
public float getFillStartAlpha() -
setFillStartAlpha
public void setFillStartAlpha(float alpha) -
getFillEndAlpha
public float getFillEndAlpha() -
setFillEndAlpha
public void setFillEndAlpha(float alpha) -
getFillStartFactor
public float getFillStartFactor() -
setFillStartFactor
public void setFillStartFactor(float factor) -
getFillEndFactor
public float getFillEndFactor() -
setFillEndFactor
public void setFillEndFactor(float factor) -
getJitterPower
public float getJitterPower() -
setJitterPower
public void setJitterPower(float power) perpendicular to trail, effect on trail texture uv. -
isFlick
public boolean isFlick() -
setFlick
public void setFlick(boolean flick) -
isFlickWhenPaused
public boolean isFlickWhenPaused() -
setFlickWhenPaused
public void setFlickWhenPaused(boolean flick) -
getFlickMixValue
public float getFlickMixValue() -
setFlickMixValue
public void setFlickMixValue(float mix) -
getCurrentFlickerSyncValue
public float getCurrentFlickerSyncValue() -
isSyncFlick
public boolean isSyncFlick() -
setSyncFlick
public void setSyncFlick(boolean syncFlick) For each line segments. -
isStripLineMode
public boolean isStripLineMode()- Returns:
truefor default.
-
setStripLineMode
public void setStripLineMode(boolean isStripLine) - Parameters:
isStripLine-falsethat draw dotted line asGL_LINESstyle, elseGL_LINE_STRIPstyle.
-
setFlickerSyncCode
public void setFlickerSyncCode(int code) - Parameters:
code- java instanceObject.hashCode()* 0.00066667f for default.
-
getMaterialData
- Specified by:
getMaterialDatain interfaceMaterialRenderAPI
-
setMaterialData
- Specified by:
setMaterialDatain interfaceMaterialRenderAPI
-
submitEntityData
public void submitEntityData()Description copied from class:BaseRenderDataWithout matrix data or timer settings.- Specified by:
submitEntityDatain interfaceRenderDataAPI- Overrides:
submitEntityDatain classBaseRenderData
-
entityType
- Specified by:
entityTypein interfaceRenderDataAPI- Overrides:
entityTypein classBaseRenderData
-