MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / render

Method render

testbed/common/Line.cpp:43–66  ·  view source on GitHub ↗

Render the sphere at the correct position and with the correct orientation

Source from the content-addressed store, hash-verified

41
42// Render the sphere at the correct position and with the correct orientation
43void Line::render(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix) {
44
45 // Bind the shader
46 shader.bind();
47
48 // Set the model to camera matrix
49 shader.setMatrix4x4Uniform("localToWorldMatrix", openglframework::Matrix4::identity());
50 shader.setMatrix4x4Uniform("worldToCameraMatrix", worldToCameraMatrix);
51
52 // Set the vertex color
53 openglframework::Vector4 color(1, 0, 0, 1);
54 shader.setIntUniform("isGlobalVertexColorEnabled", 1, false);
55 shader.setVector4Uniform("globalVertexColor", color, false);
56
57 /*
58 glBegin(GL_LINES);
59 glVertex3f(mWorldPoint1.x, mWorldPoint1.y, mWorldPoint1.z);
60 glVertex3f(mWorldPoint2.x, mWorldPoint2.y, mWorldPoint2.z);
61 glEnd();
62 */
63
64 // Unbind the shader
65 shader.unbind();
66}

Callers

nothing calls this directly

Calls 5

setMatrix4x4UniformMethod · 0.80
setIntUniformMethod · 0.80
setVector4UniformMethod · 0.80
bindMethod · 0.45
unbindMethod · 0.45

Tested by

no test coverage detected