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


Java ViewPort.getCamera方法代码示例

本文整理汇总了Java中com.jme3.renderer.ViewPort.getCamera方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPort.getCamera方法的具体用法?Java ViewPort.getCamera怎么用?Java ViewPort.getCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.renderer.ViewPort的用法示例。


在下文中一共展示了ViewPort.getCamera方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
public void initialize(RenderManager rm, ViewPort vp) {
    renderManager = rm;
    renderer = rm.getRenderer();
    viewPort = vp;
    fsQuad = new Picture("filter full screen quad");

    Camera cam = vp.getCamera();


    //save view port diensions
    left = cam.getViewPortLeft();
    right = cam.getViewPortRight();
    top = cam.getViewPortTop();
    bottom = cam.getViewPortBottom();
    originalWidth = cam.getWidth();
    originalHeight = cam.getHeight();
    //first call to reshape
    reshape(vp, cam.getWidth(), cam.getHeight());

}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:FilterPostProcessor.java

示例2: renderFromControl

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
/**
 * Callback from Control.render(), do not use.
 * 
 * @param rm
 * @param vp 
 */
private void renderFromControl(RenderManager rm, ViewPort vp) {
    Camera cam = vp.getCamera();

    if (meshType == ParticleMesh.Type.Point) {
        float C = cam.getProjectionMatrix().m00;
        C *= cam.getWidth() * 0.5f;

        // send attenuation params
        this.getMaterial().setFloat("Quadratic", C);
    }

    Matrix3f inverseRotation = Matrix3f.IDENTITY;
    TempVars vars = null;
    if (!worldSpace) {
        vars = TempVars.get();

        inverseRotation = this.getWorldRotation().toRotationMatrix(vars.tempMat3).invertLocal();
    }
    particleMesh.updateParticleData(particles, cam, inverseRotation);
    if (!worldSpace) {
        vars.release();
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:30,代码来源:ParticleEmitter.java

示例3: controlRender

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
protected void controlRender(RenderManager rm, ViewPort vp){
    BoundingVolume bv = spatial.getWorldBound();

    Camera cam = vp.getCamera();
    float atanNH = FastMath.atan(cam.getFrustumNear() * cam.getFrustumTop());
    float ratio = (FastMath.PI / (8f * atanNH));
    float newDistance = bv.distanceTo(vp.getCamera().getLocation()) / ratio;
    int level;

    if (Math.abs(newDistance - lastDistance) <= distTolerance)
        level = lastLevel; // we haven't moved relative to the model, send the old measurement back.
    else if (lastDistance > newDistance && lastLevel == 0)
        level = lastLevel; // we're already at the lowest setting and we just got closer to the model, no need to keep trying.
    else if (lastDistance < newDistance && lastLevel == numLevels - 1)
        level = lastLevel; // we're already at the highest setting and we just got further from the model, no need to keep trying.
    else{
        lastDistance = newDistance;

        // estimate area of polygon via bounding volume
        float area = AreaUtils.calcScreenArea(bv, lastDistance, cam.getWidth());
        float trisToDraw = area * trisPerPixel;
        level = numLevels - 1;
        for (int i = numLevels; --i >= 0;){
            if (trisToDraw - numTris[i] < 0){
                break;
            }
            level = i;
        }
        lastLevel = level;
    }

    spatial.setLodLevel(level);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:34,代码来源:LodControl.java

示例4: controlRender

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
protected void controlRender(RenderManager rm, ViewPort vp) {
    cam = vp.getCamera();
    newDistance = spatial.getWorldBound().getCenter().distance(cam.getLocation());
    int level = Mathz.clamp(  (int) newDistance / 200, 0, numLevels-1 );
    spatial.setLodLevel(level);
}
 
开发者ID:twak,项目名称:chordatlas,代码行数:7,代码来源:GISLodControl.java

示例5: controlRender

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
    Camera cam = vp.getCamera();
    rotateBillboard(cam);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:6,代码来源:BillboardControl.java

示例6: controlRender

import com.jme3.renderer.ViewPort; //导入方法依赖的package包/类
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
    camera = vp.getCamera();
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:5,代码来源:AutoScaleControl.java


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