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

Function lib_common_degrees

src/CommonLibrary.cpp:1052–1073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1050 return bv_variable_create_float(0.0f);
1051 }
1052 bv_variable lib_common_degrees(bv_program* prog, u8 count, bv_variable* args)
1053 {
1054 /* degrees(genType) */
1055 if (count == 1) {
1056 if (args[0].type == bv_type_object) { // degrees(vec3), ...
1057 bv_object* vec = bv_variable_get_object(args[0]);
1058 glm::vec4 vecData = glm::degrees(sd::AsVector<4, float>(args[0]));
1059
1060 bv_variable ret = Common::create_vec(prog, bv_type_float, vec->type->props.name_count);
1061 bv_object* retObj = bv_variable_get_object(ret);
1062
1063 for (u16 i = 0; i < retObj->type->props.name_count; i++)
1064 retObj->prop[i] = bv_variable_create_float(vecData[i]);
1065
1066 return ret;
1067 }
1068 else // degrees(scalar)
1069 return bv_variable_create_float(glm::degrees(bv_variable_get_float(bv_variable_cast(bv_type_float, args[0]))));
1070 }
1071
1072 return bv_variable_create_float(0.0f);
1073 }
1074 bv_variable lib_common_radians(bv_program* prog, u8 count, bv_variable* args)
1075 {
1076 /* radians(genType) */

Callers

nothing calls this directly

Calls 1

create_vecFunction · 0.85

Tested by

no test coverage detected