rectalogic

TestBox repro

Jun 8th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.34 KB | None | 0 0
  1. Index: src/test/jme3test/model/shape/TestBox.java
  2. ===================================================================
  3. --- src/test/jme3test/model/shape/TestBox.java  (revision 9461)
  4. +++ src/test/jme3test/model/shape/TestBox.java  (working copy)
  5. @@ -34,12 +34,15 @@
  6.  
  7.  import com.jme3.app.SimpleApplication;
  8.  import com.jme3.material.Material;
  9. +import com.jme3.math.ColorRGBA;
  10.  import com.jme3.math.Vector3f;
  11.  import com.jme3.scene.Geometry;
  12.  import com.jme3.scene.shape.Box;
  13.  
  14.  public class TestBox extends SimpleApplication {
  15.  
  16. +    private Material mat;
  17. +
  18.      public static void main(String[] args){
  19.          TestBox app = new TestBox();
  20.          app.start();
  21. @@ -49,10 +52,16 @@
  22.      public void simpleInitApp() {
  23.          Box b = new Box(Vector3f.ZERO, 1, 1, 1);
  24.          Geometry geom = new Geometry("Box", b);
  25. -        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  26. +        mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
  27.          mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
  28. +        mat.setColor("Color", ColorRGBA.randomColor());
  29.          geom.setMaterial(mat);
  30.          rootNode.attachChild(geom);
  31.      }
  32.  
  33. +    @Override
  34. +    public void simpleUpdate(float tpf) {
  35. +        mat.setColor("Color", ColorRGBA.randomColor());
  36. +    }
  37. +
  38.  }
Advertisement
Add Comment
Please, Sign In to add comment