Skip to content

Commit

Permalink
rename DrawPose -> DrawPoses
Browse files Browse the repository at this point in the history
  • Loading branch information
i-make-robots committed Dec 17, 2023
1 parent 2d0f7ec commit df50f84
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.ArrayList;
import java.util.List;

public class DrawPose implements RenderPass {
public class DrawPoses implements RenderPass {
private int activeStatus = ALWAYS;
private final Mesh waldo = MatrixHelper.createMesh(1.0);

Expand Down Expand Up @@ -45,21 +45,25 @@ public String getName() {
@Override
public void draw(ShaderProgram shader) {
GL3 gl3 = GLContext.getCurrentGL().getGL3();

shader.set1f(gl3,"useVertexColor",1);
shader.set1i(gl3,"useLighting",0);
shader.set1i(gl3,"useTexture",0);
gl3.glDisable(GL3.GL_DEPTH_TEST);

// draw the world pose of every node in the Registry.
List<Node> toScan = new ArrayList<>(Registry.scene.getChildren());
List<Node> toScan = new ArrayList<>();
toScan.add(Registry.scene);
while(!toScan.isEmpty()) {
Node node = toScan.remove(0);
toScan.addAll(node.getChildren());

if(node instanceof Pose pose) {
Matrix4d w = pose.getWorld();
// set modelView to world
Matrix4d w = pose.getWorld();
w.transpose();
shader.setMatrix4d(gl3,"modelView",w);
// draw one MatrixHelper here.
// draw the waldo
waldo.render(gl3);
}
}
Expand Down

0 comments on commit df50f84

Please sign in to comment.