本文整理了Java中com.jme3.scene.Spatial.updateModelBound()
方法的一些代码示例,展示了Spatial.updateModelBound()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Spatial.updateModelBound()
方法的具体详情如下:
包路径:com.jme3.scene.Spatial
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!