comparison src/com/aurellem/capture/examples/Advanced.java @ 52:d799a0278cc9

advanced documentation.
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Dec 2011 13:51:28 -0600
parents 8a091a5f48fa
children afc437f637bd
comparison
equal deleted inserted replaced
51:6a1b28f060e6 52:d799a0278cc9
49 * 49 *
50 * Multiple listeners as realized here might be used to make AI entities 50 * Multiple listeners as realized here might be used to make AI entities
51 * that can each hear the world from their own perspective. 51 * that can each hear the world from their own perspective.
52 * 52 *
53 * @author Robert McIntyre 53 * @author Robert McIntyre
54 *
55 */ 54 */
56 55
57 public class Advanced extends SimpleApplication { 56 public class Advanced extends SimpleApplication {
58 57
59 private Geometry bell; 58 /**
60 private Geometry ear1; 59 * You will see three grey cubes, a blue sphere, and a path
61 private Geometry ear2; 60 * which circles each cube. The blue sphere is generating a
62 private Geometry ear3; 61 * constant monotone sound as it moves along the track. Each
63 private AudioNode music; 62 * cube is listening for sound; when a cube hears sound whose
64 private MotionTrack motionControl; 63 * intensity is greater than a certain threshold, it changes
65 64 * its color from grey to green.
65 *
66 * Each cube is also saving whatever it hears to a file. The
67 * scene from the perspective of the viewer is also saved to
68 * a video file. When you listen to each of the sound files
69 * alongside the video, the sound will get louder when the
70 * sphere approaches the cube that generated that sound file.
71 * This shows that each listener is hearing the world from
72 * its own perspective.
73 *
74 */
66 public static void main(String[] args) { 75 public static void main(String[] args) {
67 Advanced app = new Advanced(); 76 Advanced app = new Advanced();
68 AppSettings settings = new AppSettings(true); 77 AppSettings settings = new AppSettings(true);
69 settings.setAudioRenderer(AurellemSystemDelegate.SEND); 78 settings.setAudioRenderer(AurellemSystemDelegate.SEND);
70 JmeSystem.setSystemDelegate(new AurellemSystemDelegate()); 79 JmeSystem.setSystemDelegate(new AurellemSystemDelegate());
79 catch (IOException e) {e.printStackTrace();} 88 catch (IOException e) {e.printStackTrace();}
80 89
81 app.start(); 90 app.start();
82 } 91 }
83 92
93
94 private Geometry bell;
95 private Geometry ear1;
96 private Geometry ear2;
97 private Geometry ear3;
98 private AudioNode music;
99 private MotionTrack motionControl;
100
84 private Geometry makeEar(Node root, Vector3f position){ 101 private Geometry makeEar(Node root, Vector3f position){
85 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); 102 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
86 Geometry ear = new Geometry("ear", new Box(1.0f, 1.0f, 1.0f)); 103 Geometry ear = new Geometry("ear", new Box(1.0f, 1.0f, 1.0f));
87 ear.setLocalTranslation(position); 104 ear.setLocalTranslation(position);
88 mat.setColor("Color", ColorRGBA.Green); 105 mat.setColor("Color", ColorRGBA.Green);