/** * This version of clone is a shallow clone, in other words, the * same mesh is referenced as the original geometry. * Exception: if the mesh is marked as being a software * animated mesh, (bind pose is set) then the positions * and normals are deep copied. */ @Override public Geometry clone() { return clone(true); }
@Override public ParticleEmitter clone(boolean cloneMaterial) { return (ParticleEmitter)super.clone(cloneMaterial); }
@Override public BitmapTextPage clone() { BitmapTextPage clone = (BitmapTextPage) super.clone(); //clone.mesh = mesh.deepClone(); return clone; }
public Spatial oldDeepClone() { Geometry geomClone = clone(true); geomClone.mesh = mesh.deepClone(); return geomClone; }
private void createballs() { System.out.println((frames / time) + ";" + val); for (int i = val; i < val+1 ; i++) { Geometry s = sphere.clone().clone(false); s.setMaterial(mat); s.setLocalTranslation(i - 30, 5, (((i) * 2) % 40) - 50); s.setShadowMode(ShadowMode.CastAndReceive); rootNode.attachChild(s); } if (val == 300) { stop(); } val += 1; time = 0; frames = 0; } float time;
/** * Randomly Places a cube on the map between 30 and 90 paces away from player */ private void randomizeCube() { Geometry cube = fcube.clone(); int playerX = (int) player.getLocalTranslation().getX(); int playerZ = (int) player.getLocalTranslation().getZ(); // float x = FastMath.nextRandomInt(playerX + difficulty + 10, playerX + difficulty + 150); float x = FastMath.nextRandomInt(playerX + difficulty + 30, playerX + difficulty + 90); float z = FastMath.nextRandomInt(playerZ - difficulty - 50, playerZ + difficulty + 50); cube.getLocalTranslation().set(x, 0, z); // playerX+difficulty+30,playerX+difficulty+90 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); if (!solidBox){ mat.getAdditionalRenderState().setWireframe(true); } mat.setColor("Color", obstacleColors.get(FastMath.nextRandomInt(0, obstacleColors.size() - 1))); cube.setMaterial(mat); rootNode.attachChild(cube); cubeField.add(cube); }
geoms[i] = geomArray[i].clone(false);
cube1.move(0, 1.5f, 0); Geometry cube2 = cube1.clone(true); cube2.move(0.2f, 0 , 0); cube2.setQueueBucket(RenderQueue.Bucket.Transparent); Geometry cube3 = cube1.clone(); Geometry cube4 = cube2.clone(true); cube4.getMaterial().getAdditionalRenderState().setDepthFunc(RenderState.TestFunction.Less); cube3.move(0,-3,0);
@Override public void simpleInitApp() { Quad q = new Quad(1, 1); Geometry g = new Geometry("quad", q); g.setLocalTranslation(-500, -500, 0); g.setLocalScale(1000); rootNode.attachChild(g); cam.setLocation(new Vector3f(0.0f, 0.0f, 0.40647888f)); cam.setRotation(new Quaternion(0.0f, 1.0f, 0.0f, 0.0f)); Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.jpg"); Material mat = new Material(assetManager, "Common/MatDefs/Misc/UnshadedNodes.j3md"); //Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setColor("Color", ColorRGBA.Yellow); mat.setTexture("ColorMap", tex); g.setMaterial(mat); //place the geoms in the transparent bucket so that they are rendered back to front for maximum overdraw g.setQueueBucket(RenderQueue.Bucket.Transparent); for (int i = 0; i < 1000; i++) { Geometry cl = g.clone(false); cl.move(0, 0, -(i + 1)); rootNode.attachChild(cl); } flyCam.setMoveSpeed(20); Logger.getLogger("com.jme3").setLevel(Level.WARNING); this.setAppProfiler(new Profiler()); }
ParticleEmitter clone = (ParticleEmitter) super.clone(cloneMaterial); clone.shape = shape.deepClone();
Geometry clonePot = teapot.clone();
for (int y = -5; y < 5; y++) { for (int x = -5; x < 5; x++) { Geometry clonePot = teapot.clone();
for (int y = -f; y < f; y++) { for (int x = -f; x < f; x++) { Geometry clonePot = teapot.clone();
/** * This version of clone is a shallow clone, in other words, the * same mesh is referenced as the original geometry. * Exception: if the mesh is marked as being a software * animated mesh, (bind pose is set) then the positions * and normals are deep copied. */ @Override public Geometry clone() { return clone(true); }
/** * This version of clone is a shallow clone, in other words, the * same mesh is referenced as the original geometry. * Exception: if the mesh is marked as being a software * animated mesh, (bind pose is set) then the positions * and normals are deep copied. */ @Override public Geometry clone() { return clone(true); }
Geometry b = boxGeo.clone(false); cubeNodes.attachChild(b); b.setLocalTranslation(p.getPosition().x, 2, p.getPosition().z);
public Spatial oldDeepClone() { Geometry geomClone = clone(true); geomClone.mesh = mesh.deepClone(); return geomClone; }
/** * Creates a deep clone of the geometry, * this creates an identical copy of the mesh * with the vertexbuffer data duplicated. */ @Override public Spatial deepClone() { Geometry geomClone = clone(true); geomClone.mesh = mesh.deepClone(); return geomClone; }