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


Java RenderQueue类代码示例

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


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

示例1: createScene

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
@NotNull
protected SceneNode createScene() {

    final EditableLightingStateShadowFilter shadowFilter = new EditableLightingStateShadowFilter();
    shadowFilter.setRenderBackFacesShadows(true);
    shadowFilter.setEdgesThickness(7);
    shadowFilter.setEdgeFilteringMode(EdgeFilteringMode.PCF8);

    final SceneNode sceneNode = super.createScene();
    sceneNode.addFilter(new EditableFXAAFilter());
    sceneNode.addFilter(shadowFilter);
    sceneNode.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);

    final EditableLightingSceneAppState lightingState = new EditableLightingSceneAppState();
    lightingState.setTimeOfDay(0.947F);

    final EditableSkySceneAppState skyState = new EditableSkySceneAppState();
    skyState.setFlatShaded(false);
    skyState.init(lightingState.getLightDirRef(), EDITOR.getAssetManager());

    sceneNode.addAppState(lightingState);
    sceneNode.addAppState(skyState);

    return sceneNode;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:27,代码来源:DefaultSceneCreator.java

示例2: handleAddedObject

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
@FXThread
protected void handleAddedObject(@NotNull final Spatial model) {
    super.handleAddedObject(model);

    final ModelEditor3DState editor3DState = getEditor3DState();
    final Array<Geometry> geometries = ArrayFactory.newArray(Geometry.class);

    NodeUtils.addGeometry(model, geometries);

    if (!geometries.isEmpty()) {
        geometries.forEach(geometry -> {
            if (geometry.getQueueBucket() == RenderQueue.Bucket.Sky) {
                editor3DState.addCustomSky(geometry);
            }
        });
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:ModelFileEditor.java

示例3: handleRemovedObject

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
@FXThread
protected void handleRemovedObject(@NotNull final Spatial model) {
    super.handleRemovedObject(model);

    final ModelEditor3DState editor3DState = getEditor3DState();
    final Array<Geometry> geometries = ArrayFactory.newArray(Geometry.class);

    NodeUtils.addGeometry(model, geometries);

    if (!geometries.isEmpty()) {
        geometries.forEach(geometry -> {
            if (geometry.getQueueBucket() == RenderQueue.Bucket.Sky) {
                editor3DState.removeCustomSky(geometry);
            }
        });
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:19,代码来源:ModelFileEditor.java

示例4: notifyFXAddedChild

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
@FXThread
public void notifyFXAddedChild(@NotNull final Object parent, @NotNull final Object added, final int index,
                               final boolean needSelect) {
    super.notifyFXAddedChild(parent, added, index, needSelect);

    final ModelEditor3DState editor3DState = getEditor3DState();

    if (added instanceof Spatial) {

        final Spatial spatial = (Spatial) added;
        final boolean isSky = spatial.getQueueBucket() == RenderQueue.Bucket.Sky;

        if (isSky) {
            editor3DState.addCustomSky(spatial);
            editor3DState.updateLightProbe();
        }
    }

    EXECUTOR_MANAGER.addFXTask(() -> getBulletState().notifyAdded(added));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:22,代码来源:ModelFileEditor.java

示例5: notifyFXRemovedChild

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
@FXThread
public void notifyFXRemovedChild(@NotNull final Object parent, @NotNull final Object removed) {
    super.notifyFXRemovedChild(parent, removed);

    final ModelEditor3DState editor3DState = getEditor3DState();

    if (removed instanceof Spatial) {

        final Spatial spatial = (Spatial) removed;
        final boolean isSky = spatial.getQueueBucket() == RenderQueue.Bucket.Sky;

        if (isSky) {
            editor3DState.removeCustomSky(spatial);
            editor3DState.updateLightProbe();
        }
    }

    EXECUTOR_MANAGER.addFXTask(() -> getBulletState().notifyRemoved(removed));
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:21,代码来源:ModelFileEditor.java

示例6: write

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public void write(JmeExporter ex) throws IOException {
    OutputCapsule capsule = ex.getCapsule(this);
    capsule.write(name, "name", null);
    capsule.write(worldBound, "world_bound", null);
    capsule.write(cullHint, "cull_mode", CullHint.Inherit);
    capsule.write(batchHint, "batch_hint", BatchHint.Inherit);
    capsule.write(queueBucket, "queue", RenderQueue.Bucket.Inherit);
    capsule.write(shadowMode, "shadow_mode", ShadowMode.Inherit);
    capsule.write(localTransform, "transform", Transform.IDENTITY);
    capsule.write(localLights, "lights", null);
    capsule.writeSavableArrayList(new ArrayList(localOverrides), "overrides", null);

    // Shallow clone the controls array to convert its type.
    capsule.writeSavableArrayList(new ArrayList(controls), "controlsList", null);
    capsule.writeStringSavableMap(userData, "user_data", null);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:17,代码来源:Spatial.java

示例7: renderShadow

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
/**
 * If a spatial is not inside the eye frustum, it
 * is still rendered in the shadow frustum (shadow casting queue)
 * through this recursive method.
 */
private void renderShadow(Spatial s, RenderQueue rq) {
    if (s instanceof Node) {
        Node n = (Node) s;
        List<Spatial> children = n.getChildren();
        for (int i = 0; i < children.size(); i++) {
            renderShadow(children.get(i), rq);
        }
    } else if (s instanceof Geometry) {
        Geometry gm = (Geometry) s;

        RenderQueue.ShadowMode shadowMode = s.getShadowMode();
        if (shadowMode != RenderQueue.ShadowMode.Off && shadowMode != RenderQueue.ShadowMode.Receive) {
            //forcing adding to shadow cast mode, culled objects doesn't have to be in the receiver queue
            rq.addToShadowQueue(gm, RenderQueue.ShadowMode.Cast);
        }
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:23,代码来源:RenderManager.java

示例8: read

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public void read(JmeImporter im) throws IOException {
    InputCapsule ic = im.getCapsule(this);

    name = ic.readString("name", null);
    worldBound = (BoundingVolume) ic.readSavable("world_bound", null);
    cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit);
    queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class,
            RenderQueue.Bucket.Inherit);
    shadowMode = ic.readEnum("shadow_mode", ShadowMode.class,
            ShadowMode.Inherit);

    localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY);

    localLights = (LightList) ic.readSavable("lights", null);
    localLights.setOwner(this);

    //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split
    //the AnimControl creates the SkeletonControl for old files and add it to the spatial.
    //The SkeletonControl must be the last in the stack so we add the list of all other control before it.
    //When backward compatibility won't be needed anymore this can be replaced by : 
    //controls = ic.readSavableArrayList("controlsList", null));
    controls.addAll(0, ic.readSavableArrayList("controlsList", null));

    userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:Spatial.java

示例9: postQueue

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public void postQueue(RenderQueue rq) {
        renderSet.clear();
        //tree.generateRenderSet(renderSet, cam);
        fastRoot.generateRenderSet(globalGeoms, renderSet, cam, octBox, true);
//        System.out.println("Geoms: "+renderSet.size());
        int tris = 0;

        for (Geometry geom : renderSet){
            tris += geom.getTriangleCount();
//            geom.setMaterial(mat2);
            rq.addToQueue(geom, geom.getQueueBucket());
        }

//        Matrix4f transform = new Matrix4f();
//        transform.setScale(0.2f, 0.2f, 0.2f);
//        System.out.println("Tris: "+tris);
        
//        tree.renderBounds(rq, transform, box, mat);

//        renderManager.flushQueue(viewPort);
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:22,代码来源:TestOctree.java

示例10: createShape

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
/**
 * Convenience factory method that creates a debuging bounding sphere geometry
 * @param assetManager the assetManager
 * @return the bounding sphere debug geometry.
 */
public static Geometry createShape(AssetManager assetManager) {
    ProbeRadiusShape b = new ProbeRadiusShape();
    Geometry geom = new Geometry("BoundingDebug", b);

    Material mat = new Material(assetManager, "com/jme3/gde/scenecomposer/gizmo/light/mat/dashed/dashed.j3md");        
    mat.getAdditionalRenderState().setWireframe(true);
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    mat.getAdditionalRenderState().setDepthWrite(false);
    mat.getAdditionalRenderState().setDepthTest(false);  
    mat.setFloat("DashSize", 0.5f);
    geom.setQueueBucket(RenderQueue.Bucket.Transparent);
    geom.addControl(new BillboardControl());
    
    
    geom.setMaterial(mat);
    return geom;

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:24,代码来源:ProbeRadiusShape.java

示例11: createShape

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public static Geometry createShape(AssetManager assetManager, String name, int radialSample) {
    RadiusShape b = new RadiusShape(radialSample);
    Geometry geom = new Geometry(name, b);

    Material mat = new Material(assetManager, "com/jme3/gde/scenecomposer/gizmo/mat/dashed/dashed.j3md");
    mat.getAdditionalRenderState().setWireframe(true);
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    mat.getAdditionalRenderState().setDepthWrite(false);
    mat.getAdditionalRenderState().setDepthTest(false);
    mat.getAdditionalRenderState().setLineWidth(2f);

    mat.setColor("Color", ColorRGBA.Orange);
    mat.setFloat("DashSize", 0.5f);
    geom.setQueueBucket(RenderQueue.Bucket.Transparent);

    geom.setMaterial(mat);
    return geom;

}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:RadiusShape.java

示例12: postQueue

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
@Override
    public void postQueue(RenderQueue rq) {
        Camera sceneCam = rm.getCurrentCamera();

        // 如果水体在镜头外就不要渲染,浪费性能。
        FrustumIntersect fi = sceneCam.contains(waterPlane.getWorldBound());
        if (fi != FrustumIntersect.Outside) {
//            LOG.log(Level.INFO, "Need render simple water. FrustumIntersect={0}", fi);
            WaterUtils.updateReflectionCam(reflectionCam, plane, sceneCam);
            rm.renderViewPort(reflectionView, savedTpf);
            rm.getRenderer().setFrameBuffer(vp.getOutputFrameBuffer());
            rm.setCamera(sceneCam, false);
        } 
//        else {
//            LOG.log(Level.INFO, "Don't need render simple water.");
//        }

    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:19,代码来源:VerySimpleWaterProcessor.java

示例13: createSunFlag

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
private Spatial createSunFlag(String icon) {
    Material mat = MaterialUtils.createUnshaded();
    mat.setTexture("ColorMap", Jfx.getJmeApp().getAssetManager().loadTexture(icon));
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    
    Geometry flagObj = new Geometry("DirectionalLightEntitySelectObj", new QuadXYC(1, 1));
    flagObj.setMaterial(mat);
    flagObj.setQueueBucket(RenderQueue.Bucket.Translucent);
    
    // 让flag始终朝向镜头
    BillboardControl bc = new BillboardControl();
    bc.setAlignment(BillboardControl.Alignment.Screen);
    flagObj.addControl(bc);
    
    return flagObj;
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:17,代码来源:PointLightEntityControlTile.java

示例14: RotationAxis

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public RotationAxis() {
    Spatial rotX = createTorus("rotX", AxisObj.AXIS_COLOR_X);
    rotX.rotate(0, FastMath.PI / 2, 0);
    Axis axisX = new Axis(Axis.Type.x);
    axisX.attachChild(rotX);
    axisXNode = new AxisNode(axisX, AxisObj.AXIS_COLOR_X);
    
    Spatial rotY = createTorus("rotY", AxisObj.AXIS_COLOR_Y);
    rotY.rotate(FastMath.PI / 2, 0, 0);
    Axis axisY = new Axis(Axis.Type.y);
    axisY.attachChild(rotY);
    axisYNode = new AxisNode(axisY, AxisObj.AXIS_COLOR_Y);
    
    Spatial rotZ = createTorus("rotZ", AxisObj.AXIS_COLOR_Z);
    Axis axisZ = new Axis(Axis.Type.z);
    axisZ.attachChild(rotZ);
    axisZNode = new AxisNode(axisZ, AxisObj.AXIS_COLOR_Z);
    
    attachChild(axisXNode);
    attachChild(axisYNode);
    attachChild(axisZNode);
    
    setQueueBucket(RenderQueue.Bucket.Translucent);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:25,代码来源:RotationAxis.java

示例15: LocationAxis

import com.jme3.renderer.queue.RenderQueue; //导入依赖的package包/类
public LocationAxis() {
    
    Spatial axisXInner = createAxis("axisXInner", AxisObj.AXIS_COLOR_X);
    axisXInner.rotate(0, 0, -FastMath.PI / 2);
    Axis axisX = new Axis(Axis.Type.x);
    axisX.attachChild(axisXInner);
    axisXNode = new AxisNode(axisX, AxisObj.AXIS_COLOR_X);
    
    Axis axisY = new Axis(Axis.Type.y);
    axisY.attachChild(createAxis("axisYInner", AxisObj.AXIS_COLOR_Y));
    axisYNode = new AxisNode(axisY, AxisObj.AXIS_COLOR_Y);
    
    Spatial axisZInner = createAxis("axisZInner", AxisObj.AXIS_COLOR_Z);
    axisZInner.rotate(FastMath.PI / 2, 0, 0);
    Axis axisZ = new Axis(Axis.Type.z);
    axisZ.attachChild(axisZInner);
    axisZNode = new AxisNode(axisZ, AxisObj.AXIS_COLOR_Z);
    
    attachChild(axisXNode);
    attachChild(axisYNode);
    attachChild(axisZNode);
    
    // 默认放在半透明中桶中,这样可以盖住其它所有物体
    setQueueBucket(RenderQueue.Bucket.Translucent);
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:26,代码来源:LocationAxis.java


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