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

x33g5p2x  于2022-01-30 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(145)

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

Spatial.updateModelBound介绍

[英]updateModelBound recalculates the bounding object for this Spatial.
[中]updateModelBound重新计算此空间的边界对象。

代码示例

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

@Override
public void updateModelBound() {
  if(children != null) {
    for (Spatial child : children.getArray()) {
      child.updateModelBound();
    }
  }
}
@Override

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

spatial.setShadowMode(ShadowMode.Receive);
spatial.updateModelBound();
return spatial;

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

@Override
public void updateModelBound() {
  if(children != null) {
    for (Spatial child : children.getArray()) {
      child.updateModelBound();
    }
  }
}
@Override

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

@Override
public void updateModelBound() {
  if(children != null) {
    for (Spatial child : children.getArray()) {
      child.updateModelBound();
    }
  }
}

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

public static boolean contains(Spatial container, Spatial entity) {
  container.updateModelBound();
  Vector3f min = SpatialUtils.getMinBounding(container);
  Vector3f max = SpatialUtils.getMaxBounding(container);
  Vector3f center = SpatialUtils.getCenterBoinding(entity);
  if (min.x <= center.x && min.y <= center.y && min.z <= center.z
      && max.x >= center.x && max.y >= center.y && max.z >= center.z) {
    return true;
  }
  return false;
}

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

public static Vector3f getCenterBoinding(Spatial spatial) {
  spatial.updateModelBound();
  BoundingVolume wb = spatial.getWorldBound();
  if (wb == null) {
    return spatial.getWorldTranslation();
  } else {
    return wb.getCenter();
  }
}

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

public static Vector3f getMaxBounding(Spatial spatial) {
  spatial.updateModelBound();
  BoundingVolume wb = spatial.getWorldBound();
  if (wb instanceof BoundingBox) {
    BoundingBox bb = (BoundingBox) wb;
    Vector3f max = new Vector3f();
    return bb.getMax(max);
  } else if (wb instanceof BoundingSphere) {
    BoundingSphere bs = (BoundingSphere) wb;
    float radius = bs.getRadius();
    return new Vector3f(radius, radius, radius);
  }
  return spatial.getWorldTranslation();
}

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

public static Vector3f getMinBounding(Spatial spatial) {
  spatial.updateModelBound();
  BoundingVolume wb = spatial.getWorldBound();
  if (wb instanceof BoundingBox) {
    BoundingBox bb = (BoundingBox) wb;
    Vector3f min = new Vector3f();
    return bb.getMin(min);
  } else if (wb instanceof BoundingSphere) {
    BoundingSphere bs = (BoundingSphere) wb;
    float radius = bs.getRadius();
    return new Vector3f(-radius, -radius, -radius);
  }
  return spatial.getWorldTranslation();
}

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

spatial.setShadowMode(ShadowMode.Receive);
spatial.updateModelBound();
return spatial;

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

spatial.updateModelBound();

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

spatial.updateModelBound();

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

assetManager.registerLocator(modelParent, FileLocator.class);
Spatial scene = assetManager.loadModel(model);
scene.updateModelBound();
Node node = (Node) scene;
DirectionalLight dl = new DirectionalLight();

相关文章

Spatial类方法