RenderUtils.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:Bookshelf 作者:
/**
 * Gets the camera for a specific entity.
 *
 * @param entity The entity to get the camera for.
 * @param partialTicks The partial ticks for the camera.
 * @return The camera for the entity.
 */
public static Frustum getCamera (Entity entity, float partialTicks) {

    final double cameraX = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks;
    final double cameraY = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks;
    final double cameraZ = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;

    final Frustum camera = new Frustum();
    camera.setPosition(cameraX, cameraY, cameraZ);
    return camera;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号