Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. //
  2. // PlayRecordingOnAC.js
  3. // examples
  4. //
  5. // Created by Clément Brisset on 8/24/14.
  6. // Copyright 2014 High Fidelity, Inc.
  7. //
  8. // Distributed under the Apache License, Version 2.0.
  9. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
  10. //
  11.  
  12.  
  13. var filename = "https://dl.dropboxusercontent.com/u/10483952/badoo.hfrl";
  14. var playFromCurrentLocation = true;
  15. var loop = true;
  16.  
  17. //Avatar.faceModelURL = "http://public.highfidelity.io/models/heads/EvilPhilip_v7.fst";
  18. Avatar.skeletonModelURL = "http://public.highfidelity.io/models/skeletons/judas1.fst";
  19.  
  20. // Set position here if playFromCurrentLocation is true
  21. Avatar.position = { x:8016.8, y: 195.1, z: 8061.1 };
  22. Avatar.orientation = Quat.fromPitchYawRollDegrees(0, 0, 0);
  23. Avatar.scale = 1.0;
  24.  
  25. Agent.isAvatar = true;
  26.  
  27. Avatar.loadRecording(filename);
  28.  
  29. count = 300; // This is necessary to wait for the audio mixer to connect
  30. function update(event) {
  31. if (count > 0) {
  32. count--;
  33. return;
  34. }
  35. if (count == 0) {
  36. Avatar.setPlayFromCurrentLocation(playFromCurrentLocation);
  37. Avatar.setPlayerLoop(loop);
  38. Avatar.startPlaying();
  39. Avatar.play();
  40. Vec3.print("Playing from ", Avatar.position);
  41.  
  42. count--;
  43. }
  44.  
  45. if (Avatar.isPlaying()) {
  46. Avatar.play();
  47. } else {
  48. Script.update.disconnect(update);
  49. }
  50. }
  51.  
  52. Script.update.connect(update);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement