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

Function lib_common_determinant

src/CommonLibrary.cpp:2485–2504  ·  view source on GitHub ↗

matrix */

Source from the content-addressed store, hash-verified

2483
2484 /* matrix */
2485 bv_variable lib_common_determinant(bv_program* prog, u8 count, bv_variable* args)
2486 {
2487 bv_variable ret = bv_variable_create_float(0.0f);
2488
2489 if (count >= 1) {
2490 if (args[0].type == bv_type_object) { // floor(vec3), ...
2491 bv_object* mat = bv_variable_get_object(args[0]);
2492 sd::Matrix* matData = (sd::Matrix*)mat->user_data;
2493
2494 if (matData->Rows == 2)
2495 bv_variable_set_float(&ret, glm::determinant(glm::mat2(matData->Data)));
2496 else if (matData->Rows == 3)
2497 bv_variable_set_float(&ret, glm::determinant(glm::mat3(matData->Data)));
2498 else
2499 bv_variable_set_float(&ret, glm::determinant(matData->Data));
2500 }
2501 }
2502
2503 return ret;
2504 }
2505 bv_variable lib_common_transpose(bv_program* prog, u8 count, bv_variable* args)
2506 {
2507 bv_variable ret = bv_variable_create_void();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected