Package hm.zelha.particlesfx.util
Class LVMath
java.lang.Object
hm.zelha.particlesfx.util.LVMath
location and vector math utils for cleaner code, not meant to be used outside ParticleSFX internals
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.LocationadditionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend) static org.bukkit.LocationadditionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend, boolean causedByCompound) static org.bukkit.util.Vectordivide(org.bukkit.util.Vector vector, double dividend) static doublegetAbsoluteSum(org.bukkit.util.Vector vector) static org.bukkit.util.VectorsubtractToVector(org.bukkit.util.Vector toSet, org.bukkit.Location location, org.bukkit.Location subtrahend) static org.bukkit.util.VectortoVector(org.bukkit.util.Vector vector, org.bukkit.Location location)
-
Method Details
-
getAbsoluteSum
public static double getAbsoluteSum(org.bukkit.util.Vector vector) - Parameters:
vector- vector to get absolute sum from- Returns:
- the sum of the absolute values of the X, Y, and Z of the given vector
-
toVector
public static org.bukkit.util.Vector toVector(org.bukkit.util.Vector vector, org.bukkit.Location location) - Parameters:
vector- vector to copy the given location's info tolocation- the location to copy- Returns:
- the given vector
-
divide
public static org.bukkit.util.Vector divide(org.bukkit.util.Vector vector, double dividend) - Parameters:
vector- vector to dividedividend- number to divide the given vector's X, Y, and Z coordinates by- Returns:
- the given vector, with its coordinates divided by the given dividend or zeroed if the dividend is 0 or not finite.
-
subtractToVector
public static org.bukkit.util.Vector subtractToVector(org.bukkit.util.Vector toSet, org.bukkit.Location location, org.bukkit.Location subtrahend) - Parameters:
toSet- vector to modifylocation- location to be subtracted fromsubtrahend- location to be subtracted- Returns:
- the given vector
-
additionToLocation
public static org.bukkit.Location additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend, boolean causedByCompound) - Parameters:
toSet- location to modifytoAddTo- location to be added toaddend- vector to addcausedByCompound- whether this was caused by aParticleShapeCompound- Returns:
- the location that was modified
-
additionToLocation
public static org.bukkit.Location additionToLocation(org.bukkit.Location toSet, org.bukkit.Location toAddTo, org.bukkit.util.Vector addend) - Parameters:
toSet- location to modifytoAddTo- location to be added toaddend- vector to add- Returns:
- the location that was modified
-