MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / invert

Method invert

core/math/basis.cpp:47–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 (rows[row1][col1] * rows[row2][col2] - rows[row1][col2] * rows[row2][col1])
46
47void Basis::invert() {
48 real_t co[3] = {
49 cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1)
50 };
51 real_t det = rows[0][0] * co[0] +
52 rows[0][1] * co[1] +
53 rows[0][2] * co[2];
54#ifdef MATH_CHECKS
55 ERR_FAIL_COND(det == 0);
56#endif
57 real_t s = 1.0f / det;
58
59 set(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
60 co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
61 co[2] * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
62}
63
64void Basis::orthonormalize() {
65 Vector3 x = get_column(0);

Callers 10

CSGShape3DGizmoPluginMethod · 0.45
inverseMethod · 0.45
_draw_skyMethod · 0.45
make_mesh_previewsMethod · 0.45
redrawMethod · 0.45
test_projection.hFile · 0.45
update_res_buffersMethod · 0.45
draw_skyMethod · 0.45

Calls 1

setFunction · 0.50

Tested by

no test coverage detected