MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / lib_common_cosh

Function lib_common_cosh

src/CommonLibrary.cpp:942–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940 return bv_variable_create_float(0.0f);
941 }
942 bv_variable lib_common_cosh(bv_program* prog, u8 count, bv_variable* args)
943 {
944 /* cosh(genType) */
945 if (count == 1) {
946 if (args[0].type == bv_type_object) { // cosh(vec3), ...
947 bv_object* vec = bv_variable_get_object(args[0]);
948 glm::vec4 vecData = glm::cosh(sd::AsVector<4, float>(args[0]));
949
950 bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count);
951 bv_object* retObj = bv_variable_get_object(ret);
952
953 for (u16 i = 0; i < retObj->type->props.name_count; i++)
954 retObj->prop[i] = bv_variable_create_float(vecData[i]);
955
956 return ret;
957 }
958 else // cosh(scalar)
959 return bv_variable_create_float(glm::cosh(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0]))));
960 }
961
962 return bv_variable_create_float(0.0f);
963 }
964 bv_variable lib_common_sin(bv_program* prog, u8 count, bv_variable* args)
965 {
966 /* sin(genType) */

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected