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

x33g5p2x  于2022-01-25 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(114)

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

Mesh.getBound介绍

[英]Returns the BoundingVolume of this Mesh. By default the bounding volume is a BoundingBox.
[中]返回此网格的边界体积。默认情况下,边界体积是一个边界框。

代码示例

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

/**
 * @return The bounding volume of the mesh, in model space.
 */
public BoundingVolume getModelBound() {
  return mesh.getBound();
}

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

/**
 * <code>updateWorldBound</code> updates the bounding volume that contains
 * this geometry. The location of the geometry is based on the location of
 * all this node's parents.
 *
 * @see Spatial#updateWorldBound()
 */
@Override
protected void updateWorldBound() {
  super.updateWorldBound();
  if (mesh == null) {
    throw new NullPointerException("Geometry: " + getName() + " has null mesh");
  }
  if (mesh.getBound() != null) {
    if (ignoreTransform) {
      // we do not transform the model bound by the world transform,
      // just use the model bound as-is
      worldBound = mesh.getBound().clone(worldBound);
    } else {
      worldBound = mesh.getBound().transform(worldTransform, worldBound);
    }
  }
}

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

public static float computeLodEntropy(Mesh terrainBlock, Buffer lodIndices){
  BoundingBox bbox = (BoundingBox) terrainBlock.getBound();

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

/**
 * Instantly emits available particles, up to num.
 */
public void emitParticles(int num) {
  // Force world transform to update
  this.getWorldTransform();
  TempVars vars = TempVars.get();
  BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
  Vector3f min = vars.vect1;
  Vector3f max = vars.vect2;
  bbox.getMin(min);
  bbox.getMax(max);
  if (!Vector3f.isValidVector(min)) {
    min.set(Vector3f.POSITIVE_INFINITY);
  }
  if (!Vector3f.isValidVector(max)) {
    max.set(Vector3f.NEGATIVE_INFINITY);
  }
  for(int i=0;i<num;i++) {
    if( emitParticle(min, max) == null ) break;
  }
  bbox.setMinMax(min, max);
  this.setBoundRefresh();
  vars.release();
}

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

BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
bbox.setMinMax(min, max);
this.setBoundRefresh();

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

/**
 * @return The bounding volume of the mesh, in model space.
 */
public BoundingVolume getModelBound() {
  return mesh.getBound();
}

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

/**
 * @return The bounding volume of the mesh, in model space.
 */
public BoundingVolume getModelBound() {
  return mesh.getBound();
}

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

/**
 * <code>updateWorldBound</code> updates the bounding volume that contains
 * this geometry. The location of the geometry is based on the location of
 * all this node's parents.
 *
 * @see Spatial#updateWorldBound()
 */
@Override
protected void updateWorldBound() {
  super.updateWorldBound();
  if (mesh == null) {
    throw new NullPointerException("Geometry: " + getName() + " has null mesh");
  }
  if (mesh.getBound() != null) {
    if (ignoreTransform) {
      // we do not transform the model bound by the world transform,
      // just use the model bound as-is
      worldBound = mesh.getBound().clone(worldBound);
    } else {
      worldBound = mesh.getBound().transform(worldTransform, worldBound);
    }
  }
}

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

/**
 * <code>updateWorldBound</code> updates the bounding volume that contains
 * this geometry. The location of the geometry is based on the location of
 * all this node's parents.
 *
 * @see Spatial#updateWorldBound()
 */
@Override
protected void updateWorldBound() {
  super.updateWorldBound();
  if (mesh == null) {
    throw new NullPointerException("Geometry: " + getName() + " has null mesh");
  }
  if (mesh.getBound() != null) {
    if (ignoreTransform) {
      // we do not transform the model bound by the world transform,
      // just use the model bound as-is
      worldBound = mesh.getBound().clone(worldBound);
    } else {
      worldBound = mesh.getBound().transform(worldTransform, worldBound);
    }
  }
}

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

@Override
public BoundingVolume getBound() {
  BoundingBox bb = (BoundingBox)super.getBound();
  BoundingBox bb2 = new BoundingBox(bb.getCenter(), bb.getXExtent()*2, bb.getYExtent()*2,
      bb.getZExtent()*2);
  BoundingBox bb3 = new BoundingBox(bb.getCenter().ZERO,5,5,5);
  return bound;
}

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

/**
 * Instantly emits all the particles possible to be emitted. Any particles
 * which are currently inactive will be spawned immediately.
 */
public void emitAllParticles() {
  // Force world transform to update
  this.getWorldTransform();
  TempVars vars = TempVars.get();
  BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
  Vector3f min = vars.vect1;
  Vector3f max = vars.vect2;
  bbox.getMin(min);
  bbox.getMax(max);
  if (!Vector3f.isValidVector(min)) {
    min.set(Vector3f.POSITIVE_INFINITY);
  }
  if (!Vector3f.isValidVector(max)) {
    max.set(Vector3f.NEGATIVE_INFINITY);
  }
  while (emitParticle(min, max) != null);
  bbox.setMinMax(min, max);
  this.setBoundRefresh();
  vars.release();
}

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

/**
 * Instantly emits available particles, up to num.
 */
public void emitParticles(int num) {
  // Force world transform to update
  this.getWorldTransform();
  TempVars vars = TempVars.get();
  BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
  Vector3f min = vars.vect1;
  Vector3f max = vars.vect2;
  bbox.getMin(min);
  bbox.getMax(max);
  if (!Vector3f.isValidVector(min)) {
    min.set(Vector3f.POSITIVE_INFINITY);
  }
  if (!Vector3f.isValidVector(max)) {
    max.set(Vector3f.NEGATIVE_INFINITY);
  }
  for(int i=0;i<num;i++) {
    if( emitParticle(min, max) == null ) break;
  }
  bbox.setMinMax(min, max);
  this.setBoundRefresh();
  vars.release();
}

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

public static float computeLodEntropy(Mesh terrainBlock, Buffer lodIndices){
  BoundingBox bbox = (BoundingBox) terrainBlock.getBound();

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

BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
bbox.setMinMax(min, max);
this.setBoundRefresh();

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

BoundingBox bbox = (BoundingBox) this.getMesh().getBound();
bbox.setMinMax(min, max);
this.setBoundRefresh();

相关文章