当前位置: 首页>>代码示例>>Java>>正文


Java Frustum类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.culling.Frustum的典型用法代码示例。如果您正苦于以下问题:Java Frustum类的具体用法?Java Frustum怎么用?Java Frustum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Frustum类属于net.minecraft.client.renderer.culling包,在下文中一共展示了Frustum类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWorldRender

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onWorldRender (RenderWorldLastEvent event) {
    
    if (icon == null)
        icon = RenderUtils.getParticleTexture(new ItemStack(Blocks.STAINED_GLASS));
        
    final Minecraft mc = Minecraft.getMinecraft();
    final Frustum camera = RenderUtils.getCamera(mc.getRenderViewEntity(), event.getPartialTicks());
    
    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    
    for (final BlockPos pos : BlockHandler.PROTECTED)
        if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(pos)))
            this.renderPingOverlay(pos);
}
 
开发者ID:Darkhax-Minecraft,项目名称:WorldProtect,代码行数:17,代码来源:RenderingHandler.java

示例2: refreshCamera

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
private static void refreshCamera()
{
    Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
    if(entity == null) return;

    float partialTicks = Animation.getPartialTickTime();
    
    ICamera newCam = new Frustum();
    double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks;
    double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks;
    double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks;
    newCam.setPosition(d0, d1, d2);
    cameraX = d0;
    cameraY = d1;
    cameraZ = d2;
    camera = newCam;
}
 
开发者ID:grondag,项目名称:Hard-Science,代码行数:18,代码来源:ClientProxy.java

示例3: getCamera

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static Frustum getCamera (Entity renderEntity, float partialTicks) {
    
    final double cameraX = renderEntity.prevPosX + (renderEntity.posX - renderEntity.prevPosX) * partialTicks;
    final double cameraY = renderEntity.prevPosY + (renderEntity.posY - renderEntity.prevPosY) * partialTicks;
    final double cameraZ = renderEntity.prevPosZ + (renderEntity.posZ - renderEntity.prevPosZ) * partialTicks;
    
    final Frustum camera = new Frustum();
    camera.setPosition(cameraX, cameraY, cameraZ);
    return camera;
}
 
开发者ID:Darkhax-Minecraft,项目名称:WorldProtect,代码行数:12,代码来源:RenderUtils.java

示例4: getFrustum

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
ICamera getFrustum(float partial) {
    // Unfortunately we have to make our own Frustum.
    final Minecraft mc = Minecraft.getMinecraft();
    final Entity eye = mc.getRenderViewEntity();
    double eyeX = eye.lastTickPosX + (eye.posX - eye.lastTickPosX) * (double)partial;
    double eyeY = eye.lastTickPosY + (eye.posY - eye.lastTickPosY) * (double)partial;
    double eyeZ = eye.lastTickPosZ + (eye.posZ - eye.lastTickPosZ) * (double)partial;

    Frustum frustum = new Frustum(); // Notch can't spell
    frustum.setPosition(eyeX, eyeY, eyeZ);
    return frustum;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:13,代码来源:ChainRender.java

示例5: getCamera

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:MMDLib-old,代码行数:16,代码来源:RenderUtils.java

示例6: getCamera

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:Darkhax-Minecraft,项目名称:Bookshelf,代码行数:18,代码来源:RenderUtils.java

示例7: setFrustrumPosition

import net.minecraft.client.renderer.culling.Frustum; //导入依赖的package包/类
public static void setFrustrumPosition(Frustum frustrum, double x, double y, double z)
{
    frustrum.setPosition(x, y, z);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:ShadersRender.java


注:本文中的net.minecraft.client.renderer.culling.Frustum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。