MCPcopy Index your code
hub / github.com/benfry/processing4 / setSize

Method setSize

core/src/processing/opengl/PGraphicsOpenGL.java:639–666  ·  view source on GitHub ↗
(int iwidth, int iheight)

Source from the content-addressed store, hash-verified

637
638
639 @Override
640 public void setSize(int iwidth, int iheight) {
641 width = iwidth;
642 height = iheight;
643 updatePixelSize();
644
645 texture = null;
646 ptexture = null;
647
648 // init perspective projection based on new dimensions
649 defCameraFOV = 60 * DEG_TO_RAD; // at least for now
650 defCameraX = width / 2.0f;
651 defCameraY = height / 2.0f;
652 defCameraZ = defCameraY / ((float) Math.tan(defCameraFOV / 2.0f));
653 defCameraNear = defCameraZ / 10.0f;
654 defCameraFar = defCameraZ * 10.0f;
655 defCameraAspect = (float) width / (float) height;
656
657 cameraFOV = defCameraFOV;
658 cameraX = defCameraX;
659 cameraY = defCameraY;
660 cameraZ = defCameraZ;
661 cameraNear = defCameraNear;
662 cameraFar = defCameraFar;
663 cameraAspect = defCameraAspect;
664
665 sized = true;
666 }
667
668
669 @Override

Callers

nothing calls this directly

Calls 2

updatePixelSizeMethod · 0.95
tanMethod · 0.45

Tested by

no test coverage detected