Class DrawingContext.Modifier
java.lang.Object
xyz.gmitch215.socketmc.util.render.DrawingContext.Modifier
- All Implemented Interfaces:
Serializable
,Paramaterized
- Enclosing class:
DrawingContext
public static final class DrawingContext.Modifier
extends Object
implements Serializable, Paramaterized
Represents a modifier for a specific
DrawingContext.Command
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull DrawingContext.Modifier
applyNormal
(@NotNull SerializableConsumer<Matrix3f> consumer) Applies a function on the normal for the pose stack.static @NotNull DrawingContext.Modifier
applyPose
(@NotNull SerializableConsumer<Matrix4f> consumer) Applies a function on the pose for the pose stack.int
getId()
Gets the internal identifier for the modifier.Gets an immutable copy of the parameters.static @NotNull DrawingContext.Modifier
rotate
(@NotNull Quaternionf quaternion) Rotates the element on the XYZ axis.static @NotNull DrawingContext.Modifier
Rotates the element on the XYZ axis.static @NotNull DrawingContext.Modifier
rotateAround
(@NotNull Quaternionf quaternion, float x, float y, float z) Rotates the element on the XYZ axis around a specific coordinate.static @NotNull DrawingContext.Modifier
rotateAround
(@NotNull Axis axis, float radians, float x, float y, float z) Rotates the element on the XYZ axis around a specific coordinate.static @NotNull DrawingContext.Modifier
scale
(float x, float y, float z) Scales the element on the XYZ axis.static @NotNull DrawingContext.Modifier
translate
(float x, float y, float z) Translates the element across the XYZ axis.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface xyz.gmitch215.socketmc.util.Paramaterized
booleanParameter, booleanParameter, doubleParameter, doubleParameter, firstBooleanParameter, firstDoubleParameter, firstFloatParameter, firstIntParameter, firstLongParameter, firstParameter, firstParameter, firstStringParameter, floatParameter, floatParameter, getParameters, intParameter, intParameter, lastBooleanParameter, lastDoubleParameter, lastFloatParameter, lastIntParameter, lastLongParameter, lastParameter, lastParameter, lastStringParameter, longParameter, longParameter, parameter, parameter, parameter, stringParameter, stringParameter
-
Method Details
-
scale
@NotNull public static @NotNull DrawingContext.Modifier scale(float x, float y, float z) throws IllegalArgumentException Scales the element on the XYZ axis.- Parameters:
x
- the x-axis scaley
- the y-axis scalez
- the z-axis scale- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the scales are negative
-
translate
Translates the element across the XYZ axis.- Parameters:
x
- the x-axis translationy
- the y-axis translationz
- the z-axis translation- Returns:
- A
DrawingContext.Command
Modifier
-
rotate
@NotNull public static @NotNull DrawingContext.Modifier rotate(@NotNull @NotNull Axis axis, float radians) throws IllegalArgumentException Rotates the element on the XYZ axis.- Parameters:
axis
- the axis to rotate aroundradians
- the amount to rotate by, in radians- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the axis is null
-
rotate
@NotNull public static @NotNull DrawingContext.Modifier rotate(@NotNull @NotNull Quaternionf quaternion) throws IllegalArgumentException Rotates the element on the XYZ axis.- Parameters:
quaternion
- the quaternion to rotate by- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the quaternion is null
-
rotateAround
@NotNull public static @NotNull DrawingContext.Modifier rotateAround(@NotNull @NotNull Axis axis, float radians, float x, float y, float z) throws IllegalArgumentException Rotates the element on the XYZ axis around a specific coordinate.- Parameters:
axis
- the axis to rotate aroundradians
- the amount to rotate by, in radiansx
- the x-coordinate of the rotation originy
- the y-coordinate of the rotation originz
- the z-coordinate of the rotation origin- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the axis is null
-
rotateAround
@NotNull public static @NotNull DrawingContext.Modifier rotateAround(@NotNull @NotNull Quaternionf quaternion, float x, float y, float z) throws IllegalArgumentException Rotates the element on the XYZ axis around a specific coordinate.- Parameters:
quaternion
- the quaternion to rotate byx
- the x-coordinate of the rotation originy
- the y-coordinate of the rotation originz
- the z-coordinate of the rotation origin- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the quaternion is null
-
applyPose
@NotNull public static @NotNull DrawingContext.Modifier applyPose(@NotNull @NotNull SerializableConsumer<Matrix4f> consumer) throws IllegalArgumentException Applies a function on the pose for the pose stack.- Parameters:
consumer
- the consumer to apply the pose- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the consumer is null
-
applyNormal
@NotNull public static @NotNull DrawingContext.Modifier applyNormal(@NotNull @NotNull SerializableConsumer<Matrix3f> consumer) throws IllegalArgumentException Applies a function on the normal for the pose stack.- Parameters:
consumer
- the consumer to apply the pose- Returns:
- A
DrawingContext.Command
Modifier - Throws:
IllegalArgumentException
- if the consumer is null
-
getId
public int getId()Gets the internal identifier for the modifier.- Returns:
- Modifier ID
-
getParameters
Description copied from interface:Paramaterized
Gets an immutable copy of the parameters.- Specified by:
getParameters
in interfaceParamaterized
- Returns:
- Object Parameters
-