gpt4 book ai didi

com.jme3.scene.debug.WireBox类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 00:21:05 28 4
gpt4 key购买 nike

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

WireBox介绍

暂无

代码示例

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

public void putBox(Vector3f pos, float size, ColorRGBA color){
  putShape(new WireBox(size, size, size), color, 1).setLocalTranslation(pos);
}

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

public WireBox(float xExt, float yExt, float zExt){
  updatePositions(xExt,yExt,zExt);
  setBuffer(Type.Index, 2,
      new short[]{
         0, 1,
         1, 2,
         2, 3,
         3, 0,
         4, 5,
         5, 6,
         6, 7,
         7, 4,
         0, 4,
         1, 5,
         2, 6,
         3, 7,
      }
  );
  setMode(Mode.Lines);
  updateCounts();
}

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

public void updatePositions(float xExt, float yExt, float zExt){
  VertexBuffer pvb = getBuffer(Type.Position);
  FloatBuffer pb;
  if (pvb == null){
    pvb = new VertexBuffer(Type.Position);
    pb = BufferUtils.createVector3Buffer(8);
    pvb.setupData(Usage.Dynamic, 3, Format.Float, pb);
    setBuffer(pvb);
  }else{
    pb = (FloatBuffer) pvb.getData();
    pvb.updateData(pb);
  }
  pb.rewind();
  pb.put(
    new float[]{
      -xExt, -yExt,  zExt,
       xExt, -yExt,  zExt,
       xExt,  yExt,  zExt,
      -xExt,  yExt,  zExt,
      -xExt, -yExt, -zExt,
       xExt, -yExt, -zExt,
       xExt,  yExt, -zExt,
      -xExt,  yExt, -zExt,
    }
  );
  updateBound();
}

代码示例来源:origin: tonihele/OpenKeeper

private void setupVisualsForSelection() {
  matWireBox = new Material(this.app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
  matWireBox.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
  matWireBox.setColor("Color", selectionColor.getColor());
  matWireBox.getAdditionalRenderState().setLineWidth(6);
  this.wireBox = new WireBox(MapLoader.TILE_WIDTH, MapLoader.TILE_WIDTH, MapLoader.TILE_WIDTH);
  this.wireBox.setDynamic();
  this.wireBoxGeo = new Geometry("wireBox", wireBox);
  this.wireBoxGeo.setMaterial(matWireBox);
  this.wireBoxGeo.setCullHint(CullHint.Never);
  this.wireBoxGeo.setShadowMode(RenderQueue.ShadowMode.Off);
  this.app.getRootNode().attachChild(this.wireBoxGeo);
}

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

public void fromBoundingBox(BoundingBox bbox){
  updatePositions(bbox.getXExtent(), bbox.getYExtent(), bbox.getZExtent());
}

代码示例来源:origin: tonihele/OpenKeeper

public void updateSelectionBox() {
  if (isVisible()) {
    float dx = selectionArea.getDeltaX();
    float dy = selectionArea.getDeltaY();
    float delta = 0.01f;
    Vector2f position = selectionArea.getCenter();
    wireBoxGeo.setLocalTranslation(position.x, MapLoader.FLOOR_HEIGHT, position.y);
    wireBox.updatePositions(MapLoader.TILE_WIDTH / 2 * dx + delta,
        MapLoader.FLOOR_HEIGHT + delta,
        MapLoader.TILE_WIDTH / 2 * dy + delta);
    // Selection color indicator
    ColorIndicator newSelectionColor = getColorIndicator();
    if (!newSelectionColor.equals(selectionColor)) {
      selectionColor = newSelectionColor;
      matWireBox.setColor("Color", selectionColor.getColor());
    }
    this.wireBoxGeo.setCullHint(CullHint.Never);
  } else {
    this.wireBoxGeo.setCullHint(CullHint.Always);
  }
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

public WireBox(float xExt, float yExt, float zExt){
  updatePositions(xExt,yExt,zExt);
  setBuffer(Type.Index, 2,
      new short[]{
         0, 1,
         1, 2,
         2, 3,
         3, 0,
         4, 5,
         5, 6,
         6, 7,
         7, 4,
         0, 4,
         1, 5,
         2, 6,
         3, 7,
      }
  );
  setMode(Mode.Lines);
  updateCounts();
}

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

public void updatePositions(float xExt, float yExt, float zExt){
  VertexBuffer pvb = getBuffer(Type.Position);
  FloatBuffer pb;
  if (pvb == null){
    pvb = new VertexBuffer(Type.Position);
    pb = BufferUtils.createVector3Buffer(8);
    pvb.setupData(Usage.Dynamic, 3, Format.Float, pb);
    setBuffer(pvb);
  }else{
    pb = (FloatBuffer) pvb.getData();
    pvb.updateData(pb);
  }
  pb.rewind();
  pb.put(
    new float[]{
      -xExt, -yExt,  zExt,
       xExt, -yExt,  zExt,
       xExt,  yExt,  zExt,
      -xExt,  yExt,  zExt,
      -xExt, -yExt, -zExt,
       xExt, -yExt, -zExt,
       xExt,  yExt, -zExt,
      -xExt,  yExt, -zExt,
    }
  );
  updateBound();
}

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

/**
   * Create a geometry suitable for visualizing the specified bounding box.
   *
   * @param bbox the bounding box (not null)
   * @return a new Geometry instance in world space
   */
  public static Geometry makeGeometry(BoundingBox bbox) {
    float xExtent = bbox.getXExtent();
    float yExtent = bbox.getYExtent();
    float zExtent = bbox.getZExtent();
    WireBox mesh = new WireBox(xExtent, yExtent, zExtent);
    Geometry result = new Geometry("bounding box", mesh);

    Vector3f center = bbox.getCenter();
    result.setLocalTranslation(center);

    return result;
  }
}

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

public WireBox(float xExt, float yExt, float zExt){
  updatePositions(xExt,yExt,zExt);
  setBuffer(Type.Index, 2,
      new short[]{
         0, 1,
         1, 2,
         2, 3,
         3, 0,
         4, 5,
         5, 6,
         6, 7,
         7, 4,
         0, 4,
         1, 5,
         2, 6,
         3, 7,
      }
  );
  setMode(Mode.Lines);
  updateCounts();
}

代码示例来源:origin: org.jmonkeyengine/jme3-core

public void updatePositions(float xExt, float yExt, float zExt){
  VertexBuffer pvb = getBuffer(Type.Position);
  FloatBuffer pb;
  if (pvb == null){
    pvb = new VertexBuffer(Type.Position);
    pb = BufferUtils.createVector3Buffer(8);
    pvb.setupData(Usage.Dynamic, 3, Format.Float, pb);
    setBuffer(pvb);
  }else{
    pb = (FloatBuffer) pvb.getData();
    pvb.updateData(pb);
  }
  pb.rewind();
  pb.put(
    new float[]{
      -xExt, -yExt,  zExt,
       xExt, -yExt,  zExt,
       xExt,  yExt,  zExt,
      -xExt,  yExt,  zExt,
      -xExt, -yExt, -zExt,
       xExt, -yExt, -zExt,
       xExt,  yExt, -zExt,
      -xExt,  yExt, -zExt,
    }
  );
  updateBound();
}

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

/**
 * used by attachBoundChildren()
 */
private void attachBoundingBox(BoundingBox bb, Node parent) {
  WireBox wb = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent());
  Geometry g = new Geometry();
  g.setMesh(wb);
  g.setLocalTranslation(bb.getCenter());
  parent.attachChild(g);
}

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

WireBox box = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent());
Geometry geom = new Geometry(test.name + " bounds", box);
geom.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"));
box = new WireBox(size, size, 0);
geom = new Geometry(test.name + " metric", box);
geom.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"));

代码示例来源:origin: org.jmonkeyengine/jme3-core

/**
   * Create a geometry suitable for visualizing the specified bounding box.
   *
   * @param bbox the bounding box (not null)
   * @return a new Geometry instance in world space
   */
  public static Geometry makeGeometry(BoundingBox bbox) {
    float xExtent = bbox.getXExtent();
    float yExtent = bbox.getYExtent();
    float zExtent = bbox.getZExtent();
    WireBox mesh = new WireBox(xExtent, yExtent, zExtent);
    Geometry result = new Geometry("bounding box", mesh);

    Vector3f center = bbox.getCenter();
    result.setLocalTranslation(center);

    return result;
  }
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-terrain

/**
 * used by attachBoundChildren()
 */
private void attachBoundingBox(BoundingBox bb, Node parent) {
  WireBox wb = new WireBox(bb.getXExtent(), bb.getYExtent(), bb.getZExtent());
  Geometry g = new Geometry();
  g.setMesh(wb);
  g.setLocalTranslation(bb.getCenter());
  parent.attachChild(g);
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com