Package org.boxutil.base.api.resource
Interface StaticTrailTracker.Result
- Enclosing interface:
- StaticTrailTracker
public static interface StaticTrailTracker.Result
-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()REQUIRED, call when the target expires or was removed, it waits for all the node to finish playing before performing free, andStaticTrailTracker.advance(float, float, Result)is still running during this time.voidSame asdestroy(), but ignores the current state and directly notifies the system to free, and remove this tracker immediate.bytefloatintbyte[]The color is represented internally as abytearray, therefore recommended to perform read/write operations using thebytetype,intis the next preferred type.org.lwjgl.util.vector.Vector4forg.lwjgl.util.vector.Vector2forg.lwjgl.util.vector.Vector2ffloatAbout current location.floatgetPreviousRecordsDistanceSq(float targetX, float targetY) floatgetPreviousRecordsDistanceSq(org.lwjgl.util.vector.Vector2f targetLocation) org.lwjgl.util.vector.Vector2fShould not change it, just for get the position.booleanThis method is only effective when the trail is destroyed solely viadestroy().booleanCheck the current-previous location distance square whether to should not record.booleanisNotRecommendedRecordsCurrent(float targetX, float targetY) Check the current-previous location distance square whether to should not record.booleanisNotRecommendedRecordsCurrent(org.lwjgl.util.vector.Vector2f targetLocation) Check the current-previous location distance square whether to should not record.voidPrevents node spawn in current frame, and then next records will be a new trail segment.voidsetCurrentAlpha(byte a) voidsetCurrentAlpha(float a) voidsetCurrentAlpha(int a) voidsetCurrentColor(byte r, byte g, byte b, byte a) voidsetCurrentColor(float r, float g, float b, float a) voidsetCurrentColor(int r, int g, int b, int a) voidsetCurrentColor(Color color) voidsetCurrentColor(org.lwjgl.util.vector.Vector4f color) voidsetCurrentFacing(float x, float y) Should be a normalized vector.voidsetCurrentFacing(org.lwjgl.util.vector.Vector2f facingVector) Should be a normalized vector.voidsetCurrentLocation(float x, float y) voidsetCurrentLocation(org.lwjgl.util.vector.Vector2f location)
-
Method Details
-
getPreviousRecordsLocation
org.lwjgl.util.vector.Vector2f getPreviousRecordsLocation() -
getPreviousRecordsDistanceSq
float getPreviousRecordsDistanceSq(float targetX, float targetY) - Returns:
NaNif in the first records or all the nodes was playing finished.
-
getPreviousRecordsDistanceSq
float getPreviousRecordsDistanceSq(org.lwjgl.util.vector.Vector2f targetLocation) - Returns:
NaNif in the first records or all the nodes was playing finished.
-
getPreviousRecordsDistanceSq
float getPreviousRecordsDistanceSq()About current location.- Returns:
NaNif in the first records or all the nodes was playing finished.
-
isNotRecommendedRecordsCurrent
boolean isNotRecommendedRecordsCurrent(float targetX, float targetY) Check the current-previous location distance square whether to should not record. -
isNotRecommendedRecordsCurrent
boolean isNotRecommendedRecordsCurrent(org.lwjgl.util.vector.Vector2f targetLocation) Check the current-previous location distance square whether to should not record. -
isNotRecommendedRecordsCurrent
boolean isNotRecommendedRecordsCurrent()Check the current-previous location distance square whether to should not record.About current location.
-
getCurrentLocation
org.lwjgl.util.vector.Vector2f getCurrentLocation()- Returns:
{1.0f, 0.0f}for default.
-
setCurrentLocation
void setCurrentLocation(float x, float y) -
setCurrentLocation
void setCurrentLocation(org.lwjgl.util.vector.Vector2f location) -
getCurrentFacing
org.lwjgl.util.vector.Vector2f getCurrentFacing() -
setCurrentFacing
void setCurrentFacing(float x, float y) Should be a normalized vector. -
setCurrentFacing
void setCurrentFacing(org.lwjgl.util.vector.Vector2f facingVector) Should be a normalized vector. -
getCurrentColor
byte[] getCurrentColor()The color is represented internally as abytearray, therefore recommended to perform read/write operations using thebytetype,intis the next preferred type.- Returns:
- the direct reference to the internal array in the order
{red, green, blue, alpha}.The default value is opaque white, expressed as
{.BoxEnum.ONE_COLOR,BoxEnum.ONE_COLOR,BoxEnum.ONE_COLOR,BoxEnum.ONE_COLOR}
-
getCurrentColorC
Color getCurrentColorC() -
getCurrentColorV
org.lwjgl.util.vector.Vector4f getCurrentColorV() -
setCurrentColor
void setCurrentColor(byte r, byte g, byte b, byte a) -
setCurrentColor
void setCurrentColor(int r, int g, int b, int a) -
setCurrentColor
void setCurrentColor(float r, float g, float b, float a) -
setCurrentColor
-
setCurrentColor
void setCurrentColor(@NotNull org.lwjgl.util.vector.Vector4f color) -
getCurrentAlpha
byte getCurrentAlpha() -
getCurrentAlphaI
int getCurrentAlphaI() -
getCurrentAlphaF
float getCurrentAlphaF() -
setCurrentAlpha
void setCurrentAlpha(byte a) -
setCurrentAlpha
void setCurrentAlpha(int a) -
setCurrentAlpha
void setCurrentAlpha(float a) -
pauseOnce
void pauseOnce()Prevents node spawn in current frame, and then next records will be a new trail segment.Also can use to 'cut' the trail.
-
destroy
void destroy()REQUIRED, call when the target expires or was removed, it waits for all the node to finish playing before performing free, andStaticTrailTracker.advance(float, float, Result)is still running during this time. -
destroyImmediate
void destroyImmediate()Same asdestroy(), but ignores the current state and directly notifies the system to free, and remove this tracker immediate. -
isExpired
boolean isExpired()This method is only effective when the trail is destroyed solely viadestroy().- Returns:
trueif the trail has entered the destruction process, and the trail memory on vRAM will be released after the trail has completely finished playing.
-