diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteExplosion.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteExplosion.java index 53d138601..12f41bc94 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteExplosion.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteExplosion.java @@ -47,7 +47,7 @@ public class JmePaletteExplosion implements ActiveEditorDrop { private String createBody() { - String body = " /** Explosion effect. Uses Texture from jme3-test-data library! */ \n ParticleEmitter debris = new ParticleEmitter(\"Debris\", ParticleMesh.Type.Triangle, 10);\n Material debris_mat = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n debris_mat.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/Debris.png\"));\n debris.setMaterial(debris_mat);\n debris.setImagesX(3); debris.setImagesY(3); // 3x3 texture animation\n debris.setRotateSpeed(4);\n debris.setSelectRandomImage(true);\n debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 4, 0));\n debris.setStartColor(new ColorRGBA(1f, 1f, 1f, 1f));\n debris.setGravity(0f,6f,0f);\n debris.getParticleInfluencer().setVelocityVariation(.60f);\n rootNode.attachChild(debris);\n debris.emitAllParticles();\n"; + String body = " /** Explosion effect. Uses Texture from jme3-test-data library! */ \n ParticleEmitter debrisEffect = new ParticleEmitter(\"Debris\", ParticleMesh.Type.Triangle, 10);\n Material debrisMat = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n debrisMat.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/Debris.png\"));\n debrisEffect.setMaterial(debrisMat);\n debrisEffect.setImagesX(3); debrisEffect.setImagesY(3); // 3x3 texture animation\n debrisEffect.setRotateSpeed(4);\n debrisEffect.setSelectRandomImage(true);\n debrisEffect.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 4, 0));\n debrisEffect.setStartColor(new ColorRGBA(1f, 1f, 1f, 1f));\n debrisEffect.setGravity(0f,6f,0f);\n debrisEffect.getParticleInfluencer().setVelocityVariation(.60f);\n rootNode.attachChild(debrisEffect);\n debrisEffect.emitAllParticles();\n"; return body; } diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteFire.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteFire.java index 11cfcca45..cbc3cb6f2 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteFire.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteFire.java @@ -47,7 +47,7 @@ public class JmePaletteFire implements ActiveEditorDrop { private String createBody() { - String body = " /** Uses Texture from jme3-test-data library! */\n ParticleEmitter fire = new ParticleEmitter(\"Emitter\", ParticleMesh.Type.Triangle, 30);\n Material mat_red = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n //mat_red.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/flame.png\"));\n fire.setMaterial(mat_red);\n fire.setImagesX(2); fire.setImagesY(2); // 2x2 texture animation\n fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red\n fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow\n fire.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));\n fire.setStartSize(0.6f);\n fire.setEndSize(0.1f);\n fire.setGravity(0f,0f,0f);\n fire.setLowLife(0.5f);\n fire.setHighLife(3f);\n fire.getParticleInfluencer().setVelocityVariation(0.3f);\n rootNode.attachChild(fire);\n"; + String body = " /** Uses Texture from jme3-test-data library! */\n ParticleEmitter fireEffect = new ParticleEmitter(\"Emitter\", ParticleMesh.Type.Triangle, 30);\n Material fireMat = new Material(assetManager, \"Common/MatDefs/Misc/Particle.j3md\");\n //fireMat.setTexture(\"Texture\", assetManager.loadTexture(\"Effects/Explosion/flame.png\"));\n fireEffect.setMaterial(fireMat);\n fireEffect.setImagesX(2); fireEffect.setImagesY(2); // 2x2 texture animation\n fireEffect.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f) ); // red\n fireEffect.setStartColor( new ColorRGBA(1f, 1f, 0f, 0.5f) ); // yellow\n fireEffect.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 2, 0));\n fireEffect.setStartSize(0.6f);\n fireEffect.setEndSize(0.1f);\n fireEffect.setGravity(0f,0f,0f);\n fireEffect.setLowLife(0.5f);\n fireEffect.setHighLife(3f);\n fireEffect.getParticleInfluencer().setVelocityVariation(0.3f);\n rootNode.attachChild(fireEffect);\n"; return body; } diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteModel.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteModel.java index 1de0dee9e..9adc071c1 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteModel.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteModel.java @@ -47,7 +47,7 @@ public class JmePaletteModel implements ActiveEditorDrop { private String createBody() { - String body = " /** Load a model. Uses model and texture from jme3-test-data library! */ \n Spatial teapot = assetManager.loadModel(\"Models/Teapot/Teapot.obj\");\n Material mat_default = new Material( assetManager, \"Common/MatDefs/Misc/ShowNormals.j3md\");\n teapot.setMaterial(mat_default);\n rootNode.attachChild(teapot);"; + String body = " /** Load a model. Uses model and texture from jme3-test-data library! */ \n Spatial teapot = assetManager.loadModel(\"Models/Teapot/Teapot.obj\");\n Material defaultMat = new Material( assetManager, \"Common/MatDefs/Misc/ShowNormals.j3md\");\n teapot.setMaterial(defaultMat);\n rootNode.attachChild(teapot);"; return body; } diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteShinySphere.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteShinySphere.java index ad8453128..4ebc5d606 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteShinySphere.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteShinySphere.java @@ -47,7 +47,7 @@ public class JmePaletteShinySphere implements ActiveEditorDrop { private String createBody() { - String body = "/** Illuminated bumpy rock with shiny effect. \n * Uses Texture from jme3-test-data library! Needs light source! */\nSphere rock = new Sphere(32,32, 2f);\nGeometry rock_shiny = new Geometry(\"Shiny rock\", rock);\nrock.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres\nTangentBinormalGenerator.generate(rock); // for lighting effect\nMaterial mat_shiny = new Material( assetManager, \"Common/MatDefs/Light/Lighting.j3md\");\nmat_shiny.setTexture(\"DiffuseMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond.png\"));\nmat_shiny.setTexture(\"NormalMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond_normal.png\"));\n//mat_shiny.setTexture(\"GlowMap\", assetManager.loadTexture(\"Textures/glowmap.png\")); // requires flow filter!\nmat_shiny.setBoolean(\"UseMaterialColors\",true); // needed for shininess\nmat_shiny.setColor(\"Specular\", ColorRGBA.White); // needed for shininess\nmat_shiny.setColor(\"Diffuse\", ColorRGBA.White); // needed for shininess\nmat_shiny.setFloat(\"Shininess\", 5f); // shininess from 1-128\nrock_shiny.setMaterial(mat_shiny);\nrootNode.attachChild(rock_shiny);"; + String body = "/** Illuminated bumpy rock with shiny effect. \n * Uses Texture from jme3-test-data library! Needs light source! */\nSphere sphereMesh = new Sphere(32,32, 2f);\nGeometry shinyGeo = new Geometry(\"Shiny rock\", sphereMesh);\nrock.setTextureMode(Sphere.TextureMode.Projected); // better quality on spheres\nTangentBinormalGenerator.generate(rock); // for lighting effect\nMaterial shinyMat = new Material( assetManager, \"Common/MatDefs/Light/Lighting.j3md\");\nshinyMat.setTexture(\"DiffuseMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond.png\"));\nshinyMat.setTexture(\"NormalMap\", assetManager.loadTexture(\"Textures/Terrain/Pond/Pond_normal.png\"));\n//shinyMat.setTexture(\"GlowMap\", assetManager.loadTexture(\"Textures/glowmap.png\")); // requires glow filter!\nshinyMat.setBoolean(\"UseMaterialColors\",true); // needed for shininess\nshinyMat.setColor(\"Specular\", ColorRGBA.White); // needed for shininess\nshinyMat.setColor(\"Diffuse\", ColorRGBA.White); // needed for shininess\nshinyMat.setFloat(\"Shininess\", 5f); // shininess from 1-128\nshinyGeo.setMaterial(shinyMat);\nrootNode.attachChild(shinyGeo);"; return body; } diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTextureCube.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTextureCube.java index 94b1153c2..83faf5b92 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTextureCube.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTextureCube.java @@ -47,7 +47,7 @@ public class JmePaletteTextureCube implements ActiveEditorDrop { private String createBody() { - String body = "/** An unshaded textured cube. \n * Uses texture from jme3-test-data library! */ \nBox boxshape1 = new Box(Vector3f.ZERO, 1f,1f,1f); \nGeometry cube_tex = new Geometry(\"A Textured Box\", boxshape1); \nMaterial mat_tex = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\"); \nTexture tex = assetManager.loadTexture(\"Interface/Logo/Monkey.jpg\"); \nmat_tex.setTexture(\"ColorMap\", tex); \ncube_tex.setMaterial(mat_tex); \nrootNode.attachChild(cube_tex); "; + String body = "/** An unshaded textured cube. \n * Uses texture from jme3-test-data library! */ \nBox boxMesh = new Box(1f,1f,1f); \nGeometry boxGeo = new Geometry(\"A Textured Box\", boxMesh); \nMaterial boxMat = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\"); \nTexture monkeyTex = assetManager.loadTexture(\"Interface/Logo/Monkey.jpg\"); \nboxMat.setTexture(\"ColorMap\", monkeyTex); \nboxGeo.setMaterial(boxMat); \nrootNode.attachChild(boxGeo); "; return body; } diff --git a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTrnspCube.java b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTrnspCube.java index 25cf441c8..990101937 100644 --- a/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTrnspCube.java +++ b/sdk/jme3-codepalette/src/com/jme3/gde/codepalette/scene/JmePaletteTrnspCube.java @@ -47,7 +47,7 @@ public class JmePaletteTrnspCube implements ActiveEditorDrop { private String createBody() { - String body = " /** Translucent/transparent cube. Uses Texture from jme3-test-data library! */\n Box boxshape3 = new Box(Vector3f.ZERO, 1f,1f,1f);\n Geometry cube_translucent = new Geometry(\"translucent cube\", boxshape3);\n Material mat_tt = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n mat_tt.setTexture(\"ColorMap\", assetManager.loadTexture(\"Textures/ColoredTex/Monkey.png\"));\n mat_tt.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);\n cube_translucent.setMaterial(mat_tt); \n rootNode.attachChild(cube_translucent); "; + String body = " /** Translucent/transparent cube. Uses Texture from jme3-test-data library! */\n Box boxMesh = new Box(1f,1f,1f);\n Geometry boxGeo = new Geometry(\"translucent cube\", boxMesh);\n Material boxMat = new Material(assetManager, \"Common/MatDefs/Misc/Unshaded.j3md\");\n boxMat.setTexture(\"ColorMap\", assetManager.loadTexture(\"Textures/ColoredTex/Monkey.png\"));\n boxMat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);\n boxGeo.setMaterial(boxMat); \n rootNode.attachChild(boxGeo); "; return body; }