Skip to content

Instantly share code, notes, and snippets.

@BluSunrize
BluSunrize / Utils.java
Created June 21, 2017 13:13
Java method (using Minecraft vectors) to detect a point in cone
/**
* Checks if point is contained within a cone in 3D space
*
* @param start tip of the cone
* @param normDirection normalized (length==1) vector, direction of cone
* @param radius radius at the end of the cone
* @param length length of the cone
* @param truncationLength optional lenght at which the cone is truncated (flat tip)
* @param relativePoint point to be checked, relative to {@code start}
*/