MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / setCamera

Method setCamera

src/main/java/net/optifine/shaders/Shaders.java:4367–4386  ·  view source on GitHub ↗
(float partialTicks)

Source from the content-addressed store, hash-verified

4365 }
4366
4367 public static void setCamera(float partialTicks)
4368 {
4369 Entity entity = mc.getRenderViewEntity();
4370 double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
4371 double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
4372 double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks;
4373 updateCameraOffset(entity);
4374 cameraPositionX = d0 - (double)cameraOffsetX;
4375 cameraPositionY = d1;
4376 cameraPositionZ = d2 - (double)cameraOffsetZ;
4377 GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, (FloatBuffer)projection.position(0));
4378 SMath.invertMat4FBFA((FloatBuffer)projectionInverse.position(0), (FloatBuffer)projection.position(0), faProjectionInverse, faProjection);
4379 projection.position(0);
4380 projectionInverse.position(0);
4381 GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, (FloatBuffer)modelView.position(0));
4382 SMath.invertMat4FBFA((FloatBuffer)modelViewInverse.position(0), (FloatBuffer)modelView.position(0), faModelViewInverse, faModelView);
4383 modelView.position(0);
4384 modelViewInverse.position(0);
4385 checkGLError("setCamera");
4386 }
4387
4388 private static void updateCameraOffset(Entity viewEntity)
4389 {

Callers 1

renderWorldPassMethod · 0.95

Calls 5

updateCameraOffsetMethod · 0.95
invertMat4FBFAMethod · 0.95
checkGLErrorMethod · 0.95
getRenderViewEntityMethod · 0.80
positionMethod · 0.80

Tested by

no test coverage detected