MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / set_ortho_projection

Method set_ortho_projection

src/math/linear_algebra.cpp:187–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void mat4::set_ortho_projection(const float right,
188 const float top,
189 const float near,
190 const float far) {
191 const auto data = this->data();
192
193 data[0] = 1.0f / right;
194 data[5] = -1.0f / top;
195 data[10] = -2.0f / (far - near);
196 data[14] = -(far + near) / (far - near);
197
198 data[1] = data[2] = data[3] = data[4] = 0.0f;
199 data[6] = data[7] = data[8] = data[9] = 0.0f;
200 data[11] = data[12] = data[13] = 0.0f;
201 data[15] = 1.0f;
202}
203
204void mat4::print() const {
205 std::cout << mat_ << std::endl;

Callers 3

window_resizedMethod · 0.80
render_buffer_iconMethod · 0.80
TESTFunction · 0.80

Calls 1

dataMethod · 0.45

Tested by 1

TESTFunction · 0.64