MCPcopy Index your code
hub / github.com/PaperMC/Paper / rotateAroundAxis

Method rotateAroundAxis

paper-api/src/main/java/org/bukkit/util/Vector.java:518–523  ·  view source on GitHub ↗

Rotates the vector around a given arbitrary axis in 3 dimensional space. Rotation will follow the general Right-Hand-Rule, which means rotation will be counterclockwise when the axis is pointing towards the observer. This method will always make sure the provided axis is a unit vector, to n

(@NotNull Vector axis, double angle)

Source from the content-addressed store, hash-verified

516 * null
517 */
518 @NotNull
519 public Vector rotateAroundAxis(@NotNull Vector axis, double angle) throws IllegalArgumentException {
520 Preconditions.checkArgument(axis != null, "The provided axis vector was null");
521
522 return rotateAroundNonUnitAxis(axis.isNormalized() ? axis : axis.clone().normalize(), angle);
523 }
524
525 /**
526 * Rotates the vector around a given arbitrary axis in 3 dimensional space.

Callers 4

testNullVectorAxisMethod · 0.80
testResizeAxisMethod · 0.80

Calls 4

isNormalizedMethod · 0.80
normalizeMethod · 0.80
cloneMethod · 0.65

Tested by 4

testNullVectorAxisMethod · 0.64
testResizeAxisMethod · 0.64