com.jme3.scene.Geometry.setQueueBucket()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中com.jme3.scene.Geometry.setQueueBucket()方法的一些代码示例,展示了Geometry.setQueueBucket()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.setQueueBucket()方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:setQueueBucket

Geometry.setQueueBucket介绍

暂无

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

geom.setQueueBucket(Bucket.Transparent);
else
  geom.setQueueBucket(Bucket.Opaque);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

geom.setQueueBucket(Bucket.Transparent);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  Quad quadMesh = new Quad(512,512);
  Geometry quad = new Geometry("Quad", quadMesh);
  quad.setQueueBucket(Bucket.Gui);
  mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
  quad.setMaterial(mat);
  guiNode.attachChildAt(quad, 0);
  nextColor = ColorRGBA.randomColor();
  prevColor = ColorRGBA.Black;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

material.setTransparent(true);
material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
geometry.setQueueBucket(Bucket.Transparent);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

if (geom.getMaterial().getAdditionalRenderState().getBlendMode() == RenderState.BlendMode.Alpha) {
  geom.setQueueBucket(RenderQueue.Bucket.Transparent);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

private void createBox() {
    //creating a transluscent box
    box = new Geometry("box", new Box(50, 50, 50));
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", new ColorRGBA(1.0f, 0, 0, 0.3f));
    mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    //mat.getAdditionalRenderState().setDepthWrite(false);
    //mat.getAdditionalRenderState().setDepthTest(false);
    box.setMaterial(mat);
    box.setQueueBucket(Bucket.Translucent);

    //creating a post view port
//        ViewPort post=renderManager.createPostView("transpPost", cam);
//        post.setClearFlags(false, true, true);

    box.setLocalTranslation(-600, 0, 300);

    //attaching the box to the post viewport
    //Don't forget to updateGeometricState() the box in the simpleUpdate
    //  post.attachScene(box);

    rootNode.attachChild(box);
  }

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

@Override
public void simpleInitApp() {
  Quad q = new Quad(1, 1);
  Geometry g = new Geometry("quad", q);
  g.setLocalTranslation(-500, -500, 0);
  g.setLocalScale(1000);
  rootNode.attachChild(g);
  cam.setLocation(new Vector3f(0.0f, 0.0f, 0.40647888f));
  cam.setRotation(new Quaternion(0.0f, 1.0f, 0.0f, 0.0f));
  Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.jpg");
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/UnshadedNodes.j3md");
 //Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setColor("Color", ColorRGBA.Yellow);
  mat.setTexture("ColorMap", tex);
  g.setMaterial(mat);
  //place the geoms in the transparent bucket so that they are rendered back to front for maximum overdraw
  g.setQueueBucket(RenderQueue.Bucket.Transparent);
  for (int i = 0; i < 1000; i++) {
    Geometry cl = g.clone(false);
    cl.move(0, 0, -(i + 1));
    rootNode.attachChild(cl);
  }
  flyCam.setMoveSpeed(20);
  Logger.getLogger("com.jme3").setLevel(Level.WARNING);
  this.setAppProfiler(new Profiler());
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

bGeom.setQueueBucket(RenderQueue.Bucket.Transparent);
attach(wireAttach, deforms, bGeom);
if (outlinesAttach != null) {

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Adds a "transparent" quad to the scene, that limits the color values of the scene behind the object.<br/>
 * This effect can be good seen on bright areas of the scene (e.g. areas with specular lighting effects).
 */
private void createRightQuad() {
  Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  material.setColor("Color", new ColorRGBA(0.4f, 0.4f, 0.4f, 1f));
  // Min( Source , Destination)
  material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Custom);
  material.getAdditionalRenderState().setBlendEquation(RenderState.BlendEquation.Min);
  material.getAdditionalRenderState().setBlendEquationAlpha(RenderState.BlendEquationAlpha.Min);
  // In OpenGL no blend factors are used, when using the blend equations Min or Max!
  //material.getAdditionalRenderState().setCustomBlendFactors(
  //        RenderState.BlendFunc.One, RenderState.BlendFunc.One,
  //        RenderState.BlendFunc.One, RenderState.BlendFunc.One);
  rightQuad = new Geometry("RightQuad", new Quad(1f, 1f));
  rightQuad.setMaterial(material);
  rightQuad.setQueueBucket(RenderQueue.Bucket.Transparent);
  rootNode.attachChild(rightQuad);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Adds a "transparent" quad to the scene, that shows an inverse blue value sight of the scene behind.
 */
private void createLeftQuad() {
  Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  // This color creates a blue value image. The effect will have a strength of 80% (set by the alpha value).
  material.setColor("Color", new ColorRGBA(0f, 0f, 1f, 0.8f));
  // Result.RGB = Source.A * Source.RGB - Source.A * Destination.RGB
  // Result.A   = Destination.A
  material.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Custom);
  material.getAdditionalRenderState().setBlendEquation(RenderState.BlendEquation.Subtract);
  material.getAdditionalRenderState().setBlendEquationAlpha(RenderState.BlendEquationAlpha.Add);
  material.getAdditionalRenderState().setCustomBlendFactors(
      RenderState.BlendFunc.Src_Alpha, RenderState.BlendFunc.Src_Alpha,
      RenderState.BlendFunc.Zero, RenderState.BlendFunc.One);
  leftQuad = new Geometry("LeftQuad", new Quad(1f, 1f));
  leftQuad.setMaterial(material);
  leftQuad.setQueueBucket(RenderQueue.Bucket.Transparent);
  rootNode.attachChild(leftQuad);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

sky.setQueueBucket(Bucket.Sky);
sky.setCullHint(Spatial.CullHint.Never);
sky.setModelBound(new BoundingSphere(Float.POSITIVE_INFINITY, Vector3f.ZERO));

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

mat.getAdditionalRenderState().setDepthWrite(false);
mat.setTexture("ColorMap", guiTexture);
guiQuad.setQueueBucket(Bucket.Translucent);
guiQuad.setMaterial(mat);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

cube2.setQueueBucket(RenderQueue.Bucket.Transparent);
cube2.getMaterial().setColor("Color",  ColorRGBA.Red);
rootNode.attachChild(cube2);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

cube2Mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
cube2Geo.setQueueBucket(Bucket.Transparent);
cube2Geo.setMaterial(cube2Mat);
rootNode.attachChild(cube2Geo);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

Geometry box = new Geometry("box", boxMesh2);
box.setMaterial(matBox);
    box.setQueueBucket(RenderQueue.Bucket.Translucent);

代码示例来源:origin: us.ihmc/IHMCJMonkeyEngineToolkit

public static Node createBillboard(Material mat, float radius)
{
 Node sunGeom = new Node();
 Geometry sun = new Geometry("", new Quad(radius, radius));
 sun.setMaterial(mat);
 sun.setQueueBucket(Bucket.Transparent);
 sunGeom.attachChild(sun);
 sun.move(-radius / 2f, -radius / 2f, -radius / 2f);
 BillboardControl bc = new BillboardControl();
 sunGeom.addControl(bc);
 return sunGeom;
}

代码示例来源:origin: net.sf.phat/phat-audio

private void createRangeSphere() {
  Sphere sphere = new Sphere(32, 32, getRefDistance()*2);
  rangeGeometry = new Geometry("Shiny rock", sphere);
  Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  mat.setColor("Color", new ColorRGBA(1, 0, 0, 0.2f));        
  mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
  rangeGeometry.setMaterial(mat);        
  rangeGeometry.setQueueBucket(Bucket.Transparent); 
}

代码示例来源:origin: net.sf.phat/phat-audio

public Geometry createRangeSphere(AudioNode audioNode) {
    Sphere sphere = new Sphere(32, 32, audioNode.getRefDistance()*6);
    Geometry rangeGeometry = new Geometry("Shiny rock", sphere);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    mat.setColor("Color", new ColorRGBA(1, 0, 0, 0.2f));        
    mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Alpha);
    rangeGeometry.setMaterial(mat);        
    rangeGeometry.setQueueBucket(RenderQueue.Bucket.Transparent); 
    return rangeGeometry;
  }
}

代码示例来源:origin: us.ihmc/ihmc-jmonkey-engine-toolkit

public static Node createBillboard(Material mat, float radius)
{
 Node sunGeom = new Node();
 Geometry sun = new Geometry("", new Quad(radius, radius));
 sun.setMaterial(mat);
 sun.setQueueBucket(Bucket.Transparent);
 sunGeom.attachChild(sun);
 sun.move(-radius / 2f, -radius / 2f, -radius / 2f);
 BillboardControl bc = new BillboardControl();
 sunGeom.addControl(bc);
 return sunGeom;
}

代码示例来源:origin: info.projectkyoto/mms-engine

public void createJointGeom(PMDJoint joint) {
    Geometry geom = new Geometry(joint.getJointName());
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Mesh mesh;
    mesh = new Line(Vector3f.ZERO, Vector3f.ZERO);
    mat.setColor("Color", ColorRGBA.White);
    geom.setMesh(mesh);
    geom.setMaterial(mat);
//        mat.getAdditionalRenderState().setWireframe(true);
    mat.getAdditionalRenderState().setDepthTest(false);

    geom.setQueueBucket(Bucket.Transparent);

    node.attachChild(geom);
  }
}

相关文章