本文整理了Java中com.jme3.scene.Geometry.getName()
方法的一些代码示例,展示了Geometry.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.getName()
方法的具体详情如下:
包路径:com.jme3.scene.Geometry
类名称:Geometry
方法名:getName
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public String getActionName() {
return geom.getName() + "Reload";
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void collide(Bone bone, PhysicsCollisionObject object, PhysicsCollisionEvent event) {
if (object.getUserObject() != null && object.getUserObject() instanceof Geometry) {
Geometry geom = (Geometry) object.getUserObject();
if ("Floor".equals(geom.getName())) {
return;
}
}
ragdoll.setRagdollMode();
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public static void generate(Spatial s){
if(s instanceof Node){
Node n = (Node)s;
for (Spatial child : n.getChildren()) {
generate(child);
}
} else if (s instanceof Geometry){
Geometry g = (Geometry)s;
MikkTSpaceImpl context = new MikkTSpaceImpl(g.getMesh());
if(!genTangSpaceDefault(context)){
Logger.getLogger(MikktspaceTangentGenerator.class.getName()).log(Level.SEVERE, "Failed to generate tangents for geometry " + g.getName());
}
TangentUtils.generateBindPoseTangentsIfNecessary(g.getMesh());
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
if (!g.isGrouped() || rebatch) {
if (g.getMaterial() == null) {
throw new IllegalStateException("No material is set for Geometry: " + g.getName() + " please set a material before batching");
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
@Override
public Node clone(boolean cloneMaterials) {
BatchNode clone = (BatchNode) super.clone(cloneMaterials);
if (batches.size() > 0) {
for (Batch b : batches) {
for (int i = 0; i < clone.children.size(); i++) {
if (clone.children.get(i).getName().equals(b.geometry.getName())) {
clone.children.remove(i);
break;
}
}
}
clone.needsFullRebatch = true;
clone.batches = new SafeArrayList<Batch>(Batch.class);
clone.batchesByGeom = new HashMap<Geometry, Batch>();
clone.batch();
}
return clone;
}
代码示例来源: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
compilationOk = true;
} catch (RendererException e) {
logger.log(Level.FINE, geom.getName() + ": failed at " + maxGPUTargets);
logger.log(Level.FINE, geom.getName() + ": " + maxGPUTargets);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
&& mesh.getFloatBuffer(Type.Normal) == null){
logger.log(Level.WARNING, "OBJ mesh {0} doesn't contain normals! "
+ "It might not display correctly", geom.getName());
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
if (count != null && count < geoms.size()) {
geom.getMesh().clearBuffer(buffer.getBufferType());
logger.log(Level.FINE, "removing {0} from {1}", new Object[]{buffer.getBufferType(), geom.getName()});
logger.log(Level.FINE, "geom {0} misses buffer {1}. Creating", new Object[]{geom.getName(), type});
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void renderSubScene(Spatial scene, ViewPort vp) {
// check culling first.
if (!scene.checkCulling(vp.getCamera())) {
return;
}
scene.runControlRender(this, vp);
if (scene instanceof Node) {
// Recurse for all children
Node n = (Node) scene;
List<Spatial> children = n.getChildren();
// Saving cam state for culling
int camState = vp.getCamera().getPlaneState();
for (int i = 0; i < children.size(); i++) {
// Restoring cam state before proceeding children recursively
vp.getCamera().setPlaneState(camState);
renderSubScene(children.get(i), vp);
}
} else if (scene instanceof Geometry) {
// add to the render queue
Geometry gm = (Geometry) scene;
if (gm.getMaterial() == null) {
throw new IllegalStateException("No material is set for Geometry: " + gm.getName());
}
vp.getQueue().addToQueue(gm, scene.getQueueBucket());
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
if (batch != null) {
list.add(0, batch.geometry);
batchName = batch.geometry.getName();
batch.geometry.removeFromParent();
} else {
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Cast a ray at the geometries and report all collisions.
*/
void castRay() {
CollisionResults results = new CollisionResults();
rootNode.collideWith(ray, results);
int numResults = results.size();
for (int resultI = 0; resultI < numResults; resultI++) {
CollisionResult result = results.getCollision(resultI);
Geometry geometry = result.getGeometry();
String name = geometry.getName();
if (name.equals("white lines")) {
assert false; // phantom triangle
}
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
throw new IllegalStateException("No material is set for Geometry: " + gm.getName());
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
private void createDebugTangents(Geometry geom) {
Geometry debug = new Geometry(
"Debug " + geom.getName(),
TangentBinormalGenerator.genTbnLines(geom.getMesh(), 0.8f)
);
Material debugMat = assetManager.loadMaterial("Common/Materials/VertexColor.j3m");
debug.setMaterial(debugMat);
debug.setCullHint(Spatial.CullHint.Never);
debug.getLocalTranslation().set(geom.getWorldTranslation());
debugNode.attachChild(debug);
}
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
String hit = results.getCollision(i).getGeometry().getName();
System.out.println("* Collision #" + i);
System.out.println(" You shot " + hit + " at " + pt + ", " + dist + " wu away.");
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
throw new IllegalArgumentException("Geometry " + geom.getName() + " has no " + outBuf.getBufferType() + " buffer whereas other geoms have. all geometries should have the same types of buffers.\n Try to use GeometryBatchFactory.alignBuffer() on the BatchNode before batching");
} else if (outBuf == null) {
throw new IllegalArgumentException("Geometry " + geom.getName() + " has a " + outBuf.getBufferType() + " buffer whereas other geoms don't. all geometries should have the same types of buffers.\n Try to use GeometryBatchFactory.alignBuffer() on the BatchNode before batching");
} else {
inBuf.copyElements(0, outBuf, globalVertIndex, geomVertCount);
代码示例来源:origin: org.jmonkeyengine/jme3-core
public String getActionName() {
return geom.getName() + "Reload";
}
代码示例来源:origin: org.jmonkeyengine/jme3-dae
private static Map<String, List<Geometry>> packByName(List<Geometry> geometries)
{
// geom name is NAME+INDEX, this group geometries by name
Map<String, List<Geometry>> res = new HashMap<String, List<Geometry>>();
for (Geometry geometry : geometries)
{
String name = getNamePart(geometry.getName());
List<Geometry> list = res.get(name);
if (list == null)
res.put(name, list = new LinkedList<Geometry>());
list.add(geometry);
}
return res;
}
代码示例来源:origin: info.projectkyoto/mms-engine
protected BatchedGeometry(GeometryBatch batch, Geometry geom) {
this.batch = batch;
vertexCount = geom.getVertexCount();
triangleCount = geom.getTriangleCount();
name = geom.getName();
}
代码示例来源:origin: org.jmonkeyengine/jme3-dae
private void dumpGeometry(Geometry geometry)
{
System.out.println("Geometry " + geometry.getName());
Material mat = geometry.getMaterial();
if (mat != null)
{
for (MatParam matParam : mat.getParams())
{
System.out.println(matParam.getName() + " = " + matParam.getValue());
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!