- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- COLOR_BLACK
- COLOR_WHITE
- COLOR_RED
- COLOR_LIME
- COLOR_BLUE
- COLOR_YELLOW
- COLOR_CYAN
- COLOR_MAGENTA
- COLOR_SILVER
- COLOR_GRAY
- COLOR_MAROON
- COLOR_OLIVE
- COLOR_GREEN
- COLOR_PURPLE
- COLOR_TEAL
- COLOR_NAVY
- INDEXED_COLORS
- INDEXED_COLOR_NAMES
- DISPLAY_FORCES
- DEFAULT_OPACITY
- FLAG_NONE
- FLAG_FADE
- FLAG_NO_WIREFRAME
- FLAG_NO_SOLID
- Constructor Details
- Method Details
- add(World, DebugShape, Matrix4dc, Vector3fc, float, int)
- add(World, DebugShape, Matrix4dc, Vector3fc, float, float, int)
- addFrustum(World, Matrix4dc, Matrix4dc, Vector3fc, float, int)
- clear(World)
- addArrow(World, Matrix4dc, Vector3fc, float, double, float, int)
- addArrow(World, Matrix4dc, Vector3fc, double, float, int)
- addSphere(World, Vector3dc, Vector3fc, double, float)
- addSphere(World, double, double, double, Vector3fc, double, float)
- addSphere(World, Vector3dc, Vector3fc, float, double, float)
- addSphere(World, double, double, double, Vector3fc, float, double, float)
- addCone(World, Vector3dc, Vector3fc, double, float)
- addCube(World, Vector3dc, Vector3fc, double, float)
- addCube(World, double, double, double, Vector3fc, double, float)
- addCylinder(World, Vector3dc, Vector3fc, double, float)
- addCylinder(World, Vector3dc, Vector3fc, double, double, float)
- addLine(World, Vector3dc, Vector3dc, Vector3fc, double, float, int)
- addLine(World, double, double, double, double, double, double, Vector3fc, double, float, int)
- addDisc(World, Matrix4dc, double, double, Vector3fc, float, int, float, int)
- addDisc(World, Matrix4dc, double, double, Vector3fc, float, float, int)
- addDisc(World, Vector3dc, double, Vector3fc, float, int)
- addDisc(World, double, double, double, double, Vector3fc, float, int)
- addDisc(World, double, double, double, double, Vector3fc, float, float, int)
- addDisc(World, double, double, double, double, double, Vector3fc, float, float, int)
- addDisc(World, double, double, double, double, double, Vector3fc, float, int, float, int)
- addDonut(World, double, double, double, double, double, double, double, double, Vector3fc, float, int, float, int)
- addDonut(World, double, double, double, double, double, double, double, double, Vector3fc, float, float, int)
- addSector(World, double, double, double, double, double, double, Vector3fc, float, int)
- addSector(World, double, double, double, double, double, double, Vector3fc, float, float, int)
- addSector(World, double, double, double, double, double, double, double, Vector3fc, float, float, int)
- addSector(World, double, double, double, double, double, double, double, Vector3fc, float, int, float, int)
- addArrow(World, Vector3dc, Vector3dc, Vector3fc, float, float, int)
- addArrow(World, Vector3dc, Vector3dc, Vector3fc, float, int)
- addVelocity(World, Vector3dc, Vector3dc, VelocityConfig)
- makeMatrix(Vector3dc, double)
Class DebugUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.joml.Vector3fPredefined color for debug shapes From Basic colorsstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final org.joml.Vector3fPredefined color for debug shapessee COLOR_BLACKstatic final floatDefault opacity for debug shapes.static booleanWhether force debug shapes should be displayed.static final intstatic final intstatic final intstatic final intstatic final String[]Human-readable names corresponding toINDEXED_COLORS.static final org.joml.Vector3f[]Array of distinct colors for indexed debug visualization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(World world, DebugShape shape, org.joml.Matrix4dc matrix, org.joml.Vector3fc color, float opacity, float time, int flags) Displays the given debug shape to all players in the world with custom opacity.static voidadd(World world, DebugShape shape, org.joml.Matrix4dc matrix, org.joml.Vector3fc color, float time, int flags) Displays the given debug shape to all players in the world.static voidaddArrow(World world, org.joml.Matrix4dc baseMatrix, org.joml.Vector3fc color, double length, float time, int flags) Adds an arrow debug shape to the world using a transformation matrix.static voidaddArrow(World world, org.joml.Matrix4dc baseMatrix, org.joml.Vector3fc color, float opacity, double length, float time, int flags) Adds an arrow debug shape to the world using a transformation matrix.static voidaddArrow(World world, org.joml.Vector3dc position, org.joml.Vector3dc direction, org.joml.Vector3fc color, float opacity, float time, int flags) Adds an arrow debug shape to the world pointing in a specific direction.static voidaddArrow(World world, org.joml.Vector3dc position, org.joml.Vector3dc direction, org.joml.Vector3fc color, float time, int flags) Adds an arrow debug shape to the world pointing in a specific direction.static voidAdds a cone debug shape to the world at the specified position.static voidaddCube(World world, double x, double y, double z, org.joml.Vector3fc color, double scale, float time) Adds a cube debug shape to the world at the specified position.static voidAdds a cube debug shape to the world at the specified position.static voidaddCylinder(World world, org.joml.Vector3dc pos, org.joml.Vector3fc color, double diameter, double height, float time) Adds a cylinder debug shape to the world at the specified position.static voidaddCylinder(World world, org.joml.Vector3dc pos, org.joml.Vector3fc color, double scale, float time) Adds a cylinder debug shape to the world at the specified position.static voidaddDisc(World world, double x, double y, double z, double outerRadius, double innerRadius, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape at the specified position with inner radius and custom opacity.static voidaddDisc(World world, double x, double y, double z, double outerRadius, double innerRadius, org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a disc debug shape at the specified position with full parameters.static voidaddDisc(World world, double x, double y, double z, double radius, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape at the specified position with custom opacity.static voidaddDisc(World world, double x, double y, double z, double radius, org.joml.Vector3fc color, float time, int flags) Adds a disc debug shape at the specified position.static voidaddDisc(World world, org.joml.Matrix4dc matrix, double outerRadius, double innerRadius, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape using a transformation matrix with default segment count.static voidaddDisc(World world, org.joml.Matrix4dc matrix, double outerRadius, double innerRadius, org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a disc debug shape using a transformation matrix.static voidaddDisc(World world, org.joml.Vector3dc center, double radius, org.joml.Vector3fc color, float time, int flags) Adds a disc debug shape at the specified position.static voidaddDonut(World world, double x, double y, double z, double outerRadius, double innerRadius, double height, double heading, double angle, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a donut (annular cylinder) debug shape at the specified position with a default segment count.static voidaddDonut(World world, double x, double y, double z, double outerRadius, double innerRadius, double height, double heading, double angle, org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a donut (annular cylinder) debug shape at the specified position.static voidaddFrustum(World world, org.joml.Matrix4dc matrix, org.joml.Matrix4dc frustumProjection, org.joml.Vector3fc color, float time, int flags) Displays a frustum debug shape to all players in the world.static voidaddLine(World world, double startX, double startY, double startZ, double endX, double endY, double endZ, org.joml.Vector3fc color, double thickness, float time, int flags) Adds a line debug shape between two points in the world.static voidaddLine(World world, org.joml.Vector3dc start, org.joml.Vector3dc end, org.joml.Vector3fc color, double thickness, float time, int flags) Adds a line debug shape between two points in the world.static voidaddSector(World world, double x, double y, double z, double heading, double outerRadius, double angle, double innerRadius, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a sector (wedge) debug shape at the specified position with inner radius and custom opacity.static voidaddSector(World world, double x, double y, double z, double heading, double outerRadius, double angle, double innerRadius, org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a sector (wedge) debug shape at the specified position.static voidaddSector(World world, double x, double y, double z, double heading, double radius, double angle, org.joml.Vector3fc color, float opacity, float time, int flags) Adds a sector (wedge) debug shape at the specified position with custom opacity.static voidaddSector(World world, double x, double y, double z, double heading, double radius, double angle, org.joml.Vector3fc color, float time, int flags) Adds a sector (wedge) debug shape at the specified position.static voidaddSphere(World world, double x, double y, double z, org.joml.Vector3fc color, double scale, float time) Adds a sphere debug shape to the world at the specified position.static voidaddSphere(World world, double x, double y, double z, org.joml.Vector3fc color, float opacity, double scale, float time) Adds a sphere debug shape to the world at the specified position.static voidAdds a sphere debug shape to the world at the specified position.static voidaddSphere(World world, org.joml.Vector3dc pos, org.joml.Vector3fc color, float opacity, double scale, float time) Adds a sphere debug shape to the world at the specified position with custom opacity.static voidaddVelocity(World world, org.joml.Vector3dc position, org.joml.Vector3dc velocity, VelocityConfig velocityConfig) Adds a force visualization arrow to the world.static voidClears all debug shapes for all players in the world.static org.joml.Matrix4dmakeMatrix(org.joml.Vector3dc pos, double scale) Creates a transformation matrix for positioning and scaling a debug shape.
-
Field Details
-
COLOR_BLACK
public static final org.joml.Vector3f COLOR_BLACKPredefined color for debug shapes From Basic colors -
COLOR_WHITE
public static final org.joml.Vector3f COLOR_WHITEPredefined color for debug shapessee COLOR_BLACK -
COLOR_RED
public static final org.joml.Vector3f COLOR_REDPredefined color for debug shapessee COLOR_BLACK -
COLOR_LIME
public static final org.joml.Vector3f COLOR_LIMEPredefined color for debug shapessee COLOR_BLACK -
COLOR_BLUE
public static final org.joml.Vector3f COLOR_BLUEPredefined color for debug shapessee COLOR_BLACK -
COLOR_YELLOW
public static final org.joml.Vector3f COLOR_YELLOWPredefined color for debug shapessee COLOR_BLACK -
COLOR_CYAN
public static final org.joml.Vector3f COLOR_CYANPredefined color for debug shapessee COLOR_BLACK -
COLOR_MAGENTA
public static final org.joml.Vector3f COLOR_MAGENTAPredefined color for debug shapessee COLOR_BLACK -
COLOR_SILVER
public static final org.joml.Vector3f COLOR_SILVERPredefined color for debug shapessee COLOR_BLACK -
COLOR_GRAY
public static final org.joml.Vector3f COLOR_GRAYPredefined color for debug shapessee COLOR_BLACK -
COLOR_MAROON
public static final org.joml.Vector3f COLOR_MAROONPredefined color for debug shapessee COLOR_BLACK -
COLOR_OLIVE
public static final org.joml.Vector3f COLOR_OLIVEPredefined color for debug shapessee COLOR_BLACK -
COLOR_GREEN
public static final org.joml.Vector3f COLOR_GREENPredefined color for debug shapessee COLOR_BLACK -
COLOR_PURPLE
public static final org.joml.Vector3f COLOR_PURPLEPredefined color for debug shapessee COLOR_BLACK -
COLOR_TEAL
public static final org.joml.Vector3f COLOR_TEALPredefined color for debug shapessee COLOR_BLACK -
COLOR_NAVY
public static final org.joml.Vector3f COLOR_NAVYPredefined color for debug shapessee COLOR_BLACK -
INDEXED_COLORS
public static final org.joml.Vector3f[] INDEXED_COLORSArray of distinct colors for indexed debug visualization. Colors are selected to be easily distinguishable from each other. -
INDEXED_COLOR_NAMES
Human-readable names corresponding toINDEXED_COLORS. -
DISPLAY_FORCES
public static boolean DISPLAY_FORCESWhether force debug shapes should be displayed.When enabled, force vectors will be visualized as arrows in the world. This can be toggled via the
/debug shape showforcecommand. -
DEFAULT_OPACITY
public static final float DEFAULT_OPACITYDefault opacity for debug shapes.- See Also:
-
FLAG_NONE
public static final int FLAG_NONE- See Also:
-
FLAG_FADE
public static final int FLAG_FADE- See Also:
-
FLAG_NO_WIREFRAME
public static final int FLAG_NO_WIREFRAME- See Also:
-
FLAG_NO_SOLID
public static final int FLAG_NO_SOLID- See Also:
-
-
Constructor Details
-
DebugUtils
public DebugUtils()
-
-
Method Details
-
add
public static void add(@Nonnull World world, @Nonnull DebugShape shape, @Nonnull org.joml.Matrix4dc matrix, @Nonnull org.joml.Vector3fc color, float time, int flags) Displays the given debug shape to all players in the world.If fade is set then the shape's opacity will change over time until it is removed.
If used off the world thread this will move the execution on to the world automatically.
- Parameters:
world- The world to spawn the shape in.shape- The shape to spawn.matrix- The matrix used to position, scale and rotate the shape.color- The color of the shape.time- How long the shape should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
add
public static void add(@Nonnull World world, @Nonnull DebugShape shape, @Nonnull org.joml.Matrix4dc matrix, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Displays the given debug shape to all players in the world with custom opacity.- Parameters:
world- The world to spawn the shape in.shape- The shape to spawn.matrix- The matrix used to position, scale and rotate the shape.color- The color of the shape.opacity- The opacity of the shape (0.0-1.0).time- How long the shape should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addFrustum
public static void addFrustum(@Nonnull World world, @Nonnull org.joml.Matrix4dc matrix, @Nonnull org.joml.Matrix4dc frustumProjection, @Nonnull org.joml.Vector3fc color, float time, int flags) Displays a frustum debug shape to all players in the world.- Parameters:
world- The world to spawn the frustum in.matrix- The matrix used to position, scale and rotate the frustum.frustumProjection- The projection matrix defining the frustum shape.color- The color of the frustum.time- The time, in seconds, the frustum should exist for.flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
clear
Clears all debug shapes for all players in the world.This method sends a clear packet to all players in the specified entity store, which will remove all currently displayed debug shapes on their clients.
- Parameters:
world- The entity store containing the players to clear debug shapes for.
-
addArrow
public static void addArrow(@Nonnull World world, @Nonnull org.joml.Matrix4dc baseMatrix, @Nonnull org.joml.Vector3fc color, float opacity, double length, float time, int flags) Adds an arrow debug shape to the world using a transformation matrix.The arrow consists of a cylinder (shaft) and a cone (head) positioned and rotated according to the provided matrix.
- Parameters:
world- The world to add the arrow to.baseMatrix- The base matrix to position and rotate the arrow.color- The color of the arrow.opacity- The opacity of the arrow (0.0-1.0).length- The length of the arrow.time- The time the arrow should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addArrow
public static void addArrow(@Nonnull World world, @Nonnull org.joml.Matrix4dc baseMatrix, @Nonnull org.joml.Vector3fc color, double length, float time, int flags) Adds an arrow debug shape to the world using a transformation matrix. -
addSphere
public static void addSphere(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a sphere debug shape to the world at the specified position.- Parameters:
world- The world to add the sphere to.pos- The position of the sphere.color- The color of the sphere.scale- The scale of the sphere (applied uniformly to all axes).time- The time the sphere should exist for (in seconds).
-
addSphere
public static void addSphere(@Nonnull World world, double x, double y, double z, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a sphere debug shape to the world at the specified position. -
addSphere
public static void addSphere(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, float opacity, double scale, float time) Adds a sphere debug shape to the world at the specified position with custom opacity.- Parameters:
world- The world to add the sphere to.pos- The position of the sphere.color- The color of the sphere.opacity- The opacity of the sphere (0.0-1.0).scale- The scale of the sphere (applied uniformly to all axes).time- The time the sphere should exist for (in seconds).
-
addSphere
public static void addSphere(@Nonnull World world, double x, double y, double z, @Nonnull org.joml.Vector3fc color, float opacity, double scale, float time) Adds a sphere debug shape to the world at the specified position. -
addCone
public static void addCone(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a cone debug shape to the world at the specified position.- Parameters:
world- The world to add the cone to.pos- The position of the cone.color- The color of the cone.scale- The scale of the cone (applied uniformly to all axes).time- The time the cone should exist for (in seconds).
-
addCube
public static void addCube(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a cube debug shape to the world at the specified position.- Parameters:
world- The world to add the cube to.pos- The position of the cube.color- The color of the cube.scale- The scale of the cube (applied uniformly to all axes).time- The time the cube should exist for (in seconds).
-
addCube
public static void addCube(@Nonnull World world, double x, double y, double z, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a cube debug shape to the world at the specified position. -
addCylinder
public static void addCylinder(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, double scale, float time) Adds a cylinder debug shape to the world at the specified position.- Parameters:
world- The world to add the cylinder to.pos- The position of the cylinder.color- The color of the cylinder.scale- The scale of the cylinder (applied uniformly to all axes).time- The time the cylinder should exist for (in seconds).
-
addCylinder
public static void addCylinder(@Nonnull World world, @Nonnull org.joml.Vector3dc pos, @Nonnull org.joml.Vector3fc color, double diameter, double height, float time) Adds a cylinder debug shape to the world at the specified position.- Parameters:
world- The world to add the cylinder to.pos- The position of the cylinder.color- The color of the cylinder.diameter- The diameter of the cylinder (applied to X and Z).height- The height of the cylinder (applied to Y).time- The time the cylinder should exist for (in seconds).
-
addLine
public static void addLine(@Nonnull World world, @Nonnull org.joml.Vector3dc start, @Nonnull org.joml.Vector3dc end, @Nonnull org.joml.Vector3fc color, double thickness, float time, int flags) Adds a line debug shape between two points in the world.- Parameters:
world- The world to add the line to.start- The start position of the line.end- The end position of the line.color- The color of the line.thickness- The thickness (diameter) of the line.time- The time the line should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addLine
public static void addLine(@Nonnull World world, double startX, double startY, double startZ, double endX, double endY, double endZ, @Nonnull org.joml.Vector3fc color, double thickness, float time, int flags) Adds a line debug shape between two points in the world. -
addDisc
public static void addDisc(@Nonnull World world, @Nonnull org.joml.Matrix4dc matrix, double outerRadius, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a disc debug shape using a transformation matrix.This is the primary disc method. The matrix defines the position and orientation of the disc. If
innerRadiusis greater than 0, a ring (annulus) shape is created.- Parameters:
world- The world to add the disc to.matrix- The transformation matrix (translation and rotation).outerRadius- The outer radius of the disc.innerRadius- The inner radius of the disc (0 for solid disc).color- The color of the disc.opacity- The opacity of the disc (0.0-1.0).segmentCount- The number of segments for the disc edge (higher = smoother).time- The time the disc should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addDisc
public static void addDisc(@Nonnull World world, @Nonnull org.joml.Matrix4dc matrix, double outerRadius, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape using a transformation matrix with default segment count. -
addDisc
public static void addDisc(@Nonnull World world, @Nonnull org.joml.Vector3dc center, double radius, @Nonnull org.joml.Vector3fc color, float time, int flags) Adds a disc debug shape at the specified position. -
addDisc
public static void addDisc(@Nonnull World world, double x, double y, double z, double radius, @Nonnull org.joml.Vector3fc color, float time, int flags) Adds a disc debug shape at the specified position. -
addDisc
public static void addDisc(@Nonnull World world, double x, double y, double z, double radius, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape at the specified position with custom opacity. -
addDisc
public static void addDisc(@Nonnull World world, double x, double y, double z, double outerRadius, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a disc debug shape at the specified position with inner radius and custom opacity. -
addDisc
public static void addDisc(@Nonnull World world, double x, double y, double z, double outerRadius, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a disc debug shape at the specified position with full parameters. -
addDonut
public static void addDonut(@Nonnull World world, double x, double y, double z, double outerRadius, double innerRadius, double height, double heading, double angle, @Nonnull org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a donut (annular cylinder) debug shape at the specified position.The donut is a ring with vertical walls: an annulus of the given inner and outer radius, extruded upwards from
ybyheight. Ifangleis less than a full circle, only an arc of the ring is drawn, centered on theheadingdirection.- Parameters:
world- The world to add the donut to.x- The x position of the donut center.y- The y position of the donut base.z- The z position of the donut center.outerRadius- The outer radius of the donut.innerRadius- The inner radius of the donut (the size of the hole).height- The vertical height the donut extends up fromy.heading- The direction (in radians) the arc is centered on (0 = +Z), ignored for a full circle.angle- The angular size of the arc in radians (>= 2*PIdraws a full ring).color- The color of the donut.opacity- The opacity of the donut (0.0-1.0).segmentCount- The number of segments around the ring (higher = smoother).time- The time the donut should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addDonut
public static void addDonut(@Nonnull World world, double x, double y, double z, double outerRadius, double innerRadius, double height, double heading, double angle, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a donut (annular cylinder) debug shape at the specified position with a default segment count. -
addSector
public static void addSector(@Nonnull World world, double x, double y, double z, double heading, double radius, double angle, @Nonnull org.joml.Vector3fc color, float time, int flags) Adds a sector (wedge) debug shape at the specified position. -
addSector
public static void addSector(@Nonnull World world, double x, double y, double z, double heading, double radius, double angle, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a sector (wedge) debug shape at the specified position with custom opacity. -
addSector
public static void addSector(@Nonnull World world, double x, double y, double z, double heading, double outerRadius, double angle, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds a sector (wedge) debug shape at the specified position with inner radius and custom opacity. -
addSector
public static void addSector(@Nonnull World world, double x, double y, double z, double heading, double outerRadius, double angle, double innerRadius, @Nonnull org.joml.Vector3fc color, float opacity, int segmentCount, float time, int flags) Adds a sector (wedge) debug shape at the specified position.The sector is a pie-slice shape extending from the center point. If
innerRadiusis greater than 0, a ring sector (arc) shape is created with the center portion removed.- Parameters:
world- The world to add the sector to.x- The x position of the sector center.y- The y position of the sector center.z- The z position of the sector center.heading- The heading direction in radians (0 = +Z, PI/2 = +X).outerRadius- The outer radius of the sector.angle- The full angle of the sector in radians.innerRadius- The inner radius (0 for solid sector, >0 for ring sector).color- The color of the sector.opacity- The opacity of the sector (0.0-1.0).segmentCount- The number of segments for the arc (higher = smoother).time- The time the sector should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addArrow
public static void addArrow(@Nonnull World world, @Nonnull org.joml.Vector3dc position, @Nonnull org.joml.Vector3dc direction, @Nonnull org.joml.Vector3fc color, float opacity, float time, int flags) Adds an arrow debug shape to the world pointing in a specific direction.The arrow is positioned at the given position and oriented to point in the direction vector. The length of the arrow is determined by the magnitude of the direction vector.
- Parameters:
world- The world to add the arrow to.position- The position where the arrow starts.direction- The direction vector the arrow should point in (the length determines arrow length).color- The color of the arrow.opacity- The opacity of the arrow (0.0-1.0).time- The time the arrow should exist for (in seconds).flags- Flags controlling shape rendering (seeFLAG_FADE,FLAG_NO_WIREFRAME,FLAG_NO_SOLID).
-
addArrow
public static void addArrow(@Nonnull World world, @Nonnull org.joml.Vector3dc position, @Nonnull org.joml.Vector3dc direction, @Nonnull org.joml.Vector3fc color, float time, int flags) Adds an arrow debug shape to the world pointing in a specific direction. -
addVelocity
public static void addVelocity(@Nonnull World world, @Nonnull org.joml.Vector3dc position, @Nonnull org.joml.Vector3dc velocity, @Nullable VelocityConfig velocityConfig) Adds a force visualization arrow to the world.This method only displays the velocity if
DISPLAY_FORCESis enabled. The velocity vector is adjusted based on the velocity configuration and player knockback scale. The arrow color is randomly generated for each velocity visualization.- Parameters:
world- The world to add the velocity visualization to.position- The position where the velocity is applied.velocity- The velocity vector to visualize.velocityConfig- The velocity configuration, used to determine if velocity scaling should be applied. May be null.
-
makeMatrix
@Nonnull public static org.joml.Matrix4d makeMatrix(@Nonnull org.joml.Vector3dc pos, double scale) Creates a transformation matrix for positioning and scaling a debug shape.- Parameters:
pos- The position to translate to.scale- The uniform scale to apply.- Returns:
- A new transformation matrix with the specified translation and scale.
-