| 849 | return bv_variable_create_float(0.0f); // acos() must have 1 argument! |
| 850 | } |
| 851 | bv_variable lib_common_asin(bv_program* prog, u8 count, bv_variable* args) |
| 852 | { |
| 853 | /* asin(genType) */ |
| 854 | if (count == 1) { |
| 855 | if (args[0].type == bv_type_object) { // asin(vec3), ... |
| 856 | bv_object* vec = bv_variable_get_object(args[0]); |
| 857 | glm::vec4 vecData = glm::asin(sd::AsVector<4, float>(args[0])); // asin takes only float vectors |
| 858 | |
| 859 | bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count); |
| 860 | bv_object* retObj = bv_variable_get_object(ret); |
| 861 | |
| 862 | for (u16 i = 0; i < retObj->type->props.name_count; i++) |
| 863 | retObj->prop[i] = bv_variable_create_float(vecData[i]); |
| 864 | |
| 865 | return ret; |
| 866 | } |
| 867 | else |
| 868 | return bv_variable_create_float(glm::asin(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0])))); |
| 869 | } |
| 870 | |
| 871 | return bv_variable_create_float(0.0f); // asin() must have 1 argument! |
| 872 | } |
| 873 | bv_variable lib_common_atan(bv_program* prog, u8 count, bv_variable* args) |
| 874 | { |
| 875 | /* atan(genType y_over_x) */ |
nothing calls this directly
no test coverage detected