Exemplo n.º 1
0
        public double determineYaw(Location target, double offset = 90)
        {
            double dX  = this.getDistanceX(target);
            double dZ  = this.getDistanceZ(target);
            double yaw = Math.Atan2(dZ, dX);

            yaw = (-MathUtils.toDegrees(yaw)) + offset;
            if (this.getOwner() != null && this.getOwner().getParent() != null)
            {
                Location pAbs = this.getOwner().getParent().getLocation().getAbsoluteLocation();
                yaw -= pAbs.getYaw();
                pAbs.Dispose();
            }
            return(yaw);
        }