本文整理了Java中com.jme3.scene.Geometry.setName()
方法的一些代码示例,展示了Geometry.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.setName()
方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:setName
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void startSubmeshName(String indexStr, String nameStr) {
int index = Integer.parseInt(indexStr);
if (index >= geoms.size()) {
logger.log(Level.WARNING, "Submesh name index is larger than number of geometries: {0} >= {1}",
new Object[]{index, geoms.size()});
} else {
geoms.get(index).setName(nameStr);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void setParent(Node node) {
for(int i = 0; i < geometries.size(); ++i) {
Geometry geom = geometries.get(i);
geom.setName(node.getName() + (i > 0 ? "-" + i : ""));
geom.updateModelBound();
node.attachChild(geom);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
geom.setName(name + (primitives.size() > 1 ? ("_" + index) : ""));
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private Node createPlayer() {
Dome b = new Dome(Vector3f.ZERO, 10, 100, 1);
Geometry playerMesh = new Geometry("Box", b);
playerMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
playerMaterial.setColor("Color", ColorRGBA.Red);
playerMesh.setMaterial(playerMaterial);
playerMesh.setName("player");
Box floor = new Box(100, 0, 100);
Geometry floorMesh = new Geometry("Box", floor);
Vector3f translation = Vector3f.ZERO.add(playerMesh.getLocalTranslation().getX(),
playerMesh.getLocalTranslation().getY() - 1, 0);
floorMesh.setLocalTranslation(translation);
floorMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
floorMaterial.setColor("Color", ColorRGBA.LightGray);
floorMesh.setMaterial(floorMaterial);
floorMesh.setName("floor");
Node playerNode = new Node();
playerNode.attachChild(playerMesh);
playerNode.attachChild(floorMesh);
return playerNode;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void onAction(String binding, boolean value, float tpf) {
if (binding.equals("shoot") && !value) {
Geometry bulletg = new Geometry("bullet", bullet);
bulletg.setMaterial(mat);
bulletg.setName("bullet");
bulletg.setLocalTranslation(cam.getLocation());
bulletg.setShadowMode(ShadowMode.CastAndReceive);
bulletg.addControl(new RigidBodyControl(bulletCollisionShape, 1));
bulletg.getControl(RigidBodyControl.class).setCcdMotionThreshold(0.1f);
bulletg.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
rootNode.attachChild(bulletg);
getPhysicsSpace().add(bulletg);
} else if (binding.equals("shoot2") && !value) {
Geometry bulletg = new Geometry("bullet", bullet);
bulletg.setMaterial(mat2);
bulletg.setName("bullet");
bulletg.setLocalTranslation(cam.getLocation());
bulletg.setShadowMode(ShadowMode.CastAndReceive);
bulletg.addControl(new RigidBodyControl(bulletCollisionShape, 1));
bulletg.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
rootNode.attachChild(bulletg);
getPhysicsSpace().add(bulletg);
}
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-plugins
private void startSubmeshName(String indexStr, String nameStr) {
int index = Integer.parseInt(indexStr);
if (index >= geoms.size()) {
logger.log(Level.WARNING, "Submesh name index is larger than number of geometries: {0} >= {1}",
new Object[]{index, geoms.size()});
} else {
geoms.get(index).setName(nameStr);
}
}
代码示例来源:origin: info.projectkyoto/mms-engine
private void startSubmeshName(String indexStr, String nameStr) {
int index = Integer.parseInt(indexStr);
if (index >= geoms.size()) {
logger.log(Level.WARNING, "Submesh name index is larger than number of geometries: {0} >= {1}",
new Object[]{index, geoms.size()});
} else {
geoms.get(index).setName(nameStr);
}
}
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-plugins
private void startSubmeshName(String indexStr, String nameStr) {
int index = Integer.parseInt(indexStr);
if (index >= geoms.size()) {
logger.log(Level.WARNING, "Submesh name index is larger than number of geometries: {0} >= {1}",
new Object[]{index, geoms.size()});
} else {
geoms.get(index).setName(nameStr);
}
}
代码示例来源:origin: org.jmonkeyengine/jme3-plugins
public void setParent(Node node) {
for(int i = 0; i < geometries.size(); ++i) {
Geometry geom = geometries.get(i);
geom.setName(node.getName() + (i > 0 ? "-" + i : ""));
geom.updateModelBound();
node.attachChild(geom);
}
}
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-plugins
Node rootNode = (refId != 0) ? modelMap.get(refId) : sceneNode;
if(rootNode != null) {
geom.setName(rootNode.getName() + "-mesh");
geom.updateModelBound();
rootNode.attachChild(geom);
代码示例来源:origin: info.projectkyoto/mms-engine
private Node createPlayer() {
Dome b = new Dome(Vector3f.ZERO, 10, 100, 1);
Geometry playerMesh = new Geometry("Box", b);
playerMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
playerMaterial.setColor("Color", ColorRGBA.Red);
playerMesh.setMaterial(playerMaterial);
playerMesh.setName("player");
Box floor = new Box(Vector3f.ZERO.add(playerMesh.getLocalTranslation().getX(),
playerMesh.getLocalTranslation().getY() - 1, 0), 100, 0, 100);
Geometry floorMesh = new Geometry("Box", floor);
floorMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
floorMaterial.setColor("Color", ColorRGBA.LightGray);
floorMesh.setMaterial(floorMaterial);
floorMesh.setName("floor");
Node playerNode = new Node();
playerNode.attachChild(playerMesh);
playerNode.attachChild(floorMesh);
return playerNode;
}
代码示例来源:origin: org.jmonkeyengine/jme3-plugins
geom.setName(name + (primitives.size() > 1 ? ("_" + index) : ""));
内容来源于网络,如有侵权,请联系作者删除!