* Fix crashes due to introduction of MaterialKey
* Deleted unused textures git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7908 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
026a72d57e
commit
d8afde19cf
Binary file not shown.
Before Width: | Height: | Size: 69 KiB |
Binary file not shown.
Binary file not shown.
@ -2,6 +2,7 @@ Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
|
||||
MaterialParameters {
|
||||
Shininess: 8.0
|
||||
NormalMap: Textures/BumpMapTest/Simple_normal.png
|
||||
ParallaxMap : Textures/BumpMapTest/Simple_height.png
|
||||
UseMaterialColors : true
|
||||
Ambient : 0 0 0 1
|
||||
Diffuse : 1 1 1 1
|
||||
|
@ -60,12 +60,12 @@ public class TestBumpModel extends SimpleApplication {
|
||||
@Override
|
||||
public void simpleInitApp() {
|
||||
Spatial signpost = (Spatial) assetManager.loadAsset(new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml", null));
|
||||
signpost.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Models/Sign Post/Sign Post.j3m")));
|
||||
signpost.setMaterial( (Material) assetManager.loadMaterial("Models/Sign Post/Sign Post.j3m"));
|
||||
TangentBinormalGenerator.generate(signpost);
|
||||
rootNode.attachChild(signpost);
|
||||
|
||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||
lightMdl.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Common/Materials/RedColor.j3m")));
|
||||
lightMdl.setMaterial( (Material) assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||
rootNode.attachChild(lightMdl);
|
||||
|
||||
// flourescent main light
|
||||
|
@ -63,7 +63,7 @@ public class TestMonkeyHead extends SimpleApplication {
|
||||
rootNode.attachChild(bumpy);
|
||||
|
||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||
lightMdl.setMaterial( (Material) assetManager.loadAsset(new AssetKey("Common/Materials/RedColor.j3m")));
|
||||
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||
rootNode.attachChild(lightMdl);
|
||||
|
||||
// flourescent main light
|
||||
|
@ -29,13 +29,11 @@
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package jme3test.model;
|
||||
|
||||
import com.jme3.app.SimpleApplication;
|
||||
import com.jme3.light.PointLight;
|
||||
import com.jme3.light.DirectionalLight;
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.FastMath;
|
||||
@ -43,8 +41,7 @@ import com.jme3.scene.Spatial;
|
||||
import com.jme3.scene.Geometry;
|
||||
import com.jme3.scene.shape.Sphere;
|
||||
|
||||
public class TestOgreLoading extends SimpleApplication
|
||||
{
|
||||
public class TestOgreLoading extends SimpleApplication {
|
||||
|
||||
float angle1;
|
||||
float angle2;
|
||||
@ -53,15 +50,12 @@ public class TestOgreLoading extends SimpleApplication
|
||||
Spatial lightMdl;
|
||||
Spatial lightMd2;
|
||||
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
TestOgreLoading app = new TestOgreLoading();
|
||||
app.start();
|
||||
}
|
||||
|
||||
public void simpleInitApp()
|
||||
{
|
||||
public void simpleInitApp() {
|
||||
// PointLight pl = new PointLight();
|
||||
// pl.setPosition(new Vector3f(10, 10, -10));
|
||||
// rootNode.addLight(pl);
|
||||
@ -75,11 +69,11 @@ public class TestOgreLoading extends SimpleApplication
|
||||
|
||||
|
||||
lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||
lightMdl.setMaterial( (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m"));
|
||||
lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
|
||||
rootNode.attachChild(lightMdl);
|
||||
|
||||
lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
|
||||
lightMd2.setMaterial( (Material) assetManager.loadAsset("Common/Materials/WhiteColor.j3m"));
|
||||
lightMd2.setMaterial(assetManager.loadMaterial("Common/Materials/WhiteColor.j3m"));
|
||||
rootNode.attachChild(lightMd2);
|
||||
|
||||
|
||||
@ -97,14 +91,12 @@ public class TestOgreLoading extends SimpleApplication
|
||||
// create the geometry and attach it
|
||||
Spatial elephant = (Spatial) assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
|
||||
float scale = 0.05f;
|
||||
elephant.scale(scale,scale,scale);
|
||||
elephant.scale(scale, scale, scale);
|
||||
rootNode.attachChild(elephant);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void simpleUpdate(float tpf)
|
||||
{
|
||||
public void simpleUpdate(float tpf) {
|
||||
angle1 += tpf * 0.25f;
|
||||
angle1 %= FastMath.TWO_PI;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class TestSphere extends SimpleApplication {
|
||||
@Override
|
||||
public void simpleInitApp() {
|
||||
Sphere sphMesh = new Sphere(14, 14, 1);
|
||||
Material solidColor = (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m");
|
||||
Material solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
||||
|
||||
for (int y = -5; y < 5; y++){
|
||||
for (int x = -5; x < 5; x++){
|
||||
|
@ -66,7 +66,7 @@ public class TestLeakingGL extends SimpleApplication {
|
||||
|
||||
// this will make sure all spheres are rendered always
|
||||
rootNode.setCullHint(CullHint.Never);
|
||||
solidColor = (Material) assetManager.loadAsset("Common/Materials/RedColor.j3m");
|
||||
solidColor = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
|
||||
cam.setLocation(new Vector3f(0, 5, 0));
|
||||
cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);
|
||||
|
||||
|
@ -56,15 +56,15 @@ public class TestLodStress extends SimpleApplication {
|
||||
dl.setDirection(new Vector3f(-1,-1,-1).normalizeLocal());
|
||||
rootNode.addLight(dl);
|
||||
|
||||
// Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
|
||||
// Geometry teapot = (Geometry) teapotNode.getChild(0);
|
||||
Node teapotNode = (Node) assetManager.loadModel("Models/Teapot/Teapot.mesh.xml");
|
||||
Geometry teapot = (Geometry) teapotNode.getChild(0);
|
||||
|
||||
Sphere sph = new Sphere(16, 16, 4);
|
||||
Geometry teapot = new Geometry("teapot", sph);
|
||||
// Sphere sph = new Sphere(16, 16, 4);
|
||||
// Geometry teapot = new Geometry("teapot", sph);
|
||||
|
||||
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
||||
mat.setFloat("Shininess", 16f);
|
||||
// mat.setBoolean("VertexLighting", true);
|
||||
mat.setBoolean("VertexLighting", true);
|
||||
teapot.setMaterial(mat);
|
||||
|
||||
// show normals as material
|
||||
@ -78,9 +78,9 @@ public class TestLodStress extends SimpleApplication {
|
||||
clonePot.setLocalTranslation(x * .5f, 0, y * .5f);
|
||||
clonePot.setLocalScale(.15f);
|
||||
|
||||
// LodControl control = new LodControl();
|
||||
// clonePot.addControl(control);
|
||||
// rootNode.attachChild(clonePot);
|
||||
LodControl control = new LodControl();
|
||||
clonePot.addControl(control);
|
||||
rootNode.attachChild(clonePot);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user