You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
thebookofshaders/glossary/any/README-ua.md

32 lines
959 B
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## any
Перевіряє чи хоча б один елемент булевого вектора має значення true
### Оголошення
```glsl
bool all(bvec2 x)
bool all(bvec3 x)
bool all(bvec4 x)
```
### Параметри
**```x```** — вектор, який буде перевірено на істинність.
### Опис
**```any()```** повертає **`true`**, якщо будь-який елемент **`x`** має значення **`true`**, інакше повертається **`false`**. Функціонально це еквівалентно до наступного коду:
```glsl
bool any(bvec x) { // bvec може бути bvec2, bvec3 або bvec4
bool result = false;
int i;
for (i = 0; i < x.length(); ++i) {
result |= x[i];
}
return result;
}
```
### Дивіться також
[any()](/glossary/?lan=ua&search=any), [not()](/glossary/?lan=ua&search=not)