Class DefaultBodyRotationController
java.lang.Object
com.ticxo.modelengine.api.nms.impl.DefaultBodyRotationController
- All Implemented Interfaces:
BodyRotationController,DataIO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBaseEntity<?>intfloatfloatfloatfloatfloatintintfloatfloatfloatfloatbooleanbooleanbooleanvoidsetBodyClampUneven(boolean isBodyClampUneven) voidsetHeadClampUneven(boolean isHeadClampUneven) voidsetHeadStableTime(int headStableTime) voidsetLastStableYHeadRot(float lastStableYHeadRot) voidsetMaxBodyAngle(float maxBodyAngle) If body clamp is even, set the max body angle for both sides.
Otherwise, only set the angle on the positive side.voidsetMaxHeadAngle(float maxHeadAngle) If head clamp is even, set the max head angle for both sides.
Otherwise, only set the angle on the positive side.voidsetMinBodyAngle(float minBodyAngle) If body clamp is uneven, set the angle on the negative side.
Otherwise, this method has no effect.voidsetMinHeadAngle(float minHeadAngle) If head clamp is uneven, set the angle on the negative side.
Otherwise, this method has no effect.voidsetPlayerMode(boolean playerMode) Toggle player rotation mode.
If true, the body would act like the player's body rotation.
Otherwise, the body would auto rotate to match the head's rotation after a certain period of time.voidsetRotationDelay(int rotationDelay) Set the wait time before the body auto rotates to match the head's rotation.
For example, if delay = 60, the entity would rotate its head, stop, and wait 3 seconds before rotating its body.voidsetRotationDuration(int rotationDuration) Set the time it takes to auto rotates back to the head's rotation.
For example, if duration = 60, the entity would rotate its head, stop, wait 0.5 second, and takes 3 seconds to match body rotation to the head rotation.voidsetStableAngle(float stableAngle) Set the stable angle before correcting back to the clamped angle.
For example, if the clamp = 50, and the stable angle = 15, the body can be 65 degrees away from the head before snapping back to 50 degrees away.
This causes the "sudden jerk" effect on all entity body rotation.voidsetXHeadRot(float xHeadRot) voidsetYBodyRot(float yBodyRot) voidsetYHeadRot(float yHeadRot) voidtick()Update method that is called every tick only if the entity does not have a body rotation controller by default.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ticxo.modelengine.api.nms.entity.wrapper.BodyRotationController
load, save
-
Constructor Details
-
DefaultBodyRotationController
-
-
Method Details
-
tick
public void tick()Description copied from interface:BodyRotationControllerUpdate method that is called every tick only if the entity does not have a body rotation controller by default.- Specified by:
tickin interfaceBodyRotationController
-
getEntity
-
getXHeadRot
public float getXHeadRot()- Specified by:
getXHeadRotin interfaceBodyRotationController
-
getYHeadRot
public float getYHeadRot()- Specified by:
getYHeadRotin interfaceBodyRotationController
-
getYBodyRot
public float getYBodyRot()- Specified by:
getYBodyRotin interfaceBodyRotationController
-
isHeadClampUneven
public boolean isHeadClampUneven()- Specified by:
isHeadClampUnevenin interfaceBodyRotationController
-
isBodyClampUneven
public boolean isBodyClampUneven()- Specified by:
isBodyClampUnevenin interfaceBodyRotationController
-
getMaxHeadAngle
public float getMaxHeadAngle()- Specified by:
getMaxHeadAnglein interfaceBodyRotationController
-
getMaxBodyAngle
public float getMaxBodyAngle()- Specified by:
getMaxBodyAnglein interfaceBodyRotationController
-
getMinHeadAngle
public float getMinHeadAngle()- Specified by:
getMinHeadAnglein interfaceBodyRotationController
-
getMinBodyAngle
public float getMinBodyAngle()- Specified by:
getMinBodyAnglein interfaceBodyRotationController
-
isPlayerMode
public boolean isPlayerMode()- Specified by:
isPlayerModein interfaceBodyRotationController
-
getStableAngle
public float getStableAngle()- Specified by:
getStableAnglein interfaceBodyRotationController
-
getRotationDelay
public int getRotationDelay()- Specified by:
getRotationDelayin interfaceBodyRotationController
-
getRotationDuration
public int getRotationDuration()- Specified by:
getRotationDurationin interfaceBodyRotationController
-
getHeadStableTime
public int getHeadStableTime() -
getLastStableYHeadRot
public float getLastStableYHeadRot() -
setXHeadRot
public void setXHeadRot(float xHeadRot) - Specified by:
setXHeadRotin interfaceBodyRotationController
-
setYHeadRot
public void setYHeadRot(float yHeadRot) - Specified by:
setYHeadRotin interfaceBodyRotationController
-
setYBodyRot
public void setYBodyRot(float yBodyRot) - Specified by:
setYBodyRotin interfaceBodyRotationController
-
setHeadClampUneven
public void setHeadClampUneven(boolean isHeadClampUneven) - Specified by:
setHeadClampUnevenin interfaceBodyRotationController
-
setBodyClampUneven
public void setBodyClampUneven(boolean isBodyClampUneven) - Specified by:
setBodyClampUnevenin interfaceBodyRotationController
-
setMaxHeadAngle
public void setMaxHeadAngle(float maxHeadAngle) Description copied from interface:BodyRotationControllerIf head clamp is even, set the max head angle for both sides.
Otherwise, only set the angle on the positive side.- Specified by:
setMaxHeadAnglein interfaceBodyRotationController- Parameters:
maxHeadAngle- angle in degrees
-
setMaxBodyAngle
public void setMaxBodyAngle(float maxBodyAngle) Description copied from interface:BodyRotationControllerIf body clamp is even, set the max body angle for both sides.
Otherwise, only set the angle on the positive side.- Specified by:
setMaxBodyAnglein interfaceBodyRotationController- Parameters:
maxBodyAngle- angle in degrees
-
setMinHeadAngle
public void setMinHeadAngle(float minHeadAngle) Description copied from interface:BodyRotationControllerIf head clamp is uneven, set the angle on the negative side.
Otherwise, this method has no effect.- Specified by:
setMinHeadAnglein interfaceBodyRotationController- Parameters:
minHeadAngle- angle in degrees
-
setMinBodyAngle
public void setMinBodyAngle(float minBodyAngle) Description copied from interface:BodyRotationControllerIf body clamp is uneven, set the angle on the negative side.
Otherwise, this method has no effect.- Specified by:
setMinBodyAnglein interfaceBodyRotationController- Parameters:
minBodyAngle- angle in degrees
-
setPlayerMode
public void setPlayerMode(boolean playerMode) Description copied from interface:BodyRotationControllerToggle player rotation mode.
If true, the body would act like the player's body rotation.
Otherwise, the body would auto rotate to match the head's rotation after a certain period of time.- Specified by:
setPlayerModein interfaceBodyRotationController
-
setStableAngle
public void setStableAngle(float stableAngle) Description copied from interface:BodyRotationControllerSet the stable angle before correcting back to the clamped angle.
For example, if the clamp = 50, and the stable angle = 15, the body can be 65 degrees away from the head before snapping back to 50 degrees away.
This causes the "sudden jerk" effect on all entity body rotation.- Specified by:
setStableAnglein interfaceBodyRotationController- Parameters:
stableAngle- angle in degrees
-
setRotationDelay
public void setRotationDelay(int rotationDelay) Description copied from interface:BodyRotationControllerSet the wait time before the body auto rotates to match the head's rotation.
For example, if delay = 60, the entity would rotate its head, stop, and wait 3 seconds before rotating its body.- Specified by:
setRotationDelayin interfaceBodyRotationController- Parameters:
rotationDelay- delay in ticks
-
setRotationDuration
public void setRotationDuration(int rotationDuration) Description copied from interface:BodyRotationControllerSet the time it takes to auto rotates back to the head's rotation.
For example, if duration = 60, the entity would rotate its head, stop, wait 0.5 second, and takes 3 seconds to match body rotation to the head rotation.- Specified by:
setRotationDurationin interfaceBodyRotationController- Parameters:
rotationDuration- duration in ticks.
-
setHeadStableTime
public void setHeadStableTime(int headStableTime) -
setLastStableYHeadRot
public void setLastStableYHeadRot(float lastStableYHeadRot)
-