| 2189 | return bv_variable_create_float(0.0f); |
| 2190 | } |
| 2191 | bv_variable lib_common_sqrt(bv_program* prog, u8 count, bv_variable* args) |
| 2192 | { |
| 2193 | /* sqrt(genType) */ |
| 2194 | if (count == 1) { |
| 2195 | if (args[0].type == bv_type_object) { // sqrt(vec3), ... |
| 2196 | bv_object* vec = bv_variable_get_object(args[0]); |
| 2197 | glm::vec4 vecData = glm::sqrt(sd::AsVector<4, float>(args[0])); |
| 2198 | |
| 2199 | bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count); |
| 2200 | bv_object* retObj = bv_variable_get_object(ret); |
| 2201 | |
| 2202 | for (u16 i = 0; i < retObj->type->props.name_count; i++) |
| 2203 | retObj->prop[i] = bv_variable_create_float(vecData[i]); |
| 2204 | |
| 2205 | return ret; |
| 2206 | } |
| 2207 | else // sqrt(scalar) |
| 2208 | return bv_variable_create_float(glm::sqrt(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0])))); |
| 2209 | } |
| 2210 | |
| 2211 | return bv_variable_create_float(0.0f); |
| 2212 | } |
| 2213 | bv_variable lib_common_step(bv_program* prog, u8 count, bv_variable* args) |
| 2214 | { |
| 2215 | /* step(genType, genType), step(float, genType) */ |
nothing calls this directly
no test coverage detected